Skip to content

Commit

Permalink
Merge pull request CosmosOS#1057 from sjmulder/pr/floating-bus
Browse files Browse the repository at this point in the history
Check for floating bus
  • Loading branch information
jp2masa authored Oct 12, 2018
2 parents a09a2ef + 87a233a commit 89e26bd
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 89e26bd

Please sign in to comment.