kern

diff src/boot/mboot.S @ 10:b11a86695493

interrupt handling
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 18 Feb 2011 08:42:32 +0200
parents src/mboot.S@af6f4adc43d6
children 7f9af8cddc96
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/boot/mboot.S	Fri Feb 18 08:42:32 2011 +0200
     1.3 @@ -0,0 +1,28 @@
     1.4 +#define MAGIC		0x1badb002
     1.5 +#define FLAGS		0
     1.6 +#define STACK_SIZE	0x4000
     1.7 +
     1.8 +	.text
     1.9 +	.align 4
    1.10 +	
    1.11 +	/* multiboot header */
    1.12 +	.long MAGIC
    1.13 +	.long FLAGS
    1.14 +	.long -(MAGIC + FLAGS)	/* checksum */
    1.15 +	.fill 5, 4, 0	/* fill out the rest with zeroes */
    1.16 +
    1.17 +	.globl kentry
    1.18 +kentry:
    1.19 +	/* setup a temporary kernel stack */
    1.20 +	movl $(stack + STACK_SIZE), %esp
    1.21 +	/* reset eflags register */
    1.22 +	pushl $0
    1.23 +	popf
    1.24 +	/* call the kernel main function */
    1.25 +	call kmain
    1.26 +	/* we dropped out of main, halt the CPU */
    1.27 +	cli
    1.28 +	hlt
    1.29 +
    1.30 +	/* space for the temporary kernel stack */
    1.31 +	.comm stack, STACK_SIZE