Repos / kernel.git / commitdiff
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f8aaca9)
raw | patch | inline | side by side (parent: f8aaca9)
| author | zhaoyanbai <zhaoyanbai@126.com> | |
| Mon, 22 Nov 2021 11:26:02 +0000 (19:26 +0800) | ||
| committer | zhaoyanbai <zhaoyanbai@126.com> | |
| Mon, 22 Nov 2021 11:26:02 +0000 (19:26 +0800) |
| drivers/ata.c | patch | blob | history |
diff --git a/drivers/ata.c b/drivers/ata.c
--- a/drivers/ata.c
+++ b/drivers/ata.c
extern ide_pci_controller_t ide_pci_controller;
typedef struct _ide_drive {
+ int present;
int dma;
uint64_t lba48;
uint64_t max_lba;
uint8_t status = inb(REG_STATUS(dev));
if (status == 0 || (status & ATA_STATUS_ERR) || (status & ATA_STATUS_RDY == 0)) {
printk("ata[%d] not exists: %x\n", i, status);
+ ide_drives[i].present = 0;
continue;
+ } else {
+ ide_drives[i].present = 1;
}
printk("ata[%d] exists: %x\n", i, status);