Parse multiboot information

This commit is contained in:
thomas committed 2018-03-20 14:11:21 +01:00
1 parent d0b946f327
commit 49f7738be2
6 files changed
+224 -7

No files matched your search

+1
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)
+25
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);