mirror of
https://github.com/LIV2/lide.device.git
synced 2025-12-06 00:32:45 +00:00
Test for drive fault as well as error
This commit is contained in:
parent
c901c4ea39
commit
96689d744e
2
Makefile
2
Makefile
@ -1,6 +1,6 @@
|
||||
PROJECT=liv2ride
|
||||
CC=m68k-amigaos-gcc
|
||||
CFLAGS=-nostartfiles -nostdlib -noixemul -mcpu=68000 -Wall -Wno-multichar -Wno-pointer-sign -Wno-attributes -Wno-unused-value -s -O0 -fomit-frame-pointer -fno-delete-null-pointer-checks
|
||||
CFLAGS=-nostartfiles -nostdlib -noixemul -mcpu=68000 -Wall -Wno-multichar -Wno-pointer-sign -Wno-attributes -Wno-unused-value -s -Os -fomit-frame-pointer -fno-delete-null-pointer-checks
|
||||
LDFLAGS=-lamiga -lgcc -lc
|
||||
AS=m68k-amigaos-as
|
||||
|
||||
|
||||
5
ata.c
5
ata.c
@ -146,7 +146,7 @@ bool ata_identify(struct IDEUnit *unit, UWORD *buffer)
|
||||
*unit->drive->status_command = ATA_CMD_IDENTIFY;
|
||||
|
||||
if (!ata_wait_drq(unit)) {
|
||||
if (*unit->drive->status_command & ata_flag_error) {
|
||||
if (*unit->drive->status_command & (ata_flag_error | ata_flag_df)) {
|
||||
Warn("IDENTIFY Status: Error\n");
|
||||
Warn("last_error: %08lx\n",&unit->last_error[0]);
|
||||
unit->last_error[0] = *unit->drive->error_features;
|
||||
@ -335,12 +335,13 @@ if (direction == READ) {
|
||||
*actual += unit->blockSize;
|
||||
}
|
||||
|
||||
if (*unit->drive->status_command & ata_flag_error) {
|
||||
if (*unit->drive->status_command & (ata_flag_error | ata_flag_df)) {
|
||||
unit->last_error[0] = unit->drive->error_features[0];
|
||||
unit->last_error[1] = unit->drive->lbaHigh[0];
|
||||
unit->last_error[2] = unit->drive->lbaMid[0];
|
||||
unit->last_error[3] = unit->drive->lbaLow[0];
|
||||
unit->last_error[4] = unit->drive->status_command[0];
|
||||
unit->last_error[5] = unit->drive->devHead[0];
|
||||
|
||||
Info("ATA ERROR!!!");
|
||||
Info("last_error: %08lx\n",unit->last_error);
|
||||
|
||||
1
ata.h
1
ata.h
@ -29,6 +29,7 @@
|
||||
|
||||
#define ata_flag_busy (1<<7)
|
||||
#define ata_flag_ready (1<<6)
|
||||
#define ata_flag_df (1<<5)
|
||||
#define ata_flag_drq (1<<3)
|
||||
#define ata_flag_error (1<<0)
|
||||
|
||||
|
||||
2
device.h
2
device.h
@ -31,7 +31,7 @@ struct IDEUnit {
|
||||
UBYTE unitNum;
|
||||
UBYTE channel;
|
||||
UBYTE device_type;
|
||||
UBYTE last_error[5];
|
||||
UBYTE last_error[6];
|
||||
BOOL primary;
|
||||
BOOL present;
|
||||
UWORD change_count;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user