mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-18 08:06:32 +00:00
将内核层空间移动到0xffff800000000000
This commit is contained in:
@ -3,18 +3,18 @@
|
||||
|
||||
#include "../../common/glib.h"
|
||||
#include "../../common/kprint.h"
|
||||
uintptr_t boot_info_addr;
|
||||
uintptr_t multiboot2_boot_info_addr;
|
||||
unsigned int multiboot2_magic;
|
||||
unsigned int boot_info_size;
|
||||
unsigned int multiboot2_boot_info_size;
|
||||
|
||||
bool multiboot2_init(void)
|
||||
{
|
||||
uintptr_t *addr = (uintptr_t *)boot_info_addr;
|
||||
uintptr_t *addr = (uintptr_t *)multiboot2_boot_info_addr;
|
||||
if (multiboot2_magic != MULTIBOOT2_BOOTLOADER_MAGIC)
|
||||
;
|
||||
return false;
|
||||
// addr+0 处保存了大小
|
||||
boot_info_size = *(unsigned int *)addr;
|
||||
multiboot2_boot_info_size = *(unsigned int *)addr;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -22,9 +22,9 @@ void multiboot2_iter(bool (*_fun)(const struct iter_data_t *, void *, unsigned i
|
||||
void *data, unsigned int *count)
|
||||
{
|
||||
|
||||
uintptr_t addr = boot_info_addr;
|
||||
// 下一字节开始为 tag 信息
|
||||
struct iter_data_t *tag = (struct iter_data_t *)(addr + 8);
|
||||
uintptr_t addr = multiboot2_boot_info_addr;
|
||||
// 接下来的第8字节开始,为 tag 信息
|
||||
struct iter_data_t *tag = (struct iter_data_t *)((void*)addr + 8);
|
||||
for (; tag->type != MULTIBOOT_TAG_TYPE_END;
|
||||
tag = (struct iter_data_t *)((uint8_t *)tag + ALIGN(tag->size, 8)))
|
||||
{
|
||||
|
Reference in New Issue
Block a user