aboutsummaryrefslogtreecommitdiff
path: root/src/header/boot.s
diff options
context:
space:
mode:
Diffstat (limited to 'src/header/boot.s')
-rw-r--r--src/header/boot.s59
1 files changed, 0 insertions, 59 deletions
diff --git a/src/header/boot.s b/src/header/boot.s
deleted file mode 100644
index aba32ff..0000000
--- a/src/header/boot.s
+++ /dev/null
@@ -1,59 +0,0 @@
-MBALIGN equ 1<<0 ; Align loaded modules on page boundries */
-MBMEMINFO equ 1<<1 ; Provide memory map*/
-MBFLAGS equ MBALIGN | MBMEMINFO ; Multiboot flag field*/
-MAGIC equ 0x1BADB002 ;Lets bootloader find header*/
-CHECKSUM equ -(MAGIC + MBFLAGS) ; Proves we are multiboot via checksum*/
-CODESEG equ 0x08
-DATASEG equ 0x10
-
-section .multiboot
-align 4
- dd MAGIC
- dd MBFLAGS
- dd CHECKSUM
-
-section .bss
-align 16
-stack_bottom:
-resb 16384
-stack_top:
-
-section .text
-global gdtr
-gdtr:
- dw 0
- dd 0
-global _start:function (_start.end - _start)
-_start:
- mov esp, stack_top
-
- extern get_gdtr
- call get_gdtr
- cli
- lgdt [gdtr]
- mov eax, cr0
- or al, 1
- mov cr0, eax
-
- call reloadSegments
-
- [bits 32]
- extern kernel_main
- call kernel_main
-
-
- cli
-.hang: hlt
- jmp .hang
-.end:
-
-reloadSegments:
- JMP CODESEG:.reload_CS ; should def define a CODESEG
-.reload_CS:
- MOV AX, DATASEG
- MOV DS, AX
- MOV ES, AX ; TODO: Setup proper extra segment
- MOV FS, AX ; TODO: Setup proper General purpose segments
- MOV GS, AX ; ...
- MOV SS, AX ; TODO: Setup proper stack segment
- RET