tape-kernel 1.0
a modular modern independent kernel
Loading...
Searching...
No Matches
boot.s
Go to the documentation of this file.
1.set ALIGN, 1<<0 #align is 1
2.set MEMINFO, 1<<1 #meminfo is 2
3.set FLAGS, ALIGN | MEMINFO
4.set MAGIC, 0x1BADB002
5.set CHECKSUM, -(MAGIC + FLAGS)
6
7.section .multiboot, "a" #a means allocatable section
8.align 4
9.long MAGIC
10.long FLAGS
11.long CHECKSUM
12
13.section .text
14.code32
15.global ___start
16.extern ___kmain
17
18___start:
19 mov $stack_top, %esp
20
21 push %ebx #second arg: ptr to multiboot info
22 push %eax #first arg: magic num (0x1BADB002)
23
24 call ___kmain
25
26 cli #not very obvious, basically just continue and clear interrupts
27hang: #if it doesnt go we just halt and jmp so it doesnt stop halting
28 hlt
29 jmp hang
30
31.section .bss
32.align 16
33stack_bottom:
34 .skip 16384
35stack_top:
36
37