mirror of
https://github.com/danbulant/Cosmos
synced 2026-06-07 16:52:50 +00:00
Ata boot fix.
This commit is contained in:
parent
e132b0f473
commit
c75cdffbb4
2 changed files with 40 additions and 9 deletions
|
|
@ -15,6 +15,7 @@ namespace Cosmos.HAL
|
||||||
|
|
||||||
public static TextScreenBase TextScreen = new TextScreen();
|
public static TextScreenBase TextScreen = new TextScreen();
|
||||||
public static PCI Pci;
|
public static PCI Pci;
|
||||||
|
public static int atamode;
|
||||||
|
|
||||||
static public void Init(TextScreenBase textScreen)
|
static public void Init(TextScreenBase textScreen)
|
||||||
{
|
{
|
||||||
|
|
@ -46,6 +47,16 @@ namespace Cosmos.HAL
|
||||||
|
|
||||||
mDebugger.Send("Done initializing Cosmos.HAL.Global");
|
mDebugger.Send("Done initializing Cosmos.HAL.Global");
|
||||||
|
|
||||||
|
if (atamode == 1)
|
||||||
|
{
|
||||||
|
//TODO Implement an AHCI Driver
|
||||||
|
}
|
||||||
|
else if (atamode == 2)
|
||||||
|
{
|
||||||
|
//TODO Implement a RAID Driver
|
||||||
|
}
|
||||||
|
else if (atamode == 3)
|
||||||
|
{
|
||||||
mDebugger.Send("ATA Primary Master");
|
mDebugger.Send("ATA Primary Master");
|
||||||
InitAta(Ata.ControllerIdEnum.Primary, Ata.BusPositionEnum.Master);
|
InitAta(Ata.ControllerIdEnum.Primary, Ata.BusPositionEnum.Master);
|
||||||
|
|
||||||
|
|
@ -55,7 +66,7 @@ namespace Cosmos.HAL
|
||||||
mDebugger.Send("ATA Secondary Master");
|
mDebugger.Send("ATA Secondary Master");
|
||||||
InitAta(Ata.ControllerIdEnum.Secondary, Ata.BusPositionEnum.Master);
|
InitAta(Ata.ControllerIdEnum.Secondary, Ata.BusPositionEnum.Master);
|
||||||
//InitAta(BlockDevice.Ata.ControllerIdEnum.Secondary, BlockDevice.Ata.BusPositionEnum.Slave);
|
//InitAta(BlockDevice.Ata.ControllerIdEnum.Secondary, BlockDevice.Ata.BusPositionEnum.Slave);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void EnableInterrupts()
|
public static void EnableInterrupts()
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,26 @@ namespace Cosmos.HAL
|
||||||
CheckBus(fn);
|
CheckBus(fn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (PCIDevice device in Devices)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (device.ClassCode == 0x01 && device.Subclass == 0x06 && device.ProgIF == 0x01)
|
||||||
|
{
|
||||||
|
//Serial ATA (AHCI 1.0)
|
||||||
|
Global.atamode = 1;
|
||||||
|
}
|
||||||
|
else if (device.ClassCode == 0x01 && device.Subclass == 0x04 && device.ProgIF == 0x00)
|
||||||
|
{
|
||||||
|
//RAID Controller
|
||||||
|
Global.atamode = 2;
|
||||||
|
}
|
||||||
|
else if (device.ClassCode == 0x01 && device.Subclass == 0x01)
|
||||||
|
{
|
||||||
|
//IDE Controller
|
||||||
|
Global.atamode = 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void CheckBus(ushort xBus)
|
private static void CheckBus(ushort xBus)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue