Kernel: Multiboot data and kernel command lines are now global variables
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include <BAN/Memory.h>
|
||||
#include <kernel/kmalloc.h>
|
||||
#include <kernel/Panic.h>
|
||||
#include <kernel/Serial.h>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <kernel/Input.h>
|
||||
#include <kernel/kmalloc.h>
|
||||
#include <kernel/kprint.h>
|
||||
#include <kernel/MMU.h>
|
||||
#include <kernel/multiboot.h>
|
||||
#include <kernel/Paging.h>
|
||||
#include <kernel/PIC.h>
|
||||
@@ -17,8 +18,7 @@
|
||||
#define DISABLE_INTERRUPTS() asm volatile("cli")
|
||||
#define ENABLE_INTERRUPTS() asm volatile("sti")
|
||||
|
||||
|
||||
multiboot_info_t* s_multiboot_info;
|
||||
extern "C" const char g_kernel_cmdline[];
|
||||
|
||||
using namespace BAN;
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
#define ALIGN (alignof(max_align_t))
|
||||
|
||||
extern "C" uintptr_t g_kernel_end;
|
||||
|
||||
/*
|
||||
#### KMALLOC ################
|
||||
*/
|
||||
@@ -47,14 +49,17 @@ static bool s_initialized = false;
|
||||
|
||||
void kmalloc_initialize()
|
||||
{
|
||||
if (!(s_multiboot_info->flags & (1 << 6)))
|
||||
if (!(g_multiboot_info->flags & (1 << 6)))
|
||||
Kernel::Panic("Kmalloc: Bootloader didn't provide a memory map");
|
||||
|
||||
if (g_kernel_end > s_kmalloc_node_base)
|
||||
Kernel::Panic("Kmalloc: Kernel end is over kmalloc base");
|
||||
|
||||
// Validate kmalloc memory
|
||||
bool valid = false;
|
||||
for (size_t i = 0; i < s_multiboot_info->mmap_length;)
|
||||
for (size_t i = 0; i < g_multiboot_info->mmap_length;)
|
||||
{
|
||||
multiboot_memory_map_t* mmmt = (multiboot_memory_map_t*)(s_multiboot_info->mmap_addr + i);
|
||||
multiboot_memory_map_t* mmmt = (multiboot_memory_map_t*)(g_multiboot_info->mmap_addr + i);
|
||||
|
||||
if (mmmt->type == 1)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user