This commit is contained in:
Kudzu 2017-07-16 18:36:48 -04:00
commit e88931dc9b
11 changed files with 196 additions and 122 deletions

View file

@ -1,34 +0,0 @@
<Project Sdk="Microsoft.Net.Sdk">
<PropertyGroup>
<TargetFramework>net462</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<BinFormat>elf</BinFormat>
<DebugEnabled>True</DebugEnabled>
<DebugMode>Source</DebugMode>
<TraceMode>User</TraceMode>
<EnableGDB>False</EnableGDB>
<StartCosmosGDB>False</StartCosmosGDB>
<Deployment>ISO</Deployment>
<VisualStudioDebugPort>Pipe: Cosmos\Serial</VisualStudioDebugPort>
<StackCorruptionDetectionEnabled>True</StackCorruptionDetectionEnabled>
<StackCorruptionDetectionLevel>MethodFooters</StackCorruptionDetectionLevel>
<IgnoreDebugStubAttribute>False</IgnoreDebugStubAttribute>
<CosmosDebugPort>Serial: COM1</CosmosDebugPort>
<Launch>VMware</Launch>
<Profile>VMware</Profile>
<Description>Use VMware Player or Workstation to deploy and debug.</Description>
</PropertyGroup>
<ItemGroup>
<None Remove="*" />
<Compile Remove="*" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Cosmos Graphic Subsystem\Cosmos Graphic Subsystem.csproj">
<Name>Cosmos Graphic Subsystem</Name>
<Project>{49f2c01d-d2c5-4564-810b-1ae92236c5c1}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(AppData)\Cosmos User Kit\Build\VSIP\Cosmos.targets" />
</Project>

View file

