Minor changes

This commit is contained in:
2025-04-10 11:50:10 +02:00
parent 7c2fcd8e9f
commit ba28eafb20
5 changed files with 9 additions and 10 deletions
+5 -4
View File
@@ -16,9 +16,6 @@ void kmain(void* ptr, uint32_t magic) {
if (serial_init(COM1) != 0) panic("Failed to initialize Serial driver.");
debugf("\x1b[H\x1b[J\x1b[0mkern. \x1b[36m(serial console)\x1b[0m\n\n");
// VGA tty thingy
if (tty_init() != 0) panic("Failed to initalize TTY driver.");
tty_puts("kern.\n\n");
// System init
if (gdt_init() != 0) panic("Failed to initalize GDT.");
@@ -29,7 +26,11 @@ void kmain(void* ptr, uint32_t magic) {
if (pmm_init() != 0) panic("Failed to initalize Physical Memory Manager.");
if (vmm_init() != 0) panic("Failed to initalize Virtual Memory Manager.");
debugf("Basic initialization complete!\n");
// VGA TTY
if (tty_init() != 0) panic("Failed to initalize TTY driver.");
tty_puts("kern.\n\n");
debugf("[kernel] Basic initialization complete!\n");
panic("kmain() reached end.");
}
+1
View File
@@ -65,6 +65,7 @@ int pmm_init(void) {
bmap_setarea(&pmm_bitmap, bitmapStartPhys, pmm_bitmap.bytes, 1);
bmap_setarea(&pmm_bitmap, pageFrameStart, ptcount * PAGE_SIZE, 1);
bmap_set(&pmm_bitmap, 0, 1); // Reserve block 0 - NULL page
// Beatifull print statement :)
-3
View File
@@ -16,13 +16,10 @@ int vmm_init(void) {
vmm_bitmap.bytes = dceil(vmm_bitmap.blocks, 8);
uint32_t bitmaploc = 0xC6000000;
debugf("%d blocks in %d bytes\n", vmm_bitmap.blocks, vmm_bitmap.bytes);
size_t pagecount = dceil(vmm_bitmap.bytes, PAGE_SIZE);
for (size_t i = 0; i < pagecount; i++) {
void* fr = pmm_allocPage();
debugf("Allocating page %d/%d...\n", i+1, pagecount);
if (fr == NULL) return 1;
debugf("Mapping page at 0x%08x to 0x%08x\n", fr, bitmaploc + i * PAGE_SIZE);
pag_mapPage(bitmaploc + i * PAGE_SIZE, (uint32_t)fr, 0);
}