aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/fs/ata.c
diff options
context:
space:
mode:
authorMarvin Borner2020-04-16 19:06:33 +0200
committerMarvin Borner2020-04-16 19:06:33 +0200
commit4014a36377ff69f6433e7b0af2144bc3a7d29ca7 (patch)
tree9440ac3749d406c6df9917d4bb3a19de6ea99655 /src/kernel/fs/ata.c
parentfc26e84ef8c6255926811fe639e3e466b756e581 (diff)
Many fix attempts for the divide by zero exception
Diffstat (limited to 'src/kernel/fs/ata.c')
-rw-r--r--src/kernel/fs/ata.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/kernel/fs/ata.c b/src/kernel/fs/ata.c
index 817bb98..ac42275 100644
--- a/src/kernel/fs/ata.c
+++ b/src/kernel/fs/ata.c
@@ -8,7 +8,7 @@
#include <kernel/pci/pci.h>
#include <kernel/interrupts/interrupts.h>
-uint32_t ata_device;
+uint32_t ata_device = 0x00000000;
ata_dev_t primary_master = { .slave = 0 };
ata_dev_t primary_slave = { .slave = 1 };
@@ -30,7 +30,7 @@ void software_reset(ata_dev_t *dev)
outb(dev->control, CONTROL_ZERO);
}
-void ata_handler(struct regs *reg)
+void ata_handler(struct regs *r)
{
inb(primary_master.status);
inb(primary_master.BMR_STATUS);
@@ -240,14 +240,14 @@ void ata_device_detect(ata_dev_t *dev, int primary)
outb(dev->command, COMMAND_IDENTIFY);
if (!inb(dev->status)) {
- log("Device does not exist");
+ warn("Device does not exist: %s", dev->mountpoint);
return;
}
uint8_t lba_lo = inb(dev->lba_lo);
uint8_t lba_hi = inb(dev->lba_high);
if (lba_lo != 0 || lba_hi != 0) {
- log("Device is not ata-compatible");
+ warn("Device is not ata-compatible: %s", dev->mountpoint);
return;
}
uint8_t drq = 0, err = 0;
@@ -256,7 +256,7 @@ void ata_device_detect(ata_dev_t *dev, int primary)
err = inb(dev->status) & STATUS_ERR;
}
if (err) {
- log("Error while polling");
+ warn("Error while polling: %s", dev->mountpoint);
return;
}
@@ -283,10 +283,10 @@ void ata_init()
{
pci_scan(&ata_find, -1, &ata_device);
- irq_install_handler(32 + 14, ata_handler);
+ irq_install_handler(14, ata_handler);
ata_device_detect(&primary_master, 1);
ata_device_detect(&primary_slave, 1);
- ata_device_detect(&secondary_master, 0);
- ata_device_detect(&secondary_slave, 0);
+ /* ata_device_detect(&secondary_master, 0); */
+ /* ata_device_detect(&secondary_slave, 0); */
}