@ -0,0 +1,98 @@
<Project Sdk="Microsoft.Net.Sdk">
<PropertyGroup>
<TargetFramework>net462</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<BinFormat>elf</BinFormat>
<DebugEnabled>True</DebugEnabled>
<DebugMode>Source</DebugMode>
<TraceMode>User</TraceMode>
<EnableGDB>False</EnableGDB>
<StartCosmosGDB>False</StartCosmosGDB>
<Deployment>ISO</Deployment>
<VisualStudioDebugPort>Pipe: Cosmos\Serial</VisualStudioDebugPort>
<StackCorruptionDetectionEnabled>True</StackCorruptionDetectionEnabled>
<StackCorruptionDetectionLevel>MethodFooters</StackCorruptionDetectionLevel>
<IgnoreDebugStubAttribute>False</IgnoreDebugStubAttribute>
<CosmosDebugPort>Serial: COM1</CosmosDebugPort>
<Launch>Bochs</Launch>
<Profile>Bochs</Profile>
<Description>Use Bochs emulator to deploy and debug.</Description>
<PxeInterface>192.168.0.8</PxeInterface>
<VMware_StackCorruptionDetectionEnabled>True</VMware_StackCorruptionDetectionEnabled>
<VMware_StackCorruptionDetectionLevel>MethodFooters</VMware_StackCorruptionDetectionLevel>
<VMware_Description>Use VMware Player or Workstation to deploy and debug.</VMware_Description>
<VMware_Deployment>ISO</VMware_Deployment>
<VMware_Launch>VMware</VMware_Launch>
<VMware_DebugEnabled>True</VMware_DebugEnabled>
<VMware_DebugMode>Source</VMware_DebugMode>
<VMware_IgnoreDebugStubAttribute>False</VMware_IgnoreDebugStubAttribute>
<VMware_CosmosDebugPort>Serial: COM1</VMware_CosmosDebugPort>
<VMware_VisualStudioDebugPort>Pipe: Cosmos\Serial</VMware_VisualStudioDebugPort>
<VMware_PxeInterface>192.168.0.8</VMware_PxeInterface>
<VMware_OutputPath>bin\Debug\net462\</VMware_OutputPath>
<VMware_EnableGDB>False</VMware_EnableGDB>
<VMware_StartCosmosGDB>False</VMware_StartCosmosGDB>
<Bochs_StackCorruptionDetectionEnabled>True</Bochs_StackCorruptionDetectionEnabled>
<Bochs_StackCorruptionDetectionLevel>MethodFooters</Bochs_StackCorruptionDetectionLevel>
<Bochs_Description>Use Bochs emulator to deploy and debug.</Bochs_Description>
<Bochs_Deployment>ISO</Bochs_Deployment>
<Bochs_Launch>Bochs</Bochs_Launch>
<Bochs_DebugEnabled>True</Bochs_DebugEnabled>
<Bochs_DebugMode>Source</Bochs_DebugMode>
<Bochs_IgnoreDebugStubAttribute>False</Bochs_IgnoreDebugStubAttribute>
<Bochs_CosmosDebugPort>Serial: COM1</Bochs_CosmosDebugPort>
<Bochs_VisualStudioDebugPort>Pipe: Cosmos\Serial</Bochs_VisualStudioDebugPort>
<Bochs_PxeInterface>192.168.0.8</Bochs_PxeInterface>
<Bochs_OutputPath>bin\Debug\net462\</Bochs_OutputPath>
<Bochs_EnableGDB>False</Bochs_EnableGDB>
<Bochs_StartCosmosGDB>False</Bochs_StartCosmosGDB>
<USB_StackCorruptionDetectionEnabled>True</USB_StackCorruptionDetectionEnabled>
<USB_StackCorruptionDetectionLevel>MethodFooters</USB_StackCorruptionDetectionLevel>
<USB_Description>Makes a USB device such as a flash drive or external hard disk bootable.</USB_Description>
<USB_Deployment>USB</USB_Deployment>
<USB_Launch>None</USB_Launch>
<USB_DebugEnabled>False</USB_DebugEnabled>
<USB_DebugMode>Source</USB_DebugMode>
<USB_IgnoreDebugStubAttribute>False</USB_IgnoreDebugStubAttribute>
<USB_CosmosDebugPort>Serial: COM1</USB_CosmosDebugPort>
<USB_VisualStudioDebugPort>Pipe: Cosmos\Serial</USB_VisualStudioDebugPort>
<USB_PxeInterface>192.168.0.8</USB_PxeInterface>
<USB_OutputPath>bin\Debug\net462\</USB_OutputPath>
<USB_EnableGDB>False</USB_EnableGDB>
<USB_StartCosmosGDB>False</USB_StartCosmosGDB>
<Name>CosmosGraphicSubsystemBoot</Name>
</PropertyGroup>
<ItemGroup>
<None Remove="*" />
<Compile Remove="*" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\source\Cosmos.Core.Plugs.Asm\Cosmos.Core.Plugs.Asm.csproj">
<Name>Cosmos.Core.Plugs.Asm</Name>
<Project>{3c186d37-21c3-417c-95f1-19be538af88a}</Project>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\..\source\Cosmos.Core.Plugs\Cosmos.Core.Plugs.csproj">
<Name>Cosmos.Core.Plugs</Name>
<Project>{1132e689-18b0-4d87-94e8-934d4802c540}</Project>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\..\source\Cosmos.Debug.Kernel.Plugs.Asm\Cosmos.Debug.Kernel.Plugs.Asm.csproj">
<Name>Cosmos.Debug.Kernel.Plugs.Asm</Name>
<Project>{7e450662-b34c-49b0-a826-f45ad3a18891}</Project>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\..\source\Cosmos.System.Plugs\Cosmos.System.Plugs.csproj">
<Name>Cosmos.System.Plugs</Name>
<Project>{9431ff1f-ad75-4a1e-b38a-46e0f109411d}</Project>
<Private>True</Private>
</ProjectReference>
<ProjectReference Include="..\CosmosGraphicSubsystem\CosmosGraphicSubsystem.csproj">
<Name>CosmosGraphicSubsystem</Name>
<Project>{49f2c01d-d2c5-4564-810b-1ae92236c5c1}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(AppData)\Cosmos User Kit\Build\VSIP\Cosmos.targets" />
</Project>

View file

