From 63f0469c9012fde38c91bf22252b93c3af24b2af Mon Sep 17 00:00:00 2001 From: Feng Tang Date: Mon, 21 Jun 2010 17:21:12 +0800 Subject: [PATCH] elflink: make linux kernel booting * modify execute.c to not using __com32.cs_bounce but lmalloc/lfree * give core/malloc 32M memory Now the kernel is loading ok, but "memdisk initrd=doshd.img" is not working, need ask hpa if he has a new doshd.img --- core/elflink/execute.c | 12 +++++++++++- core/mem/init.c | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/core/elflink/execute.c b/core/elflink/execute.c index 1a7ce79..08946aa 100644 --- a/core/elflink/execute.c +++ b/core/elflink/execute.c @@ -21,7 +21,8 @@ void execute(const char *cmdline, enum kernel_type type) { com32sys_t ireg; const char *p, *const *pp; - char *q = __com32.cs_bounce; + //char *q = __com32.cs_bounce; + char *q; const char *kernel, *args; /* work around for spawn_load parameter */ @@ -29,6 +30,13 @@ void execute(const char *cmdline, enum kernel_type type) memset(&ireg, 0, sizeof ireg); + q = lmalloc(128); + if (!q) { + printf("%s(): Fail to lmalloc a buffer to exec %s\n", + __func__, cmdline); + return; + } + kernel = q; p = cmdline; while (*p && !my_isspace(*p)) @@ -81,5 +89,7 @@ void execute(const char *cmdline, enum kernel_type type) __intcall(0x22, &ireg, NULL); } + lfree(kernel); + /* If this returns, something went bad; return to menu */ } diff --git a/core/mem/init.c b/core/mem/init.c index 497c213..cf45104 100644 --- a/core/mem/init.c +++ b/core/mem/init.c @@ -8,7 +8,8 @@ struct free_arena_header __core_malloc_head[NHEAP]; //static __hugebss char main_heap[128 << 10]; -static __hugebss char main_heap[128 << 13]; +/* change it to 32M */ +static __hugebss char main_heap[32 << 20]; extern char __lowmem_heap[]; void mem_init(void) -- 2.7.4