diff options
Diffstat (limited to 'asm')
| -rw-r--r-- | asm/multiboot.h | 16 | ||||
| -rw-r--r-- | asm/multiboot.s | 6 |
2 files changed, 20 insertions, 2 deletions
diff --git a/asm/multiboot.h b/asm/multiboot.h new file mode 100644 index 0000000..f2acaf1 --- /dev/null +++ b/asm/multiboot.h @@ -0,0 +1,16 @@ +/** + * @file + * _multiboot.s_ defines the following sections/functions, some are linked at + * specific addresses in the final ELF kernel binary. + * This is specified in the _linker.ld_ file. + * + * * 0x07000 .smp - entry point for application processors (16bit code) + * * 0x10000 .multiboot - the multiboot header + * * .text + * * .bootstrap_stack + * * _start() - main entry point for booting cpu, calls kernel_main(). + */ + +/** This will be called by a multiboot compilant boot-loader (i.e. grub2) */ +void _start(); + diff --git a/asm/multiboot.s b/asm/multiboot.s index 837aa0b..bb12a7c 100644 --- a/asm/multiboot.s +++ b/asm/multiboot.s @@ -16,7 +16,7 @@ # entry point for application processors at 0x7000 .section .smp .code16 -call smp_go +call smp_go # TODO: align later before going C # Declare a header as in the Multiboot Standard. We put this into a special # section so we can force the header to be in the start of the final program. @@ -37,7 +37,8 @@ call smp_go .long 0 .long 0 -.long 0 #gfx_stuff 0=enable! +# we override this from grub anyway +.long 0 #gfx_stuff 0=enable! .long 640 .long 480 .long 32 @@ -66,6 +67,7 @@ _start: # our stack (as it grows downwards). movl $stack_top, %esp + sub $8, %esp #to align on 16byte before calling C push %ebx #pass address of the multiboot information data structure push %eax #pass eax, so kernel can check for magic number |
