vx32

Local 9vx git repository for patches.
git clone git://r-36.net/vx32
Log | Files | Refs

commit d66e3ab6a3789eb88f1d5cf6534ead17169e5bcb
parent e5c176d25652c67e3199d1f7b8565c559a8a1f38
Author: Jesus Galan Lopez (yiyus) <yiyu.jgl@gmail.com>
Date:   Tue, 29 Jun 2010 02:43:16 +0200

fix bug with memsize var

Diffstat:
src/9vx/bootcode.9 | 0
src/9vx/conf.c | 6+++---
src/9vx/conf.h | 2+-
src/9vx/main.c | 7++++---
src/9vx/mmu.c | 2+-
5 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/9vx/bootcode.9 b/src/9vx/bootcode.9 Binary files differ. diff --git a/src/9vx/conf.c b/src/9vx/conf.c @@ -131,7 +131,7 @@ iniopt(char *name, char *value) else if(strcmp(name, "cpulimit") == 0) cpulimit = atoi(value); else if(strcmp(name, "memsize") == 0) - memsize = atoi(value); + memmb = atoi(value); else if(strcmp(name, "netdev") == 0){ if(strncmp(value, "tap", 3) == 0) { vetap = 1; @@ -181,8 +181,8 @@ printconfig(char *argv0){ initrc ? "i " : "", usetty ? "t " : ""); if(cpulimit != 0) print(" -l %d", cpulimit); - if(memsize != 0) - print(" -m %d", memsize); + if(memmb != 0) + print(" -m %d", memmb); for(i=0; i<nve; i++){ print(" -n %s", ve[i].tap ? "tap ": ""); if(ve[i].dev != nil) diff --git a/src/9vx/conf.h b/src/9vx/conf.h @@ -9,7 +9,7 @@ int initrc; /* run rc instead of init */ int nofork; /* do not fork at init */ int nogui; /* do not start the gui */ int usetty; /* use tty for input/output */ -int memsize; /* memory size */ +int memmb; /* memory size in mb */ int bootargc; char** bootargv; char* inifile; diff --git a/src/9vx/main.c b/src/9vx/main.c @@ -92,7 +92,7 @@ main(int argc, char **argv) cpulimit = 0; inifile = nil; memset(iniline, 0, MAXCONF); - memsize = 0; + memmb = 0; nogui = 0; nofork = 0; nve = 0; @@ -145,7 +145,7 @@ main(int argc, char **argv) cpulimit = atoi(EARGF(usage())); break; case 'm': - memsize = atoi(EARGF(usage())); + memmb = atoi(EARGF(usage())); break; case 'n': vetap = 0; @@ -193,7 +193,7 @@ main(int argc, char **argv) if(eve == nil) panic("strdup eve"); - mmusize(memsize); + mmusize(memmb); mach0init(); mmuinit(); confinit(); @@ -505,6 +505,7 @@ init0(void) inienv("init", "/386/bin/rc -i"); if(localroot) inienv("nobootprompt", nobootprompt(localroot)); + inienv("cputype", "386"); poperror(); diff --git a/src/9vx/mmu.c b/src/9vx/mmu.c @@ -28,7 +28,7 @@ int tracemmu; * * This value may be changed with the -m switch. */ -static int memsize = (256<<20); +int memsize = (256<<20); static int pagefile; static char* pagebase;