Skip to content

Commit 47237ff

Browse files
Merge pull request #114 from mihaip/upstream-atahd-fix
Fix ATA HD initialization on Beige G3 when booting 9.2
2 parents 7ee8b9b + 8d95aa5 commit 47237ff

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

devices/common/ata/atahd.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ int AtaHardDisk::perform_command() {
105105
uint64_t offset = this->get_lba() * ATA_HD_SEC_SIZE;
106106
uint32_t ints_size = ATA_HD_SEC_SIZE;
107107
if (this->r_command == READ_MULTIPLE) {
108-
if (this->multiple_sector_count == 0) {
108+
if (this->sec_per_block == 0) {
109109
LOG_F(ERROR, "%s: READ MULTIPLE with SET MULTIPLE==0", this->name.c_str());
110110
this->r_status |= ERR;
111111
this->r_status &= ~BSY;
112112
break;
113113
}
114-
ints_size *= this->multiple_sector_count;
114+
ints_size *= this->sec_per_block;
115115
}
116116
hdd_img.read(buffer, offset, xfer_size);
117117
this->data_ptr = (uint16_t *)this->buffer;
@@ -130,13 +130,13 @@ int AtaHardDisk::perform_command() {
130130
uint32_t xfer_size = sec_count * ATA_HD_SEC_SIZE;
131131
uint32_t ints_size = ATA_HD_SEC_SIZE;
132132
if (this->r_command == WRITE_MULTIPLE) {
133-
if (this->multiple_sector_count == 0) {
133+
if (this->sec_per_block == 0) {
134134
LOG_F(ERROR, "%s: WRITE MULTIPLE with SET MULTIPLE==0", this->name.c_str());
135135
this->r_status |= ERR;
136136
this->r_status &= ~BSY;
137137
break;
138138
}
139-
ints_size *= this->multiple_sector_count;
139+
ints_size *= this->sec_per_block;
140140
}
141141
this->prepare_xfer(xfer_size, ints_size);
142142
this->post_xfer_action = [this]() {

devices/common/ata/atahd.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ class AtaHardDisk : public AtaBaseDevice
6969
uint8_t heads;
7070
uint8_t sectors;
7171

72-
//number of sectors for r/w multiple
73-
uint8_t multiple_sector_count = 0;
74-
7572
uint8_t sec_per_block = 8; // sectors per block for READ_MULTIPLE/WRITE_MULTIPLE
7673
bool multiple_enabled = true; // READ_MULTIPLE/WRITE_MULTIPLE enabled
7774

0 commit comments

Comments
 (0)