Skip to content
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ add_custom_target(extra-img
COMMAND ${QEMU_IMG} create -f raw VirtioDisk.img 128M
COMMAND ${MKFS_FAT} -F 16 VirtioDisk.img
COMMAND ${QEMU_IMG} create -f raw SataDisk.img 128M
COMMAND ${MKFS_EXT2} -F SataDisk.img
COMMAND ${MKFS_NTFS} -F SataDisk.img
COMMENT "Creating extra disk images"
)

Expand Down
8 changes: 4 additions & 4 deletions drivers/storage/AHCI.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static int AHCI_StopPort(int port) {
AHCI_WritePortReg(port, AHCI_PORT_CMD, cmd);

// Wait for CR to clear
int timeout = 500;
int timeout = 5000;
while (timeout-- > 0) {
cmd = AHCI_ReadPortReg(port, AHCI_PORT_CMD);
if (!(cmd & AHCI_PORT_CMD_CR)) break;
Expand All @@ -59,7 +59,7 @@ static int AHCI_StopPort(int port) {
AHCI_WritePortReg(port, AHCI_PORT_CMD, cmd);

// Wait for FR to clear
timeout = 500;
timeout = 5000;
while (timeout-- > 0) {
cmd = AHCI_ReadPortReg(port, AHCI_PORT_CMD);
if (!(cmd & AHCI_PORT_CMD_FR)) break;
Expand Down Expand Up @@ -158,7 +158,7 @@ static int AHCI_SendCommand(int port, uint8_t command, uint64_t lba, uint16_t co
if (!ahci_port->active) return -1;

// Wait for port to be ready
int timeout = 1000;
int timeout = 2000;
while (timeout-- > 0) {
uint32_t tfd = AHCI_ReadPortReg(port, AHCI_PORT_TFD);
if (!(tfd & 0x88)) break; // BSY and DRQ clear
Expand Down Expand Up @@ -199,7 +199,7 @@ static int AHCI_SendCommand(int port, uint8_t command, uint64_t lba, uint16_t co
AHCI_WritePortReg(port, AHCI_PORT_CI, 1);

// Wait for completion
timeout = 500;
timeout = 5000;
while (timeout-- > 0) {
uint32_t ci = AHCI_ReadPortReg(port, AHCI_PORT_CI);
if (!(ci & 1)) break;
Expand Down
Loading
Loading