Repos / kernel.git / commitdiff
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 38a6224)
raw | patch | inline | side by side (parent: 38a6224)
| author | zhaoyanbai <zhaoyanbai@126.com> | |
| Fri, 2 May 2014 03:14:17 +0000 (11:14 +0800) | ||
| committer | zhaoyanbai <zhaoyanbai@126.com> | |
| Fri, 2 May 2014 03:14:17 +0000 (11:14 +0800) |
| kernel/init.c | patch | blob | history |
diff --git a/kernel/init.c b/kernel/init.c
--- a/kernel/init.c
+++ b/kernel/init.c
int KernelEntry()
{
- /*
- asm("movl $kernel_stack,%%esp;"
- "addl %%eax,%%esp;"
- ::"a"(KRNL_STACK_SIZE));
-*/
setup_kernel();
+#if 0
char *root_task_user_space_stack = (char *) alloc_pages(0, 0);
asm("movl $0x23,%%eax; \
leal root_task_entry,%%eax; \
pushl %%eax; \
iret;"::"b"(root_task_user_space_stack+PAGE_SIZE));
+#else
+ asm("xorl %eax, %eax; \
+ sti;\
+ pushfl; \
+ movw %cs, %ax; \
+ pushl %eax;\
+ leal root_task_entry,%eax; \
+ pushl %eax; \
+ iret;");
+#endif
return 0; /* never come to here */
}
{
while(1)
{
- syscall0(SYSC_TEST);
+ asm("hlt;");
+ //syscall0(SYSC_TEST);
}
pid_t pid;
/*