git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
formated code and fix include error in interrupts.c
[lunaix-os.git]
/
lunaix-os
/
arch
/
x86
/
boot.S
diff --git
a/lunaix-os/arch/x86/boot.S
b/lunaix-os/arch/x86/boot.S
index 8e019a56f9f8df812d159bddba3998448ee88ac0..b41d24bba5cd81b887032dbfc4272ea201223ae1 100644
(file)
--- a/
lunaix-os/arch/x86/boot.S
+++ b/
lunaix-os/arch/x86/boot.S
@@
-13,6
+13,10
@@
stack_top:
.section .text
stack_top:
.section .text
+ .global start_
+ .type start_, @function /* Optional, this just give the
+ * linker more knowledge about the label
+ */
start_:
movl $stack_top, %esp
/*
start_:
movl $stack_top, %esp
/*
@@
-22,7
+26,33
@@
3. Enable paging
*/
call _kernel_init
3. Enable paging
*/
call _kernel_init
+
+ subl $0x6, %esp
+ movl $_gdt, 2(%esp)
+ movw _gdt_limit, %ax
+ movw %ax, (%esp)
+ lgdt (%esp)
+
+ movl $_idt, 2(%esp)
+ movw _idt_limit, %ax
+ movw %ax, (%esp)
+ lidt (%esp)
+
+ addl $0x6, %esp
+
+ movw $0x10, %cx
+ movw %cx, %es
+ movw %cx, %ds
+ movw %cx, %fs
+ movw %cx, %gs
+ movw %cx, %ss
+
+ pushw $0x08
+ pushl $_after_gdt
+ retf
+
+ _after_gdt:
pushl %ebx
call _kernel_main
pushl %ebx
call _kernel_main