Parse multiboot information

This commit is contained in:
2017-12-04 22:09:14 +01:00
parent d0b946f327
commit 49f7738be2
6 changed files with 224 additions and 7 deletions

View File

@@ -8,6 +8,7 @@
#include <stdint.h>
#define V2P(a) ((uintptr_t)(a) & ~KERNEL_OFFSET)
#define P2V(a) ((void *)((uintptr_t)(a) | KERNEL_OFFSET))
#define incptr(p, n) ((void *)(((uintptr_t)(p)) + (n)))
#endif
#define P1_OFFSET(a) (((a)>>12) & 0x1FF)

View File

@@ -0,0 +1,25 @@
#pragma once
#include <stdint.h>
struct kernel_boot_data_st
{
int multiboot_version;
char *bootloader;
char *commandline;
};
struct kernel_boot_data_st kernel_boot_data;
struct mboot2_taglist{
uint32_t total_size;
uint32_t reserved;
}__attribute__((packed));
struct mboot2_tag {
uint32_t type;
uint32_t size;
uint8_t data[];
}__attribute__((packed));
#define MBOOT2_COMMANDLINE 1
#define MBOOT2_BOOTLOADER 2
int parse_multiboot(uint64_t magic, void *mboot_info);