Fixed spelling mistake
This commit is contained in:
parent
bb69d6b713
commit
8f4382793c
@ -31,27 +31,27 @@ DataRegister(controlBase[bus]+0),
|
|||||||
ErrorRegister(controlBase[bus]+1),
|
ErrorRegister(controlBase[bus]+1),
|
||||||
FeaturesRegister(controlBase[bus]+1),
|
FeaturesRegister(controlBase[bus]+1),
|
||||||
SectorCountRegister(controlBase[bus]+2),
|
SectorCountRegister(controlBase[bus]+2),
|
||||||
LBOLo(controlBase[bus]+3),
|
LBALo(controlBase[bus]+3),
|
||||||
LBOMid(controlBase[bus]+4),
|
LBAMid(controlBase[bus]+4),
|
||||||
LBOHi(controlBase[bus]+5),
|
LBAHi(controlBase[bus]+5),
|
||||||
DriveSelectRegister(controlBase[bus]+6),
|
DriveSelectRegister(controlBase[bus]+6),
|
||||||
StatusRegister(controlBase[bus]+7),
|
StatusRegister(controlBase[bus]+7),
|
||||||
CommandRegister(controlBase[bus]+7) {
|
CommandRegister(controlBase[bus]+7) {
|
||||||
this->isValid = 0;
|
this->isValid = 0;
|
||||||
|
|
||||||
DriveSelectRegister.writeb(0xA0);
|
DriveSelectRegister.writeb(0xA0);
|
||||||
LBOLo.writeb(0);
|
LBALo.writeb(0);
|
||||||
LBOMid.writeb(0);
|
LBAMid.writeb(0);
|
||||||
LBOHi.writeb(0);
|
LBAHi.writeb(0);
|
||||||
CommandRegister.writeb(0xEC);
|
CommandRegister.writeb(0xEC);
|
||||||
|
|
||||||
if (!readStatus()) {
|
if (!readStatus()) {
|
||||||
this->isValid = false;
|
this->isValid = false;
|
||||||
} else {
|
} else {
|
||||||
pollTillNotBSY();
|
pollTillNotBSY();
|
||||||
uint8_t lbomid;
|
uint8_t LBAmid;
|
||||||
uint8_t lbohi;
|
uint8_t LBAhi;
|
||||||
if ((lbomid = LBOMid.readb()) || (lbohi = LBOHi.readb())) {
|
if ((LBAmid = LBAMid.readb()) || (LBAhi = LBAHi.readb())) {
|
||||||
this->isValid = false;
|
this->isValid = false;
|
||||||
} else {
|
} else {
|
||||||
uint8_t status = pollTillDRQ();
|
uint8_t status = pollTillDRQ();
|
||||||
@ -76,9 +76,9 @@ bool ATA::validDevice() {
|
|||||||
void ATA::ATARead(uint32_t sector, uint8_t* buffer) {
|
void ATA::ATARead(uint32_t sector, uint8_t* buffer) {
|
||||||
DriveSelectRegister.writeb(0xE0 | ((sector >> 24) & 0xf));
|
DriveSelectRegister.writeb(0xE0 | ((sector >> 24) & 0xf));
|
||||||
SectorCountRegister.writeb(1);
|
SectorCountRegister.writeb(1);
|
||||||
LBOLo.writeb((uint8_t)sector);
|
LBALo.writeb((uint8_t)sector);
|
||||||
LBOMid.writeb((uint8_t)(sector>>8));
|
LBAMid.writeb((uint8_t)(sector>>8));
|
||||||
LBOHi.writeb((uint8_t)(sector>>16));
|
LBAHi.writeb((uint8_t)(sector>>16));
|
||||||
CommandRegister.writeb(0x20);
|
CommandRegister.writeb(0x20);
|
||||||
pollTillNotBSY();
|
pollTillNotBSY();
|
||||||
for (int i=0; i<256; i++)
|
for (int i=0; i<256; i++)
|
||||||
@ -88,9 +88,9 @@ void ATA::ATARead(uint32_t sector, uint8_t* buffer) {
|
|||||||
void ATA::ATAWrite(uint32_t sector, uint8_t* buffer) {
|
void ATA::ATAWrite(uint32_t sector, uint8_t* buffer) {
|
||||||
DriveSelectRegister.writeb(0xE0 | ((sector >> 24) & 0xf));
|
DriveSelectRegister.writeb(0xE0 | ((sector >> 24) & 0xf));
|
||||||
SectorCountRegister.writeb(1);
|
SectorCountRegister.writeb(1);
|
||||||
LBOLo.writeb((uint8_t)sector);
|
LBALo.writeb((uint8_t)sector);
|
||||||
LBOMid.writeb((uint8_t)(sector>>8));
|
LBAMid.writeb((uint8_t)(sector>>8));
|
||||||
LBOHi.writeb((uint8_t)(sector>>16));
|
LBAHi.writeb((uint8_t)(sector>>16));
|
||||||
CommandRegister.writeb(0x30);
|
CommandRegister.writeb(0x30);
|
||||||
pollTillNotBSY();
|
pollTillNotBSY();
|
||||||
for (int i=0; i<256; i++)
|
for (int i=0; i<256; i++)
|
||||||
|
@ -38,9 +38,9 @@
|
|||||||
// Error Register R 1 1 2
|
// Error Register R 1 1 2
|
||||||
// Features Reg. W 1 1 2
|
// Features Reg. W 1 1 2
|
||||||
// Sector Count Reg. RW 2 1 2
|
// Sector Count Reg. RW 2 1 2
|
||||||
// LBOlo RW 3 1 2
|
// LBAlo RW 3 1 2
|
||||||
// LBOmid RW 4 1 2
|
// LBAmid RW 4 1 2
|
||||||
// LBOhi RW 5 1 2
|
// LBAhi RW 5 1 2
|
||||||
// Drive Select RW 6 1 1
|
// Drive Select RW 6 1 1
|
||||||
// Status Reg R 7 1 1
|
// Status Reg R 7 1 1
|
||||||
// Command Reg W 7 1 1
|
// Command Reg W 7 1 1
|
||||||
@ -72,9 +72,9 @@ protected:
|
|||||||
Port ErrorRegister;
|
Port ErrorRegister;
|
||||||
Port FeaturesRegister;
|
Port FeaturesRegister;
|
||||||
Port SectorCountRegister;
|
Port SectorCountRegister;
|
||||||
Port LBOLo;
|
Port LBALo;
|
||||||
Port LBOMid;
|
Port LBAMid;
|
||||||
Port LBOHi;
|
Port LBAHi;
|
||||||
Port DriveSelectRegister;
|
Port DriveSelectRegister;
|
||||||
Port StatusRegister;
|
Port StatusRegister;
|
||||||
Port CommandRegister;
|
Port CommandRegister;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user