diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2003-05-13 00:25:15 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2003-05-13 00:25:15 +0000 |
commit | 54936004fddc52c321cb3f9a9a51140e782bed5d (patch) | |
tree | c7640924fd504c24529a1f6ec0b77bb947589682 /linux-user/main.c | |
parent | 74c95119f2bceb73c1695ffee08a934cddabe830 (diff) | |
download | qemu-54936004fddc52c321cb3f9a9a51140e782bed5d.tar.gz qemu-54936004fddc52c321cb3f9a9a51140e782bed5d.tar.bz2 qemu-54936004fddc52c321cb3f9a9a51140e782bed5d.zip |
mmap emulation
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@158 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user/main.c')
-rw-r--r-- | linux-user/main.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/linux-user/main.c b/linux-user/main.c index 00dc271778..a6a84e5363 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -231,13 +231,16 @@ void usage(void) "usage: qemu [-h] [-d] [-L path] [-s size] program [arguments...]\n" "Linux x86 emulator\n" "\n" - "-h print this help\n" - "-d activate log (logfile=%s)\n" - "-L path set the x86 elf interpreter prefix (default=%s)\n" - "-s size set the x86 stack size in bytes (default=%ld)\n", - DEBUG_LOGFILE, + "-h print this help\n" + "-L path set the x86 elf interpreter prefix (default=%s)\n" + "-s size set the x86 stack size in bytes (default=%ld)\n" + "\n" + "debug options:\n" + "-d activate log (logfile=%s)\n" + "-p pagesize set the host page size to 'pagesize'\n", interp_prefix, - x86_stack_size); + x86_stack_size, + DEBUG_LOGFILE); _exit(1); } @@ -284,6 +287,13 @@ int main(int argc, char **argv) x86_stack_size *= 1024; } else if (!strcmp(r, "L")) { interp_prefix = argv[optind++]; + } else if (!strcmp(r, "p")) { + host_page_size = atoi(argv[optind++]); + if (host_page_size == 0 || + (host_page_size & (host_page_size - 1)) != 0) { + fprintf(stderr, "page size must be a power of two\n"); + exit(1); + } } else { usage(); } @@ -311,12 +321,18 @@ int main(int argc, char **argv) /* Scan interp_prefix dir for replacement files. */ init_paths(interp_prefix); + /* NOTE: we need to init the CPU at this stage to get the + host_page_size */ + env = cpu_x86_init(); + if (elf_exec(filename, argv+optind, environ, regs, info) != 0) { printf("Error loading %s\n", filename); _exit(1); } if (loglevel) { + page_dump(logfile); + fprintf(logfile, "start_brk 0x%08lx\n" , info->start_brk); fprintf(logfile, "end_code 0x%08lx\n" , info->end_code); fprintf(logfile, "start_code 0x%08lx\n" , info->start_code); @@ -331,7 +347,6 @@ int main(int argc, char **argv) syscall_init(); signal_init(); - env = cpu_x86_init(); global_env = env; /* build Task State */ |