@ -1,10 +1,10 @@
<Project Sdk="Microsoft.Net.Sdk"> <Project Sdk="Microsoft.Net.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net462</TargetFramework> <TargetFramework>net462</TargetFramework>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<BinFormat>elf</BinFormat> <BinFormat>elf</BinFormat>
<DebugEnabled>True</DebugEnabled> <DebugEnabled>False</DebugEnabled>
<DebugMode>Source</DebugMode> <DebugMode>Source</DebugMode>
<TraceMode>User</TraceMode> <TraceMode>User</TraceMode>
<EnableGDB>False</EnableGDB> <EnableGDB>False</EnableGDB>
@ -18,6 +18,35 @@
<Launch>VMware</Launch> <Launch>VMware</Launch>
<Profile>VMware</Profile> <Profile>VMware</Profile>
<Description>Use VMware Player or Workstation to deploy and debug.</Description> <Description>Use VMware Player or Workstation to deploy and debug.</Description>
<PxeInterface>192.168.0.8</PxeInterface>
<VMware_StackCorruptionDetectionEnabled>True</VMware_StackCorruptionDetectionEnabled>
<VMware_StackCorruptionDetectionLevel>MethodFooters</VMware_StackCorruptionDetectionLevel>
<VMware_Description>Use VMware Player or Workstation to deploy and debug.</VMware_Description>
<VMware_Deployment>ISO</VMware_Deployment>
<VMware_Launch>VMware</VMware_Launch>
<VMware_DebugEnabled>False</VMware_DebugEnabled>
<VMware_DebugMode>Source</VMware_DebugMode>
<VMware_IgnoreDebugStubAttribute>False</VMware_IgnoreDebugStubAttribute>
<VMware_CosmosDebugPort>Serial: COM1</VMware_CosmosDebugPort>
<VMware_VisualStudioDebugPort>Pipe: Cosmos\Serial</VMware_VisualStudioDebugPort>
<VMware_PxeInterface>192.168.0.8</VMware_PxeInterface>
<VMware_OutputPath>bin\Debug\net462\</VMware_OutputPath>
<VMware_EnableGDB>False</VMware_EnableGDB>
<VMware_StartCosmosGDB>False</VMware_StartCosmosGDB>
<Bochs_StackCorruptionDetectionEnabled>True</Bochs_StackCorruptionDetectionEnabled>
<Bochs_StackCorruptionDetectionLevel>MethodFooters</Bochs_StackCorruptionDetectionLevel>
<Bochs_Description>Use Bochs emulator to deploy and debug.</Bochs_Description>
<Bochs_Deployment>ISO</Bochs_Deployment>
<Bochs_Launch>Bochs</Bochs_Launch>
<Bochs_DebugEnabled>True</Bochs_DebugEnabled>
<Bochs_DebugMode>Source</Bochs_DebugMode>
<Bochs_IgnoreDebugStubAttribute>False</Bochs_IgnoreDebugStubAttribute>
<Bochs_CosmosDebugPort>Serial: COM1</Bochs_CosmosDebugPort>
<Bochs_VisualStudioDebugPort>Pipe: Cosmos\Serial</Bochs_VisualStudioDebugPort>
<Bochs_PxeInterface>192.168.0.8</Bochs_PxeInterface>
<Bochs_OutputPath>bin\Debug\net462\</Bochs_OutputPath>
<Bochs_EnableGDB>False</Bochs_EnableGDB>
<Bochs_StartCosmosGDB>False</Bochs_StartCosmosGDB>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<None Remove="*" /> <None Remove="*" />

View file

