summaryrefslogtreecommitdiff
path: root/src/boot.s
diff options
context:
space:
mode:
Diffstat (limited to 'src/boot.s')
-rw-r--r--src/boot.s22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/boot.s b/src/boot.s
index 385ee70..a0f0c2e 100644
--- a/src/boot.s
+++ b/src/boot.s
@@ -9,7 +9,15 @@
.long MAGIC
.long FLAGS
.long CHECKSUM
-
+
+.global _start
+.global load_gdt
+
+load_gdt:
+ movl 4(%esp), %edx
+ lgdt (%edx)
+ ret
+
.section .bss
.align 16
stack_bottom:
@@ -17,15 +25,19 @@ stack_bottom:
stack_top:
.section .text
-.global _start
.type _start, @function
_start:
+ call init_gdt_table
+ mov 0x10, %ax
+ mov %ds, %ax
+ mov %es, %ax
+ mov %fs, %ax
+ mov %gs, %ax
+ mov %ss, %ax
mov $stack_top, %esp
-
+ cli
call _init
call kernel_main
-
- cli
1: hlt
jmp 1b