blob: 5c4381c1c471779440c3f1c338cfff9cf991ba03 [file] [log] [blame]
swissChilid8137922021-02-17 15:34:07 -08001;;; GRUB Multiboot header, calls main() in main.c
2
3MBOOT_PAGE_ALIGN equ 1<<0
4MBOOT_MEM_INFO equ 1<<1
5MBOOT_HEADER_MAGIC equ 0x1BADB002
6
7MBOOT_HEADER_FLAGS equ MBOOT_PAGE_ALIGN | MBOOT_MEM_INFO
8MBOOT_CHECKSUM equ -(MBOOT_HEADER_MAGIC + MBOOT_HEADER_FLAGS)
9
10
11 [bits 32]
12
13 [global mboot]
14 [extern code]
15 [extern bss]
16 [extern end]
17
18mboot:
19 dd MBOOT_HEADER_MAGIC ; This tells GRUB to start executing here:
20 dd MBOOT_HEADER_FLAGS
21 dd MBOOT_CHECKSUM
22
23 dd mboot ; Current location
24 dd code ; .text section
25 dd bss ; End of .data
26 dd end ; End of kernel
27 dd start
28
29 [global start]
30 [extern main] ; C code
31
32start:
33 push ebx ; Holds multiboot header location
34
35 cli
36 call main
37 jmp $