Skip to content

Commit

Permalink
Check for floating bus
Browse files Browse the repository at this point in the history
Fixes CosmosOS#1056: Does not boot if there is no IDE Secondary Master
(VirtualBox)
  • Loading branch information
sjmulder committed Oct 11, 2018
1 parent 2ca4b2a commit 87a233a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions source/Cosmos.HAL2/BlockDevice/AtaPio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ public AtaPio(Core.IOGroup.ATA aIO, Ata.ControllerIdEnum aControllerId, Ata.BusP
public SpecLevel DiscoverDrive()
{
SelectDrive(0);

// Read status before sending command. If 0xFF, it's a floating
// bus (nothing connected)
if (IO.Status.Byte == 0xFF)
{
return SpecLevel.Null;
}

var xIdentifyStatus = SendCmd(Cmd.Identify, false);
// No drive found, go to next
if (xIdentifyStatus == Status.None)
Expand Down

0 comments on commit 87a233a

Please sign in to comment.