OSDN Git Service

0e5f8457e1769793fcf37a8f8d01be880e30dd5c
[vaneos/vaneosmain.git] / bu / load.S
1 #define ASM_FILE 1
2 #include <multiboot.h>
3 #define EXT_C(func)                    func
4 #define STACK_SIZE                     0x4000
5 #define MULTIBOOT_HEADER_FLAGS         0x00000003
6
7 .text
8 .global start,_start
9
10 start:
11  _start:
12         jmp     multiboot_entry
13         .align  4
14
15 multiboot_header:
16         .long   MULTIBOOT_HEADER_MAGIC
17         .long   MULTIBOOT_HEADER_FLAGS
18         .long   -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
19
20 multiboot_entry:
21         movl    $(stack + STACK_SIZE), %esp
22         pushl   $0
23         popf
24         pushl   %ebx
25         pushl   %eax
26         
27         call    EXT_C(cstart)
28
29 loop:
30         hlt
31         jmp    loop
32
33         
34 .comm   stack, STACK_SIZE