hazel/q
2024-06-27 14:49:11 -04:00

56 lines
1.5 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

diff --git a/kernel/init.asm b/kernel/init.asm
index ee88f16..798f6c2 100644
--- a/kernel/init.asm
+++ b/kernel/init.asm
@@ -9,13 +9,13 @@ dd -(MAGIC + FLAGS)
section .text
global _start
_start:
- cli
+ cli

- ; Check if EAX contains this magic value that our bootloader should've set
- cmp eax, 0x2BADB002
- jne halt
+ ; Check if EAX contains this magic value that our bootloader should've set
+ cmp eax, 0x2BADB002
+ jne halt

- ; Load GDT
+ ; Load GDT
lgdt [gdtp]
; Offset to kernel data descriptor
mov ax, 0x10 
@@ -24,19 +24,19 @@ _start:
mov fs, ax
mov gs, ax
mov ss, ax
- ; Offset to kernel code descriptor
+ ; Offset to kernel code descriptor
jmp 0x8:.use_code_seg
.use_code_seg:
mov esp, stack_bottom
mov ebp, esp
push ebx 
- and esp, 0xfffffff0
+ and esp, 0xfffffff0
extern kernel
call kernel
- cli
+ cli
halt:
- hlt
- jmp halt
+ hlt
+ jmp halt

section .data
; GDT for a flat memory layout
@@ -68,5 +68,5 @@ gdtp:
section .bss
align 16
stack_top:
- resb 16384
+ resb 16384
stack_bottom: