diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2008-04-05 21:08:57 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2008-04-05 21:08:57 -0400 |
commit | dfabfe00d995e9b03da35896d99cf50b3d73624d (patch) | |
tree | d36aed17585e95574b8ec67899bbb458c10a18ff | |
parent | 98123b53ef37009e556039f3a7b7a4b69be022ec (diff) | |
download | seabios-hppa-rel-0.2.1.zip seabios-hppa-rel-0.2.1.tar.gz seabios-hppa-rel-0.2.1.tar.bz2 |
Fix bug causing write corruption on large disks.rel-0.2.1
Writes past 1<<28 sectors were not correct - corruption occurs.
-rw-r--r-- | src/ata.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -320,13 +320,14 @@ ata_cmd_data(int driveid, u16 command, u32 lba, u16 count, void *far_buffer) struct ata_pio_command cmd; memset(&cmd, 0, sizeof(cmd)); + cmd.command = command; if (count >= (1<<8) || lba + count >= (1<<28)) { cmd.sector_count2 = count >> 8; cmd.lba_low2 = lba >> 24; cmd.lba_mid2 = 0; cmd.lba_high2 = 0; - command |= 0x04; + cmd.command |= 0x04; lba &= 0xffffff; } @@ -337,7 +338,6 @@ ata_cmd_data(int driveid, u16 command, u32 lba, u16 count, void *far_buffer) cmd.lba_high = lba >> 16; cmd.device = ((slave ? ATA_CB_DH_DEV1 : ATA_CB_DH_DEV0) | ((lba >> 24) & 0xf) | ATA_CB_DH_LBA); - cmd.command = command; int ret = send_cmd(driveid, &cmd); if (ret) @@ -623,7 +623,7 @@ init_drive_ata(int driveid) case ATA_TRANSLATION_LARGE: if (translation == ATA_TRANSLATION_LARGE) BX_INFO("large"); - while(cylinders > 1024) { + while (cylinders > 1024) { cylinders >>= 1; heads <<= 1; |