@ -48,6 +48,18 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cosmos.Debug.Kernel.Plugs.A
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cosmos.Core.DebugStub", "source\Cosmos.Core.DebugStub\Cosmos.Core.DebugStub.csproj", "{9BDA0399-0CFD-42E8-8CF4-3DDE16122A82}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cosmos.Core.DebugStub", "source\Cosmos.Core.DebugStub\Cosmos.Core.DebugStub.csproj", "{9BDA0399-0CFD-42E8-8CF4-3DDE16122A82}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Kernel Test", "Kernel Test", "{0005698B-5FB4-47C4-BD4C-2C81A20DCD7D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "10 Core", "10 Core", "{67CA4591-0EFD-45FC-955E-E6013B9C1DDE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "20 Halo", "20 Halo", "{82F49B98-8C19-4452-9D7E-6530AFBBE3BB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "25 Halie", "25 Halie", "{FE675B0D-393A-4D3B-B487-282220923532}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "80 System", "80 System", "{A2A2059B-16FB-43C1-9630-56EBF0328EC3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "00 Shared", "00 Shared", "{01EE1DCC-200B-45E4-AB76-9D5F7EDD5EC0}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -198,5 +210,10 @@ Global
{79D68062-46C5-466D-9289-C033F7348485} = {A9D558E8-B0C7-4FF6-99D8-CB2BC6FEB7C7} {79D68062-46C5-466D-9289-C033F7348485} = {A9D558E8-B0C7-4FF6-99D8-CB2BC6FEB7C7}
{31D48401-77B2-44AF-B6D3-27AB67C10759} = {3CD3D9A5-9BC5-4FEB-8D63-4D535C0ABB78} {31D48401-77B2-44AF-B6D3-27AB67C10759} = {3CD3D9A5-9BC5-4FEB-8D63-4D535C0ABB78}
{9BDA0399-0CFD-42E8-8CF4-3DDE16122A82} = {04B18FFC-8EA0-4E9F-9E1B-478527B19AFA} {9BDA0399-0CFD-42E8-8CF4-3DDE16122A82} = {04B18FFC-8EA0-4E9F-9E1B-478527B19AFA}
{67CA4591-0EFD-45FC-955E-E6013B9C1DDE} = {0005698B-5FB4-47C4-BD4C-2C81A20DCD7D}
{82F49B98-8C19-4452-9D7E-6530AFBBE3BB} = {0005698B-5FB4-47C4-BD4C-2C81A20DCD7D}
{FE675B0D-393A-4D3B-B487-282220923532} = {0005698B-5FB4-47C4-BD4C-2C81A20DCD7D}
{A2A2059B-16FB-43C1-9630-56EBF0328EC3} = {0005698B-5FB4-47C4-BD4C-2C81A20DCD7D}
{01EE1DCC-200B-45E4-AB76-9D5F7EDD5EC0} = {0005698B-5FB4-47C4-BD4C-2C81A20DCD7D}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View file

@ -113,17 +113,7 @@ namespace Cosmos.Core
// Reboot // Reboot
public static void Reboot() public static void Reboot()
{ {
Console.Clear(); throw new NotImplementedException("ACPI Reset not implemented yet."); //TODO
IOPort port = new IOPort(0x64);
byte good = 0x02;
while ((good & 0x02) != 0)
good = port.Byte;
port.Byte = 0xFE;
// Halt CPU
Global.CPU.Halt();
} }
// Initializazion // Initializazion
@ -221,7 +211,6 @@ namespace Cosmos.Core
// Enable ACPI // Enable ACPI
public static void Enable() public static void Enable()
{ {
Init();
smiIO = new IOPort(ACPI_ENABLE); smiIO = new IOPort(ACPI_ENABLE);
} }

View file

@ -131,14 +131,13 @@ namespace Cosmos.HAL
// system level and not accessible from Core. Need to think about this // system level and not accessible from Core. Need to think about this
// for the future. // for the future.
Console.WriteLine("Finding PCI Devices"); Console.WriteLine("Finding PCI Devices");
PCI.Setup(); PCI.Setup();
} }
public static void StartACPI() public static void StartACPI()
{ {
Console.WriteLine("Starting ACPI"); Console.WriteLine("Starting ACPI");
Core.ACPI.Start(); ACPI.Start();
} }
public static void EnableInterrupts() public static void EnableInterrupts()

View file

@ -16,27 +16,15 @@ namespace Cosmos.HAL
} }
//Reboot with ACPI //Reboot with ACPI
public static void Reboot() public static void ACPIReboot()
{ {
ACPI.Reboot(); ACPI.Reboot(); //TODO
} }
//Shutdown with ACPI //Shutdown with ACPI
public static void Shutdown() public static void ACPIShutdown()
{ {
ACPI.Shutdown(); ACPI.Shutdown();
} }
//Enable ACPI
public static void ACPIEnable()
{
ACPI.Enable();
}
//Disable ACPI
public static void ACPIDisable()
{
ACPI.Disable();
}
} }
} }

View file

@ -8,25 +8,13 @@ namespace Cosmos.System
{ {
public class Power public class Power
{ {
public static void CPUReboot() public static void Reboot()
{ {
HAL.Power.CPUReboot(); HAL.Power.CPUReboot();
} }
public static void Reboot()
{
HAL.Power.Reboot();
}
public static void Shutdown() public static void Shutdown()
{ {
HAL.Power.Shutdown(); HAL.Power.ACPIShutdown();
}
public static void ACPIEnable()
{
HAL.Power.ACPIEnable();
}
public static void ACPIDisable()
{
HAL.Power.ACPIDisable();
} }
} }
} }