diff options
author | cinap_lenrek <cinap_lenrek@centraldogma> | 2011-05-14 17:05:51 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@centraldogma> | 2011-05-14 17:05:51 +0000 |
commit | b4f2bf77b3710306bf1965201d526154c9dbddb7 (patch) | |
tree | f03fdbb84aaeba78609ae54eddd1ce29d729e726 /sys/src | |
parent | 545fc5e329dd80e766b4a1001a83b80855af877b (diff) |
fix overlapping arguments with Tos for initcode process
Diffstat (limited to 'sys/src')
-rw-r--r-- | sys/src/9/pc/main.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/src/9/pc/main.c b/sys/src/9/pc/main.c index f1e1fa20d..d82dacf36 100644 --- a/sys/src/9/pc/main.c +++ b/sys/src/9/pc/main.c @@ -4,6 +4,7 @@ #include "dat.h" #include "fns.h" #include "io.h" +#include "tos.h" #include "ureg.h" #include "init.h" #include "pool.h" @@ -289,10 +290,10 @@ bootargs(void *base) char *cp = BOOTLINE; char buf[64]; - sp = (uchar*)base + BY2PG - MAXSYSARG*BY2WD; + sp = (uchar*)base + BY2PG - sizeof(Tos); ac = 0; - av[ac++] = pusharg("/386/9dos"); + av[ac++] = pusharg("boot"); /* when boot is changed to only use rc, this code can go away */ cp[BOOTLINELEN-1] = 0; @@ -313,9 +314,10 @@ bootargs(void *base) sp -= (ac+1)*sizeof(sp); lsp = (uchar**)sp; for(i = 0; i < ac; i++) - *lsp++ = av[i] + ((USTKTOP - BY2PG) - (ulong)base); - *lsp = 0; - sp += (USTKTOP - BY2PG) - (ulong)base - sizeof(ulong); + lsp[i] = av[i] + ((USTKTOP - BY2PG) - (ulong)base); + lsp[i] = 0; + sp += (USTKTOP - BY2PG) - (ulong)base; + sp -= BY2WD; } char* |