diff options
| author | Franklin Wei <frankhwei536@gmail.com> | 2015-02-01 11:33:16 -0500 |
|---|---|---|
| committer | Franklin Wei <frankhwei536@gmail.com> | 2015-02-01 11:33:16 -0500 |
| commit | 439d724ce5939cab7a5c858d1829f212e01e0402 (patch) | |
| tree | 154afa843a96e4cebd4d4f4f480f36415668d620 /boot | |
| parent | 1d7843c2b6d746376f87c2634c92cd93d8cdb728 (diff) | |
| download | kappa-439d724ce5939cab7a5c858d1829f212e01e0402.zip kappa-439d724ce5939cab7a5c858d1829f212e01e0402.tar.gz kappa-439d724ce5939cab7a5c858d1829f212e01e0402.tar.bz2 kappa-439d724ce5939cab7a5c858d1829f212e01e0402.tar.xz | |
first real commit
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 |