[Zion] Add an early debug method without allocations.

This commit is contained in:
Drew Galbraith 2023-11-05 08:48:41 -08:00
parent 85564b018d
commit 4af19d010f
3 changed files with 8 additions and 2 deletions

View File

@ -132,6 +132,8 @@ void dbg_internal(const char* fmt, va_list args) {
} // namespace } // namespace
void early_dbgln(const char* str) { dbgcstr(str); }
void dbg(const char* fmt, ...) { void dbg(const char* fmt, ...) {
va_list arg; va_list arg;
va_start(arg, fmt); va_start(arg, fmt);

View File

@ -4,6 +4,10 @@
#include "include/ztypes.h" #include "include/ztypes.h"
// Debug line without formatting for
// before allocations are available.
void early_dbgln(const char* str);
void dbg(const char* fmt, ...); void dbg(const char* fmt, ...);
void dbgln(const char* str, ...); void dbgln(const char* str, ...);
void panic(const char* str, ...); void panic(const char* str, ...);

View File

@ -17,11 +17,11 @@
#include "syscall/syscall.h" #include "syscall/syscall.h"
extern "C" void zion() { extern "C" void zion() {
dbgln("[boot] Init GDT & IDT."); early_dbgln("[boot] Init GDT & IDT.");
InitGdt(); InitGdt();
InitIdt(); InitIdt();
dbgln("[boot] Init Physical Memory Manager."); early_dbgln("[boot] Init Physical Memory Manager.");
phys_mem::InitBootstrapPageAllocation(); phys_mem::InitBootstrapPageAllocation();
KernelHeap heap(0xFFFFFFFF'40000000, 0xFFFFFFFF'80000000); KernelHeap heap(0xFFFFFFFF'40000000, 0xFFFFFFFF'80000000);
phys_mem::InitPhysicalMemoryManager(); phys_mem::InitPhysicalMemoryManager();