aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFeng Tang <feng.tang@intel.com>2010-06-21 17:21:12 +0800
committerFeng Tang <feng.tang@intel.com>2010-07-20 11:10:04 +0800
commit63f0469c9012fde38c91bf22252b93c3af24b2af (patch)
tree578baffc051bd9d547a01b0a0abea519356af4f9
parent873e2887a7febc3e5b96375aae35549d7aad5149 (diff)
downloadsyslinux-63f0469c9012fde38c91bf22252b93c3af24b2af.tar.gz
syslinux-63f0469c9012fde38c91bf22252b93c3af24b2af.tar.xz
syslinux-63f0469c9012fde38c91bf22252b93c3af24b2af.zip
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
-rw-r--r--core/elflink/execute.c12
-rw-r--r--core/mem/init.c3
2 files changed, 13 insertions, 2 deletions
diff --git a/core/elflink/execute.c b/core/elflink/execute.c
index 1a7ce797..08946aac 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 497c2134..cf451048 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)