Makefile: add .c files as prerequisites where needed
[glg-os.git] / boot.s
blob1122779bb8b9c685635c1c609e9d84acce7ec499
1 # boot.s
3 # bootstrap assembly stub to setup the processor
4 # and call the kernel main function
5 ################################################
7 # declare multiboot header
9 .set ALIGN, 1<<0
10 .set MEMINFO, 1<<1
11 .set FLAGS, ALIGN | MEMINFO
12 .set MAGIC, 0x1BADB002
13 .set CHECKSUM, -(MAGIC + FLAGS)
15 .section .multiboot
16 .align 4
17 .long MAGIC
18 .long FLAGS
19 .long CHECKSUM
21 # set up a temporary stack
23 .section .bootstrap_stack
24 stack_bottom:
25 .skip 16384 # 16 KiB
26 stack_top:
28 # we are now ready to start working
30 .section .text
31 .global _start
32 .type _start, @function
33 _start:
35 # we are now in kernel mode.
36 # next, set up the actual stack
37 movl $stack_top, %esp
39 # then jump in the actual kernel
40 call kmain
42 # if we ever return from the kernel, we put the cpu in an idle loop
43 cli
44 hlt
45 .Lloop:
46 jmp .Lloop
48 # useful for debugging, call tracing etc
49 .size _start, . - _start