aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-12-13 12:02:55 -0500
committerKevin O'Connor <kevin@koconnor.net>2009-12-13 12:02:55 -0500
commitd43e1788502dc99d46bb634424ac70137874f517 (patch)
treeb5420f91e3c054a1520056f3bf65cee7a2e9411d
parenta7fc5de5037f2e3c621110650d8590f1e8b24b2c (diff)
downloadseabios-d43e1788502dc99d46bb634424ac70137874f517.zip
seabios-d43e1788502dc99d46bb634424ac70137874f517.tar.gz
seabios-d43e1788502dc99d46bb634424ac70137874f517.tar.bz2
ATA 48bit LBA should only be activated on read/write commands.
Check explicitly for an extended read/write command instead of 0x04 bit set. The identify command has that bit set, but doesn't need the 48bit lba registers set.
-rw-r--r--src/ata.c3
-rw-r--r--src/ata.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/ata.c b/src/ata.c
index 6c2fc98..d87072d 100644
--- a/src/ata.c
+++ b/src/ata.c
@@ -209,7 +209,8 @@ send_cmd(struct drive_s *drive_g, struct ata_pio_command *cmd)
return status;
}
- if (cmd->command & 0x04) {
+ if (cmd->command == ATA_CMD_READ_SECTORS_EXT
+ || cmd->command == ATA_CMD_WRITE_SECTORS_EXT) {
outb(0x00, iobase1 + ATA_CB_FR);
outb(cmd->sector_count2, iobase1 + ATA_CB_SC);
outb(cmd->lba_low2, iobase1 + ATA_CB_SN);
diff --git a/src/ata.h b/src/ata.h
index f8d86aa..d0a2f8b 100644
--- a/src/ata.h
+++ b/src/ata.h
@@ -112,6 +112,7 @@ void describe_atapi(struct drive_s *drive_g);
#define ATA_CMD_READ_DMA_QUEUED 0xC7
#define ATA_CMD_READ_MULTIPLE 0xC4
#define ATA_CMD_READ_SECTORS 0x20
+#define ATA_CMD_READ_SECTORS_EXT 0x24
#define ATA_CMD_READ_VERIFY_SECTORS 0x40
#define ATA_CMD_RECALIBRATE 0x10
#define ATA_CMD_REQUEST_SENSE 0x03
@@ -129,6 +130,7 @@ void describe_atapi(struct drive_s *drive_g);
#define ATA_CMD_WRITE_DMA_QUEUED 0xCC
#define ATA_CMD_WRITE_MULTIPLE 0xC5
#define ATA_CMD_WRITE_SECTORS 0x30
+#define ATA_CMD_WRITE_SECTORS_EXT 0x34
#define ATA_CMD_WRITE_VERIFY 0x3C
#endif // ata.h