Add nice logs
diff --git a/src/kernel/dri/ata_pio/ata_pio.c b/src/kernel/dri/ata_pio/ata_pio.c
index db1b7cb..cf55b51 100644
--- a/src/kernel/dri/ata_pio/ata_pio.c
+++ b/src/kernel/dri/ata_pio/ata_pio.c
@@ -76,7 +76,7 @@
void test_ata_pio()
{
- kprintf("Going to ata_pio_read_sectors\n");
+ kprintf(INFO "Going to ata_pio_read_sectors\n");
ata_pio_read_sectors(test_buffer, 0, 1);
print_buffer();
diff --git a/src/kernel/dri/fs/ext2/ext2.c b/src/kernel/dri/fs/ext2/ext2.c
index 31ed7fe..d0dd3bd 100644
--- a/src/kernel/dri/fs/ext2/ext2.c
+++ b/src/kernel/dri/fs/ext2/ext2.c
@@ -16,5 +16,12 @@
{
struct ext2_superblock sb = ext2_read_superblock();
- kprintf("Magic = 0x%x\n", sb.signature);
+ kprintf(INFO "EXT2 magic = 0x%x\n", sb.signature);
}
+
+bool ext2_valid_filesystem()
+{
+ struct ext2_superblock sb = ext2_read_superblock();
+
+ return sb.signature == EXT2_SIGNATURE;
+}
\ No newline at end of file
diff --git a/src/kernel/dri/ide/ide.c b/src/kernel/dri/ide/ide.c
index 21f2651..0025970 100644
--- a/src/kernel/dri/ide/ide.c
+++ b/src/kernel/dri/ide/ide.c
@@ -16,12 +16,12 @@
void ide_print_device(struct ide_device *dev)
{
- kprintf("<ide-device dma=%b>", dev->supports_dma);
+ kprintf(INFO "<ide-device dma=%b>", dev->supports_dma);
}
void ide_thread(struct ide_thread_data *data)
{
- kprintf("IDE driver thread starting: device=0x%x\n", data->dev.device_id);
+ kprintf(DEBUG "IDE driver thread starting: device=0x%x\n", data->dev.device_id);
struct ide_device dev;
diff --git a/src/kernel/dri/pci/pci.c b/src/kernel/dri/pci/pci.c
index 6d35edc..4d2d01e 100644
--- a/src/kernel/dri/pci/pci.c
+++ b/src/kernel/dri/pci/pci.c
@@ -67,7 +67,7 @@
void pci_print_devices()
{
- kprintf("Enumerating PCI devices:\n");
+ kprintf(INFO "Enumerating PCI devices:\n");
for (int bus = 0; bus < 0xff; bus++)
{
for (int slot = 0; slot < 32; slot++)
@@ -78,7 +78,7 @@
if (dev.valid)
{
- kprintf("%d %d %d --- d:0x%x --- %d:%d:%d --- %s\n", bus,
+ kprintf(INFO "%d %d %d --- d:0x%x --- %d:%d:%d --- %s\n", bus,
slot, func, dev.device_id, dev.class, dev.subclass,
dev.prog_if, dev.vendor->name);
}
@@ -134,13 +134,13 @@
void pci_print_drivers()
{
- kprintf("Enumerating PCI device drivers:\n");
+ kprintf(INFO "Enumerating PCI device drivers:\n");
for (int i = 0; i < num_drivers; i++)
{
for (int j = 0; j < drivers[i].loaded; j++)
{
struct pci_device_driver d = drivers[i];
- kprintf("Driver: %s, vendor: %s\n", d.generic_name, d.dev.vendor->name);
+ kprintf(INFO "Driver: %s, vendor: %s\n", d.generic_name, d.dev.vendor->name);
}
}
}