| Zeile 12: | Zeile 12: | ||
#include "Multiboot.h" | #include "Multiboot.h" | ||
| − | void | + | extern "C" void kernelMain(const Multiboot& multiboot_structur, |
| − | + | uint32_t multiboot_magic); | |
| + | |||
| + | void kernelMain(const Multiboot& multiboot_structur, | ||
| + | uint32_t multiboot_magic) | ||
{ | { | ||
if (multiboot_magic != MULTIBOOT_MAGIC) | if (multiboot_magic != MULTIBOOT_MAGIC) | ||
| Zeile 32: | Zeile 35: | ||
<cpp> | <cpp> | ||
| + | #ifndef TYPES_H | ||
| + | #define TYPES_H | ||
| + | |||
/* Garantiert, dass ein Typ nicht gepaddet wird und somit exakt die Größe seiner Member hat */ | /* Garantiert, dass ein Typ nicht gepaddet wird und somit exakt die Größe seiner Member hat */ | ||
#define PACKED __attribute__((packed)) | #define PACKED __attribute__((packed)) | ||
| Zeile 38: | Zeile 44: | ||
typedef unsigned short uint16_t; | typedef unsigned short uint16_t; | ||
typedef unsigned int uint32_t; | typedef unsigned int uint32_t; | ||
| + | |||
| + | #endif | ||
</cpp> | </cpp> | ||
| Zeile 198: | Zeile 206: | ||
#define MULTIBOOT_H | #define MULTIBOOT_H | ||
| − | #include | + | #include "types.h" |
#define MULTIBOOT_MAGIC 0x2BADB002 | #define MULTIBOOT_MAGIC 0x2BADB002 | ||
| Zeile 227: | Zeile 235: | ||
global loader ; Unser Einsprungspunkt | global loader ; Unser Einsprungspunkt | ||
| − | extern | + | extern kernelMain ; kernelMain() aus Kernel.cpp |
extern initialiseConstructors ; aus Startup.cpp | extern initialiseConstructors ; aus Startup.cpp | ||
FLAGS equ 0 | FLAGS equ 0 | ||
| − | MAGIC equ 0x1BADB002 | + | MAGIC equ 0x1BADB002 ; Magicnumber - Erkennungsmerkmal für GRUB |
| − | CHECKSUM equ -(MAGIC + FLAGS) | + | CHECKSUM equ -(MAGIC + FLAGS) ; Checksum |
section .text | section .text | ||
| Zeile 246: | Zeile 254: | ||
push ebx ; Adresse der Multiboot-Structure auf den Stack legen | push ebx ; Adresse der Multiboot-Structure auf den Stack legen | ||
call initialiseConstructors ; Konstruktoren aufrufen | call initialiseConstructors ; Konstruktoren aufrufen | ||
| − | call | + | call kernelMain ; kernelMain aufrufen |
stop: | stop: | ||