kern

view src/mboot.S @ 1:ebe5e0e44a9d

pretty much finished the code for article 1, might do minor adjustments though
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 02 Dec 2010 08:45:41 +0200
parents 662ff2170531
children af6f4adc43d6
line source
1 #define MAGIC 0x1badb002
2 #define FLAGS 0
3 #define STACK_SIZE 0x4000
5 .text
6 .align 4
8 /* multiboot header */
9 .long MAGIC
10 .long FLAGS
11 .long -(MAGIC + FLAGS) /* checksum */
12 .fill 5, 4 /* fill out the rest with zeroes */
14 .globl kentry
15 kentry:
16 /* setup a temporary kernel stack */
17 movl $(stack + STACK_SIZE), %esp
18 /* reset eflags register */
19 pushl $0
20 popf
21 /* call the kernel main function */
22 call kmain
23 /* we dropped out of main, halt the CPU */
24 cli
25 hlt
27 /* space for the temporary kernel stack */
28 .comm stack, STACK_SIZE