diff options
Diffstat (limited to 'boot')
| -rw-r--r-- | boot/head.S | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/boot/head.S b/boot/head.S new file mode 100644 index 0000000..864ebeb --- /dev/null +++ b/boot/head.S @@ -0,0 +1,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 |