kern

annotate src/mboot.S @ 6:7e40f14617ed

forgot to add stdarg.h and stdlib.c
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 13 Jan 2011 20:24:10 +0200
parents 662ff2170531
children af6f4adc43d6
rev   line source
nuclear@0 1 #define MAGIC 0x1badb002
nuclear@0 2 #define FLAGS 0
nuclear@0 3 #define STACK_SIZE 0x4000
nuclear@0 4
nuclear@0 5 .text
nuclear@0 6 .align 4
nuclear@1 7
nuclear@0 8 /* multiboot header */
nuclear@0 9 .long MAGIC
nuclear@0 10 .long FLAGS
nuclear@0 11 .long -(MAGIC + FLAGS) /* checksum */
nuclear@0 12 .fill 5, 4 /* fill out the rest with zeroes */
nuclear@0 13
nuclear@1 14 .globl kentry
nuclear@0 15 kentry:
nuclear@0 16 /* setup a temporary kernel stack */
nuclear@0 17 movl $(stack + STACK_SIZE), %esp
nuclear@0 18 /* reset eflags register */
nuclear@0 19 pushl $0
nuclear@0 20 popf
nuclear@0 21 /* call the kernel main function */
nuclear@0 22 call kmain
nuclear@0 23 /* we dropped out of main, halt the CPU */
nuclear@0 24 cli
nuclear@0 25 hlt
nuclear@0 26
nuclear@0 27 /* space for the temporary kernel stack */
nuclear@0 28 .comm stack, STACK_SIZE