aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorprofkhaos <profkhaos@Khaos-Phantom.(none)>2009-08-06 02:29:57 +0300
committerprofkhaos <profkhaos@Khaos-Phantom.(none)>2009-08-06 02:29:57 +0300
commit69fecf277639b7ea1fef00bee762dc8c43be12f8 (patch)
tree5d7b28d87145f0aefd1c92b1854fcbe2c15cc263
parent22087470b21d10976eac1bc3491405d92bd5df47 (diff)
downloadbak.git-69fecf277639b7ea1fef00bee762dc8c43be12f8.tar.gz
bak.git-69fecf277639b7ea1fef00bee762dc8c43be12f8.tar.xz
bak.git-69fecf277639b7ea1fef00bee762dc8c43be12f8.zip
Functional config file parser and menu
-rw-r--r--com32/elflink/modules/mytest.c7
-rw-r--r--com32/lib/sys/module/exec.c4
-rw-r--r--core/elflink/load_env32.c8
3 files changed, 9 insertions, 10 deletions
diff --git a/com32/elflink/modules/mytest.c b/com32/elflink/modules/mytest.c
index e91e364e..65d3fdf3 100644
--- a/com32/elflink/modules/mytest.c
+++ b/com32/elflink/modules/mytest.c
@@ -18,15 +18,10 @@
#include "menu.h"
-int n=10;
-
static int mytest_main(int argc, char **argv)
{
- openconsole(&dev_stdcon_r, &dev_stdcon_w);
- //openconsole(&dev_rawcon_r, &dev_vesaserial_w);
+ console_ansi_raw();
menu_main(argc, argv);
- //printf("Something's fishy...\n");
-
return 0;
}
diff --git a/com32/lib/sys/module/exec.c b/com32/lib/sys/module/exec.c
index be090292..5671774c 100644
--- a/com32/lib/sys/module/exec.c
+++ b/com32/lib/sys/module/exec.c
@@ -164,8 +164,8 @@ int spawnv(const char *name, const char **argv)
for (arg = argv, argp = args; *arg; arg++, argp++) {
size_t l = strlen(*arg)+1;
- *args = alloca(l);
- memcpy(*args, *arg, l);
+ *argp = alloca(l);
+ memcpy(*argp, *arg, l);
}
*args = NULL;
diff --git a/core/elflink/load_env32.c b/core/elflink/load_env32.c
index 30f9c5e8..1595c566 100644
--- a/core/elflink/load_env32.c
+++ b/core/elflink/load_env32.c
@@ -82,8 +82,11 @@ void load_env32(com32sys_t * regs)
int i,n=5;
char **argv;
argv=(char**)calloc(n,sizeof(char*));
+ argv[0]=(char*)calloc(100,sizeof(char));//(char *)(regs->edi.w[0]);
argv[1]=(char*)calloc(100,sizeof(char));//(char *)(regs->edi.w[0]);
- strcpy(argv[1],(regs->edi.w[0]));
+ //strcpy(argv[1],(regs->edi.w[0]));
+ strcpy(argv[0],"extlinux.conf");
+ strcpy(argv[1],"extlinux.conf");
/*printf("\nBegin dynamic module test ...\n");
printf("\n\nTrying to laod 'dyn/sort.dyn'\n\n");*/
@@ -106,7 +109,8 @@ void load_env32(com32sys_t * regs)
/*printf("\n\nTrying to spawn 'dyn/hello.dyn'\n\n");
spawnv("dyn/hello.dyn",0);
printf("\nTest done\n");*/
- printf("%d\n",spawnv("mytest.c32",argv));
+ //printf("%d\n",spawnv("mytest.c32",argv));
+ spawnl("mytest.c32", "mytest", "extlinux.conf", NULL);
printf("Done\n");
while(1) 1; /* we don't have anything better to do so hang around for a bit */