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

Add extra args to Global.Init() #2975

Closed
wants to merge 1 commit into from
Closed
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
41 changes: 31 additions & 10 deletions source/Cosmos.HAL2/Global.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static class Global
/// </summary>
/// <param name="textScreen">Text screen.</param>
/// <exception cref="System.IO.IOException">Thrown on IO error.</exception>
static public void Init(TextScreenBase textScreen, bool InitScrollWheel, bool InitPS2, bool InitNetwork, bool IDEInit)
static public void Init(TextScreenBase textScreen, bool InitPCI, bool InitACPI, bool InitScrollWheel, bool InitPS2, bool InitNetwork, bool IDEInit, bool SerialInit)
{
if (textScreen != null)
{
Expand All @@ -45,14 +45,29 @@ static public void Init(TextScreenBase textScreen, bool InitScrollWheel, bool In
//TODO: Since this is FCL, its "common". Otherwise it should be
// system level and not accessible from Core. Need to think about this
// for the future.

Console.Clear();
Console.WriteLine("Finding PCI Devices");
debugger.Send("PCI Devices");
PCI.Setup();
if (InitPCI)
{
Console.WriteLine("Finding PCI Devices");
debugger.Send("PCI Devices");
PCI.Setup();
}
else
{
debugger.Send("PCI driver disabled in User Kernel");
}

Console.WriteLine("Starting ACPI");
debugger.Send("ACPI Init");
ACPI.Start();
if (InitACPI || InitPS2)
{
Console.WriteLine("Starting ACPI");
debugger.Send("ACPI Init");
ACPI.Start();
}
else
{
debugger.Send("ACPI driver disabled in User Kernel");
}

// http://wiki.osdev.org/%228042%22_PS/2_Controller#Initialising_the_PS.2F2_Controller
// TODO: USB should be initialized before the PS/2 controller
Expand Down Expand Up @@ -85,10 +100,16 @@ static public void Init(TextScreenBase textScreen, bool InitScrollWheel, bool In
{
debugger.Send("Network Driver disabled in User Kernel");
}
Console.WriteLine("Enabling Serial Output on COM1");
SerialPort.Enable(COMPort.COM1, BaudRate.BaudRate38400);
if (SerialInit)
{
Console.WriteLine("Enabling Serial Output on COM1");
SerialPort.Enable(COMPort.COM1, BaudRate.BaudRate38400);
}
else
{
debugger.Send("Serial Output disabled in User Kernel");
}
debugger.Send("Done initializing Cosmos.HAL.Global");

}

/// <summary>
Expand Down
Loading