Added platform_start_kernel() function.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7268 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2004-04-20 23:52:17 +00:00
parent c93599a8ae
commit ffcff6e28c

View File

@ -10,6 +10,7 @@
#include <SupportDefs.h>
#include <boot/platform.h>
#include <boot/heap.h>
#include <boot/stage2.h>
#include <string.h>
@ -51,6 +52,24 @@ platform_user_menu_requested(void)
}
void
platform_start_kernel(void)
{
mmu_init_for_kernel();
printf("kernel args at %p\n", &gKernelArgs);
asm("movl %0, %%eax; " // move stack out of way
"movl %%eax, %%esp; "
: : "m" (gKernelArgs.cpu_kstack[0].start + gKernelArgs.cpu_kstack[0].size));
asm("pushl $0x0; " // we're the BSP cpu (0)
"pushl %0; " // kernel args
"pushl $0x0;" // dummy retval for call to main
"pushl %1; " // this is the start address
"ret; " // jump.
: : "g" (&gKernelArgs), "g" (gKernelEntry));
}
void
_start(void)
{