diff --git a/arch/x86/include/asm/multiboot.h b/arch/x86/include/asm/multiboot.h index a4d5c23..e5d2c19 100644 --- a/arch/x86/include/asm/multiboot.h +++ b/arch/x86/include/asm/multiboot.h @@ -150,6 +150,8 @@ struct multiboot_mod_list }; typedef struct multiboot_mod_list multiboot_module_t; -extern multiboot_info_t* mb_info; +/// Pointer to multiboot structure +/// This pointer is declared at set by entry.asm +extern multiboot_info_t* mb_info; #endif diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index b0c0676..2f4b45c 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -1,4 +1,4 @@ -C_source := tasks.c multiboot.c vga.c gdt.c irq.c idt.c isrs.c timer.c processor.c +C_source := tasks.c vga.c gdt.c irq.c idt.c isrs.c timer.c processor.c ASM_source := entry.asm string32.asm MODULE := arch_x86_kernel diff --git a/arch/x86/kernel/entry.asm b/arch/x86/kernel/entry.asm index 7765620..084f410 100644 --- a/arch/x86/kernel/entry.asm +++ b/arch/x86/kernel/entry.asm @@ -64,10 +64,7 @@ stublet: ; Initialize CPU features call cpu_init ; Interpret multiboot information - extern multiboot_init - push ebx - call multiboot_init - add esp, 4 + mov DWORD [mb_info], ebx ; Jump to the boot processors's C code extern main @@ -316,6 +313,11 @@ no_context_switch: SECTION .data +global mb_info: +ALIGN 4 +mb_info: + DD 0 + global boot_stack ALIGN 4096 boot_stack: diff --git a/arch/x86/kernel/multiboot.c b/arch/x86/kernel/multiboot.c deleted file mode 100644 index f6bd932..0000000 --- a/arch/x86/kernel/multiboot.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2010, Stefan Lankes, RWTH Aachen University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include - -/* - * eduOS is able to use Multiboot (http://www.gnu.org/software/grub/manual/multiboot/), - * which specifies an interface between a boot loader and a operating system - */ - -multiboot_info_t* mb_info __attribute__ ((section (".data"))) = NULL; - -void multiboot_init(void* mb) -{ - mb_info = (multiboot_info_t*) mb; -}