diff --git a/dev/apic.c b/dev/apic.c index b58d69f..c5f532b 100644 --- a/dev/apic.c +++ b/dev/apic.c @@ -32,7 +32,6 @@ void ioapic_redirect_insert(size_t irq, size_t isr, size_t low_active, size_t le { /* Set the interrupt redirection entry */ ioapic_write(0x10 + 2 * irq, (level_trigger << 15) | (low_active << 13) | isr); - kprintf("lapic_id: %d\n", lapic_id); ioapic_write(0x10 + 2 * irq + 1, lapic_id << 24); } @@ -106,7 +105,6 @@ void apic_init() /* get ioapic version */ lapic_id = lapic_read(lapic_addr, 0x20); - kprintf(LOG_WARN "lapic_id: %d\n", lapic_id); ioapic_redirect_insert(4, 0x24, 0, 0); /* Set spurious interrupt vector to 0xFF and enable the LAPIC */ diff --git a/fs/vfs.c b/fs/vfs.c index 8edc756..a6890eb 100644 --- a/fs/vfs.c +++ b/fs/vfs.c @@ -273,7 +273,7 @@ void vfs_init(const char *rootdev_name) struct block_device *rootdev = block_get_device(rootdev_name); if (!rootdev) { kprintf(LOG_ERROR "Failed to find root device %s\n", rootdev_name); - return; + panic(); } kprintf(LOG_DEBUG "Found root device %s\n", rootdev_name); @@ -286,6 +286,7 @@ void vfs_init(const char *rootdev_name) return; } else { kprintf(LOG_DEBUG "Mounted root device %s\n", rootdev_name); + panic(); } fs->mount_point = kzalloc(2, ALLOC_KERN); diff --git a/include/kernel/common.h b/include/kernel/common.h index c79480d..42de0af 100644 --- a/include/kernel/common.h +++ b/include/kernel/common.h @@ -23,6 +23,7 @@ #define GB (KB * MB) void yield(); +void panic(); typedef uintptr_t paddr_t; typedef uint32_t paddr32_t; diff --git a/init/main.c b/init/main.c index b4b06de..e62420e 100644 --- a/init/main.c +++ b/init/main.c @@ -46,6 +46,13 @@ void yield() } } +void panic() +{ + kprintf(LOG_ERROR "KERNEL PANIC\n"); + cli(); + yield(); +} + static inline void _pic_init() { cli();