Parse multiboot information
This commit is contained in:
@@ -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
src/kernel/include/multiboot.h
Normal file
25
src/kernel/include/multiboot.h
Normal 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);
|
||||
Reference in New Issue
Block a user