mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-27 22:12:25 +00:00
Merge branch 'master' of https://github.com/CosmosOS/Cosmos
This commit is contained in:
commit
e88931dc9b
11 changed files with 196 additions and 122 deletions
|
|
@ -161,11 +161,11 @@ Project("{471EC4BB-E47E-4229-A789-D1F5F83B52D4}") = "GuessKernelBoot", "Demos\Gu
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cosmos.Core.Memory.Test", "Tests\Cosmos.Core.Memory.Test\Cosmos.Core.Memory.Test.csproj", "{408E5ACC-EA9A-41E8-AA95-514C5F47BD34}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Cosmos Graphic Subsystem", "Cosmos Graphic Subsystem", "{A9D558E8-B0C7-4FF6-99D8-CB2BC6FEB7C7}"
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CosmosGraphicSubsystem", "CosmosGraphicSubsystem", "{A9D558E8-B0C7-4FF6-99D8-CB2BC6FEB7C7}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cosmos Graphic Subsystem", "Demos\Cosmos Graphic Subsystem\Cosmos Graphic Subsystem.csproj", "{49F2C01D-D2C5-4564-810B-1AE92236C5C1}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CosmosGraphicSubsystem", "Demos\CosmosGraphicSubsystem\CosmosGraphicSubsystem.csproj", "{49F2C01D-D2C5-4564-810B-1AE92236C5C1}"
|
||||
EndProject
|
||||
Project("{471EC4BB-E47E-4229-A789-D1F5F83B52D4}") = "Cosmos Graphic SubsystemBoot", "Demos\Cosmos Graphic Subsystem\Cosmos Graphic SubsystemBoot.Cosmos", "{79D68062-46C5-466D-9289-C033F7348485}"
|
||||
Project("{471EC4BB-E47E-4229-A789-D1F5F83B52D4}") = "CosmosGraphicSubsystemBoot", "Demos\CosmosGraphicSubsystem\CosmosGraphicSubsystemBoot.Cosmos", "{79D68062-46C5-466D-9289-C033F7348485}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cosmos.Core_Asm", "source\Cosmos.Core_Asm\Cosmos.Core_Asm.csproj", "{B7077A34-D7F0-4422-BE7C-65DF26C65489}"
|
||||
EndProject
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Cosmos Graphic SubsystemBoot.Cosmos" />
|
||||
<None Remove="CosmosGraphicSubsystemBoot.Cosmos" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
@ -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>
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
<Project Sdk="Microsoft.Net.Sdk">
|
||||
<Project Sdk="Microsoft.Net.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<BinFormat>elf</BinFormat>
|
||||
<DebugEnabled>True</DebugEnabled>
|
||||
<DebugEnabled>False</DebugEnabled>
|
||||
<DebugMode>Source</DebugMode>
|
||||
<TraceMode>User</TraceMode>
|
||||
<EnableGDB>False</EnableGDB>
|
||||
|
|
@ -18,6 +18,35 @@
|
|||
<Launch>VMware</Launch>
|
||||
<Profile>VMware</Profile>
|
||||
<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>
|
||||
<ItemGroup>
|
||||
<None Remove="*" />
|
||||
|
|
@ -30,4 +59,4 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(AppData)\Cosmos User Kit\Build\VSIP\Cosmos.targets" />
|
||||
</Project>
|
||||
</Project>
|
||||
23
Kernel.sln
23
Kernel.sln
|
|
@ -32,11 +32,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GuessKernel", "Demos\Guess\
|
|||
EndProject
|
||||
Project("{471EC4BB-E47E-4229-A789-D1F5F83B52D4}") = "GuessKernelBoot", "Demos\Guess\GuessKernelBoot.Cosmos", "{77DD08F5-0751-4EFC-B222-78F9F06E1F7C}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Cosmos Graphic Subsystem", "Cosmos Graphic Subsystem", "{A9D558E8-B0C7-4FF6-99D8-CB2BC6FEB7C7}"
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CosmosGraphicSubsystem", "CosmosGraphicSubsystem", "{A9D558E8-B0C7-4FF6-99D8-CB2BC6FEB7C7}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cosmos Graphic Subsystem", "Demos\Cosmos Graphic Subsystem\Cosmos Graphic Subsystem.csproj", "{49F2C01D-D2C5-4564-810B-1AE92236C5C1}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CosmosGraphicSubsystem", "Demos\CosmosGraphicSubsystem\CosmosGraphicSubsystem.csproj", "{49F2C01D-D2C5-4564-810B-1AE92236C5C1}"
|
||||
EndProject
|
||||
Project("{471EC4BB-E47E-4229-A789-D1F5F83B52D4}") = "Cosmos Graphic SubsystemBoot", "Demos\Cosmos Graphic Subsystem\Cosmos Graphic SubsystemBoot.Cosmos", "{79D68062-46C5-466D-9289-C033F7348485}"
|
||||
Project("{471EC4BB-E47E-4229-A789-D1F5F83B52D4}") = "CosmosGraphicSubsystemBoot", "Demos\CosmosGraphicSubsystem\CosmosGraphicSubsystemBoot.Cosmos", "{79D68062-46C5-466D-9289-C033F7348485}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cosmos.Debug.Kernel", "source\Cosmos.Debug.Kernel\Cosmos.Debug.Kernel.csproj", "{94DBCFC7-B5D2-4148-BE18-D76654C379E2}"
|
||||
EndProject
|
||||
|
|
@ -48,6 +48,18 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cosmos.Debug.Kernel.Plugs.A
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cosmos.Core.DebugStub", "source\Cosmos.Core.DebugStub\Cosmos.Core.DebugStub.csproj", "{9BDA0399-0CFD-42E8-8CF4-3DDE16122A82}"
|
||||
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
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
|
@ -198,5 +210,10 @@ Global
|
|||
{79D68062-46C5-466D-9289-C033F7348485} = {A9D558E8-B0C7-4FF6-99D8-CB2BC6FEB7C7}
|
||||
{31D48401-77B2-44AF-B6D3-27AB67C10759} = {3CD3D9A5-9BC5-4FEB-8D63-4D535C0ABB78}
|
||||
{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
|
||||
EndGlobal
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ namespace Cosmos.Core
|
|||
Init();
|
||||
|
||||
if (enable)
|
||||
Enable();
|
||||
Enable();
|
||||
}
|
||||
|
||||
// Shutdown
|
||||
|
|
@ -113,17 +113,7 @@ namespace Cosmos.Core
|
|||
// Reboot
|
||||
public static void Reboot()
|
||||
{
|
||||
Console.Clear();
|
||||
IOPort port = new IOPort(0x64);
|
||||
byte good = 0x02;
|
||||
|
||||
while ((good & 0x02) != 0)
|
||||
good = port.Byte;
|
||||
|
||||
port.Byte = 0xFE;
|
||||
|
||||
// Halt CPU
|
||||
Global.CPU.Halt();
|
||||
throw new NotImplementedException("ACPI Reset not implemented yet."); //TODO
|
||||
}
|
||||
|
||||
// Initializazion
|
||||
|
|
@ -169,49 +159,49 @@ namespace Cosmos.Core
|
|||
yeuse = (byte*)addr;
|
||||
Facp = yeuse;
|
||||
|
||||
if (acpiCheckHeader((byte*)facpget(0), "DSDT") == 0)
|
||||
if (acpiCheckHeader((byte*)facpget(0), "DSDT") == 0)
|
||||
{
|
||||
byte* S5Addr = (byte*)facpget(0) + 36;
|
||||
int dsdtLength = *(facpget(0) + 1) - 36;
|
||||
|
||||
while (0 < dsdtLength--)
|
||||
{
|
||||
byte* S5Addr = (byte*)facpget(0) + 36;
|
||||
int dsdtLength = *(facpget(0) + 1) - 36;
|
||||
|
||||
while (0 < dsdtLength--)
|
||||
{
|
||||
if (Compare("_S5_", S5Addr) == 0)
|
||||
if (Compare("_S5_", S5Addr) == 0)
|
||||
break;
|
||||
S5Addr++;
|
||||
}
|
||||
S5Addr++;
|
||||
}
|
||||
|
||||
if (dsdtLength > 0)
|
||||
if (dsdtLength > 0)
|
||||
{
|
||||
if ((*(S5Addr - 1) == 0x08 || (*(S5Addr - 2) == 0x08 && *(S5Addr - 1) == '\\')) && *(S5Addr + 4) == 0x12)
|
||||
{
|
||||
if ((*(S5Addr - 1) == 0x08 || (*(S5Addr - 2) == 0x08 && *(S5Addr - 1) == '\\')) && *(S5Addr + 4) == 0x12)
|
||||
{
|
||||
S5Addr += 5;
|
||||
S5Addr += ((*S5Addr & 0xC0) >> 6) + 2;
|
||||
if (*S5Addr == 0x0A)
|
||||
S5Addr++;
|
||||
SLP_TYPa = (short)(*(S5Addr) << 10);
|
||||
S5Addr += 5;
|
||||
S5Addr += ((*S5Addr & 0xC0) >> 6) + 2;
|
||||
if (*S5Addr == 0x0A)
|
||||
S5Addr++;
|
||||
if (*S5Addr == 0x0A)
|
||||
S5Addr++;
|
||||
SLP_TYPb = (short)(*(S5Addr) << 10);
|
||||
SMI_CMD = facpget(1);
|
||||
ACPI_ENABLE = facpbget(0);
|
||||
ACPI_DISABLE = facpbget(1);
|
||||
PM1a_CNT = facpget(2);
|
||||
PM1b_CNT = facpget(3);
|
||||
PM1_CNT_LEN = facpbget(3);
|
||||
SLP_EN = 1 << 13;
|
||||
SCI_EN = 1;
|
||||
SLP_TYPa = (short)(*(S5Addr) << 10);
|
||||
S5Addr++;
|
||||
if (*S5Addr == 0x0A)
|
||||
S5Addr++;
|
||||
SLP_TYPb = (short)(*(S5Addr) << 10);
|
||||
SMI_CMD = facpget(1);
|
||||
ACPI_ENABLE = facpbget(0);
|
||||
ACPI_DISABLE = facpbget(1);
|
||||
PM1a_CNT = facpget(2);
|
||||
PM1b_CNT = facpget(3);
|
||||
PM1_CNT_LEN = facpbget(3);
|
||||
SLP_EN = 1 << 13;
|
||||
SCI_EN = 1;
|
||||
|
||||
smiIO = new IOPort((ushort)SMI_CMD);
|
||||
pm1aIO = new IOPort((ushort)PM1a_CNT);
|
||||
pm1bIO = new IOPort((ushort)PM1b_CNT);
|
||||
smiIO = new IOPort((ushort)SMI_CMD);
|
||||
pm1aIO = new IOPort((ushort)PM1a_CNT);
|
||||
pm1bIO = new IOPort((ushort)PM1b_CNT);
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
ptr += 4;
|
||||
}
|
||||
ptr += 4;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -221,7 +211,6 @@ namespace Cosmos.Core
|
|||
// Enable ACPI
|
||||
public static void Enable()
|
||||
{
|
||||
Init();
|
||||
smiIO = new IOPort(ACPI_ENABLE);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -131,14 +131,13 @@ namespace Cosmos.HAL
|
|||
// system level and not accessible from Core. Need to think about this
|
||||
// for the future.
|
||||
Console.WriteLine("Finding PCI Devices");
|
||||
|
||||
PCI.Setup();
|
||||
}
|
||||
|
||||
public static void StartACPI()
|
||||
{
|
||||
Console.WriteLine("Starting ACPI");
|
||||
Core.ACPI.Start();
|
||||
ACPI.Start();
|
||||
}
|
||||
|
||||
public static void EnableInterrupts()
|
||||
|
|
|
|||
|
|
@ -16,27 +16,15 @@ namespace Cosmos.HAL
|
|||
}
|
||||
|
||||
//Reboot with ACPI
|
||||
public static void Reboot()
|
||||
public static void ACPIReboot()
|
||||
{
|
||||
ACPI.Reboot();
|
||||
ACPI.Reboot(); //TODO
|
||||
}
|
||||
|
||||
//Shutdown with ACPI
|
||||
public static void Shutdown()
|
||||
public static void ACPIShutdown()
|
||||
{
|
||||
ACPI.Shutdown();
|
||||
}
|
||||
|
||||
//Enable ACPI
|
||||
public static void ACPIEnable()
|
||||
{
|
||||
ACPI.Enable();
|
||||
}
|
||||
|
||||
//Disable ACPI
|
||||
public static void ACPIDisable()
|
||||
{
|
||||
ACPI.Disable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -8,25 +8,13 @@ namespace Cosmos.System
|
|||
{
|
||||
public class Power
|
||||
{
|
||||
public static void CPUReboot()
|
||||
public static void Reboot()
|
||||
{
|
||||
HAL.Power.CPUReboot();
|
||||
}
|
||||
public static void Reboot()
|
||||
{
|
||||
HAL.Power.Reboot();
|
||||
}
|
||||
public static void Shutdown()
|
||||
{
|
||||
HAL.Power.Shutdown();
|
||||
}
|
||||
public static void ACPIEnable()
|
||||
{
|
||||
HAL.Power.ACPIEnable();
|
||||
}
|
||||
public static void ACPIDisable()
|
||||
{
|
||||
HAL.Power.ACPIDisable();
|
||||
HAL.Power.ACPIShutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue