-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboot.asm
27 lines (22 loc) · 810 Bytes
/
boot.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
;; Assembly Kernel Loader for PyKern
MAGIC_NUMBER equ 0x1BADB002 ; define the magic number constant
FLAGS equ 0x0 ; multiboot flags
CHECKSUM equ -MAGIC_NUMBER ; calculate the checksum
; (magic number + checksum + flags should equal 0)
KERNEL_STACK_SIZE equ 8192 ; size of stack in bytes
section .text ; Multiboot spec
align 4
dd MAGIC_NUMBER
dd FLAGS
dd CHECKSUM
global start
extern kmain
start:
cli
mov esp, kernel_stack + KERNEL_STACK_SIZE
call kmain
hlt
section .bss
align 4
kernel_stack:
resb KERNEL_STACK_SIZE