Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ATA HD initialization on Beige G3 when booting 9.2 #114

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions devices/common/ata/atahd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ int AtaHardDisk::perform_command() {
uint64_t offset = this->get_lba() * ATA_HD_SEC_SIZE;
uint32_t ints_size = ATA_HD_SEC_SIZE;
if (this->r_command == READ_MULTIPLE) {
if (this->multiple_sector_count == 0) {
if (this->sec_per_block == 0) {
LOG_F(ERROR, "%s: READ MULTIPLE with SET MULTIPLE==0", this->name.c_str());
this->r_status |= ERR;
this->r_status &= ~BSY;
break;
}
ints_size *= this->multiple_sector_count;
ints_size *= this->sec_per_block;
}
hdd_img.read(buffer, offset, xfer_size);
this->data_ptr = (uint16_t *)this->buffer;
Expand All @@ -130,13 +130,13 @@ int AtaHardDisk::perform_command() {
uint32_t xfer_size = sec_count * ATA_HD_SEC_SIZE;
uint32_t ints_size = ATA_HD_SEC_SIZE;
if (this->r_command == WRITE_MULTIPLE) {
if (this->multiple_sector_count == 0) {
if (this->sec_per_block == 0) {
LOG_F(ERROR, "%s: WRITE MULTIPLE with SET MULTIPLE==0", this->name.c_str());
this->r_status |= ERR;
this->r_status &= ~BSY;
break;
}
ints_size *= this->multiple_sector_count;
ints_size *= this->sec_per_block;
}
this->prepare_xfer(xfer_size, ints_size);
this->post_xfer_action = [this]() {
Expand Down
3 changes: 0 additions & 3 deletions devices/common/ata/atahd.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ class AtaHardDisk : public AtaBaseDevice
uint8_t heads;
uint8_t sectors;

//number of sectors for r/w multiple
uint8_t multiple_sector_count = 0;

uint8_t sec_per_block = 8; // sectors per block for READ_MULTIPLE/WRITE_MULTIPLE
bool multiple_enabled = true; // READ_MULTIPLE/WRITE_MULTIPLE enabled

Expand Down
Loading