aboutsummaryrefslogtreecommitdiff
path: root/boot/head.S
blob: 864ebebd71e365824b30209590ced180956920b0 (plain)
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
28
29
30
        .set ALIGN,      1<<0
        .set MEMINFO,    1<<1
        .set FLAGS,      ALIGN | MEMINFO
        .set MAGIC,      0x1BADB002 # multiboot magic
        .set CHECKSUM,   -(MAGIC + FLAGS)

.section .multiboot
        .align 4
multiboot_header:
        .long MAGIC
        .long FLAGS
        .long CHECKSUM

.section .stack
stack_bottom:                   # Stack grows up in addresses, so bottom is
                                # lower than the top
        .skip 16384             # 32KB stack
stack_top:

.section .text
        .global _start
        .type _start, @function
_start:
        movl $stack_top, %esp
        call main
        cli
        hlt
.Lhang:                   # Idle
        jmp .Lhang
        .size _start, . - _start