mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-26 21:42:11 +00:00
This commit is contained in:
parent
96a0fc4280
commit
bec1a510fa
15 changed files with 79 additions and 22 deletions
|
|
@ -16,6 +16,8 @@
|
||||||
<SccLocalPath>SAK</SccLocalPath>
|
<SccLocalPath>SAK</SccLocalPath>
|
||||||
<SccAuxPath>SAK</SccAuxPath>
|
<SccAuxPath>SAK</SccAuxPath>
|
||||||
<SccProvider>SAK</SccProvider>
|
<SccProvider>SAK</SccProvider>
|
||||||
|
<SignAssembly>true</SignAssembly>
|
||||||
|
<AssemblyOriginatorKeyFile>Cosmos.snk</AssemblyOriginatorKeyFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
|
@ -49,8 +51,19 @@
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="Global.cs" />
|
||||||
|
<Compile Include="Processor.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Cosmos\Cosmos.Hardware\Cosmos.Hardware.csproj">
|
||||||
|
<Project>{CE50FE98-9AC4-4B4D-ADC7-31F6DCD28755}</Project>
|
||||||
|
<Name>Cosmos.Hardware</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Cosmos.snk" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
|
|
||||||
12
source/Cosmos.Hardware.PC/Global.cs
Normal file
12
source/Cosmos.Hardware.PC/Global.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Cosmos.Hardware.PC {
|
||||||
|
public class Global : Cosmos.Hardware.Global {
|
||||||
|
public static void Init() {
|
||||||
|
mProcessor = new Processor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
9
source/Cosmos.Hardware.PC/Processor.cs
Normal file
9
source/Cosmos.Hardware.PC/Processor.cs
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Cosmos.Hardware.PC {
|
||||||
|
class Processor : Cosmos.Hardware.Processor {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -59,11 +59,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cosmos.Shell.Guess", "Cosmo
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cosmos.Hardware.PC", "Cosmos.Hardware.PC\Cosmos.Hardware.PC.csproj", "{B024FADF-EF04-4602-A0F4-49016D68B2AF}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cosmos.Hardware.PC", "Cosmos.Hardware.PC\Cosmos.Hardware.PC.csproj", "{B024FADF-EF04-4602-A0F4-49016D68B2AF}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cosmos.Hardware.PC.x86", "Cosmos.Hardware.PC.x86\Cosmos.Hardware.PC.x86.csproj", "{A62F41F4-A759-40FA-90AA-CF8A3C9AC72A}"
|
|
||||||
EndProject
|
|
||||||
Global
|
Global
|
||||||
GlobalSection(TeamFoundationVersionControl) = preSolution
|
GlobalSection(TeamFoundationVersionControl) = preSolution
|
||||||
SccNumberOfProjects = 26
|
SccNumberOfProjects = 25
|
||||||
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
|
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
|
||||||
SccTeamFoundationServer = https://tfs04.codeplex.com/
|
SccTeamFoundationServer = https://tfs04.codeplex.com/
|
||||||
SccLocalPath0 = .
|
SccLocalPath0 = .
|
||||||
|
|
@ -163,10 +161,6 @@ Global
|
||||||
SccProjectTopLevelParentUniqueName24 = Cosmos.sln
|
SccProjectTopLevelParentUniqueName24 = Cosmos.sln
|
||||||
SccProjectName24 = Cosmos.Hardware.PC
|
SccProjectName24 = Cosmos.Hardware.PC
|
||||||
SccLocalPath24 = Cosmos.Hardware.PC
|
SccLocalPath24 = Cosmos.Hardware.PC
|
||||||
SccProjectUniqueName25 = Cosmos.Hardware.PC.x86\\Cosmos.Hardware.PC.x86.csproj
|
|
||||||
SccProjectTopLevelParentUniqueName25 = Cosmos.sln
|
|
||||||
SccProjectName25 = Cosmos.Hardware.PC.x86
|
|
||||||
SccLocalPath25 = Cosmos.Hardware.PC.x86
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
|
@ -267,10 +261,6 @@ Global
|
||||||
{B024FADF-EF04-4602-A0F4-49016D68B2AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{B024FADF-EF04-4602-A0F4-49016D68B2AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{B024FADF-EF04-4602-A0F4-49016D68B2AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{B024FADF-EF04-4602-A0F4-49016D68B2AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{B024FADF-EF04-4602-A0F4-49016D68B2AF}.Release|Any CPU.Build.0 = Release|Any CPU
|
{B024FADF-EF04-4602-A0F4-49016D68B2AF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{A62F41F4-A759-40FA-90AA-CF8A3C9AC72A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{A62F41F4-A759-40FA-90AA-CF8A3C9AC72A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{A62F41F4-A759-40FA-90AA-CF8A3C9AC72A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{A62F41F4-A759-40FA-90AA-CF8A3C9AC72A}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
@ -295,7 +285,6 @@ Global
|
||||||
{B168BEDD-C6A6-4E7C-B9A5-0144286E9E42} = {0D558E33-78B0-47DB-B5EF-B7C2F3114D75}
|
{B168BEDD-C6A6-4E7C-B9A5-0144286E9E42} = {0D558E33-78B0-47DB-B5EF-B7C2F3114D75}
|
||||||
{A1F83D9F-2D44-4264-A08B-416797123018} = {0D558E33-78B0-47DB-B5EF-B7C2F3114D75}
|
{A1F83D9F-2D44-4264-A08B-416797123018} = {0D558E33-78B0-47DB-B5EF-B7C2F3114D75}
|
||||||
{B024FADF-EF04-4602-A0F4-49016D68B2AF} = {0D558E33-78B0-47DB-B5EF-B7C2F3114D75}
|
{B024FADF-EF04-4602-A0F4-49016D68B2AF} = {0D558E33-78B0-47DB-B5EF-B7C2F3114D75}
|
||||||
{A62F41F4-A759-40FA-90AA-CF8A3C9AC72A} = {0D558E33-78B0-47DB-B5EF-B7C2F3114D75}
|
|
||||||
{B0BBD2A2-4FAA-4730-9770-ACE6D9532132} = {E16DB75B-0F1D-4813-9103-F8FB6E7BAE2A}
|
{B0BBD2A2-4FAA-4730-9770-ACE6D9532132} = {E16DB75B-0F1D-4813-9103-F8FB6E7BAE2A}
|
||||||
{7BAB58BF-E8A1-4623-B6BF-4B90A0505226} = {E16DB75B-0F1D-4813-9103-F8FB6E7BAE2A}
|
{7BAB58BF-E8A1-4623-B6BF-4B90A0505226} = {E16DB75B-0F1D-4813-9103-F8FB6E7BAE2A}
|
||||||
{1F0EDE86-F6D4-4355-9A97-10E90457770C} = {2DE75CE4-7A3B-4659-84FC-16F5EC0AEDE4}
|
{1F0EDE86-F6D4-4355-9A97-10E90457770C} = {2DE75CE4-7A3B-4659-84FC-16F5EC0AEDE4}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
<SccAuxPath>SAK</SccAuxPath>
|
<SccAuxPath>SAK</SccAuxPath>
|
||||||
<SccProvider>SAK</SccProvider>
|
<SccProvider>SAK</SccProvider>
|
||||||
<SignAssembly>true</SignAssembly>
|
<SignAssembly>true</SignAssembly>
|
||||||
<AssemblyOriginatorKeyFile>Old\Cosmos.snk</AssemblyOriginatorKeyFile>
|
<AssemblyOriginatorKeyFile>Cosmos.snk</AssemblyOriginatorKeyFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
|
@ -48,6 +48,7 @@
|
||||||
<Compile Include="Bus\Bus.cs" />
|
<Compile Include="Bus\Bus.cs" />
|
||||||
<Compile Include="Bus\CPUBus.cs" />
|
<Compile Include="Bus\CPUBus.cs" />
|
||||||
<Compile Include="Device.cs" />
|
<Compile Include="Device.cs" />
|
||||||
|
<Compile Include="Global.cs" />
|
||||||
<Compile Include="Old\CPU.cs" />
|
<Compile Include="Old\CPU.cs" />
|
||||||
<Compile Include="Old\DebugUtil.cs" />
|
<Compile Include="Old\DebugUtil.cs" />
|
||||||
<Compile Include="Old\Hardware.cs" />
|
<Compile Include="Old\Hardware.cs" />
|
||||||
|
|
@ -56,6 +57,7 @@
|
||||||
<Compile Include="Old\PIC.cs" />
|
<Compile Include="Old\PIC.cs" />
|
||||||
<Compile Include="Old\PIT.cs" />
|
<Compile Include="Old\PIT.cs" />
|
||||||
<Compile Include="Bus\PCIBus.cs" />
|
<Compile Include="Bus\PCIBus.cs" />
|
||||||
|
<Compile Include="Processor.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Old\RTC.cs" />
|
<Compile Include="Old\RTC.cs" />
|
||||||
<Compile Include="Old\Screen\Text.cs" />
|
<Compile Include="Old\Screen\Text.cs" />
|
||||||
|
|
@ -68,7 +70,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Old\ClassDiagram.cd" />
|
<None Include="Old\ClassDiagram.cd" />
|
||||||
<None Include="Old\Cosmos.snk" />
|
<None Include="Cosmos.snk" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
|
|
||||||
BIN
source/Cosmos/Cosmos.Hardware/Cosmos.snk
Normal file
BIN
source/Cosmos/Cosmos.Hardware/Cosmos.snk
Normal file
Binary file not shown.
12
source/Cosmos/Cosmos.Hardware/Global.cs
Normal file
12
source/Cosmos/Cosmos.Hardware/Global.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Cosmos.Hardware {
|
||||||
|
public class Global {
|
||||||
|
protected static Processor mProcessor;
|
||||||
|
public static Processor Processor {
|
||||||
|
get { return mProcessor; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,9 +3,12 @@ using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Cosmos.Hardware {
|
namespace Cosmos.Hardware {
|
||||||
public class CPU: Hardware {
|
public class CPUOld: Hardware {
|
||||||
|
// Plugged
|
||||||
public static void CreateGDT() { }
|
public static void CreateGDT() { }
|
||||||
public static void CreateIDT() { }
|
// Plugged
|
||||||
|
public static void CreateIDT() { }
|
||||||
|
|
||||||
public static uint AmountOfMemory {
|
public static uint AmountOfMemory {
|
||||||
get {
|
get {
|
||||||
return GetAmountOfRAM();
|
return GetAmountOfRAM();
|
||||||
|
|
|
||||||
8
source/Cosmos/Cosmos.Hardware/Processor.cs
Normal file
8
source/Cosmos/Cosmos.Hardware/Processor.cs
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Cosmos.Hardware {
|
||||||
|
public abstract class Processor {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -5,8 +5,8 @@ using Indy.IL2CPU.Plugs;
|
||||||
using HW = Cosmos.Hardware;
|
using HW = Cosmos.Hardware;
|
||||||
|
|
||||||
namespace Cosmos.Kernel.Plugs {
|
namespace Cosmos.Kernel.Plugs {
|
||||||
[Plug(Target = typeof(HW.CPU))]
|
[Plug(Target = typeof(HW.CPUOld))]
|
||||||
public static class CPU {
|
public static class CPUOld {
|
||||||
[PlugMethod(MethodAssembler = typeof(Assemblers.CreateGDT))]
|
[PlugMethod(MethodAssembler = typeof(Assemblers.CreateGDT))]
|
||||||
public static void CreateGDT() {
|
public static void CreateGDT() {
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,11 @@ namespace Cosmos.Kernel {
|
||||||
// For now we just have default, but can add others in the future
|
// For now we just have default, but can add others in the future
|
||||||
public class Boot {
|
public class Boot {
|
||||||
public static void Default() {
|
public static void Default() {
|
||||||
|
// This should be the ONLY reference to the specific assembly
|
||||||
|
// Later I would like to make this auto loading, but .NET's
|
||||||
|
// init methods are a bit more work than Delphi's. :)
|
||||||
|
Cosmos.Hardware.PC.Global.Init();
|
||||||
|
//Remove later
|
||||||
CPU.Init();
|
CPU.Init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,10 @@
|
||||||
<Compile Include="Old\TextScreen-Old.cs" />
|
<Compile Include="Old\TextScreen-Old.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\Cosmos.Hardware.PC\Cosmos.Hardware.PC.csproj">
|
||||||
|
<Project>{B024FADF-EF04-4602-A0F4-49016D68B2AF}</Project>
|
||||||
|
<Name>Cosmos.Hardware.PC</Name>
|
||||||
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\..\Indy.IL2CPU.Plugs\Indy.IL2CPU.Plugs.csproj">
|
<ProjectReference Include="..\..\Indy.IL2CPU.Plugs\Indy.IL2CPU.Plugs.csproj">
|
||||||
<Project>{E9B2E8CC-E264-42F9-9113-16B0A0431198}</Project>
|
<Project>{E9B2E8CC-E264-42F9-9113-16B0A0431198}</Project>
|
||||||
<Name>Indy.IL2CPU.Plugs</Name>
|
<Name>Indy.IL2CPU.Plugs</Name>
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ namespace Cosmos.Kernel {
|
||||||
public static unsafe void Init() {
|
public static unsafe void Init() {
|
||||||
Heap.CheckInit();
|
Heap.CheckInit();
|
||||||
Console.Write("Creating GDT...");
|
Console.Write("Creating GDT...");
|
||||||
Hardware.CPU.CreateGDT();
|
Hardware.CPUOld.CreateGDT();
|
||||||
Console.WriteLine("Done");
|
Console.WriteLine("Done");
|
||||||
Console.Write("Initializing PIC...");
|
Console.Write("Initializing PIC...");
|
||||||
Hardware.PIC.Init();
|
Hardware.PIC.Init();
|
||||||
|
|
@ -34,7 +34,7 @@ namespace Cosmos.Kernel {
|
||||||
Console.Write("Creating IDT...");
|
Console.Write("Creating IDT...");
|
||||||
Kernel.Interrupts.DoTest();
|
Kernel.Interrupts.DoTest();
|
||||||
Hardware.Storage.ATA.Initialize(Sleep);
|
Hardware.Storage.ATA.Initialize(Sleep);
|
||||||
Hardware.CPU.CreateIDT();
|
Hardware.CPUOld.CreateIDT();
|
||||||
Console.WriteLine("Done");
|
Console.WriteLine("Done");
|
||||||
Keyboard.Initialize();
|
Keyboard.Initialize();
|
||||||
//TestATA();
|
//TestATA();
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ namespace Cosmos.Kernel {
|
||||||
|
|
||||||
private static void ClearMemory(uint aStartAddress, uint aLength) {
|
private static void ClearMemory(uint aStartAddress, uint aLength) {
|
||||||
//int xStart = (RTC.GetMinutes() * 60) + RTC.GetSeconds();
|
//int xStart = (RTC.GetMinutes() * 60) + RTC.GetSeconds();
|
||||||
Hardware.CPU.ZeroFill(aStartAddress, aLength);
|
Hardware.CPUOld.ZeroFill(aStartAddress, aLength);
|
||||||
//int xEnd = (RTC.GetMinutes() * 60) + RTC.GetSeconds();
|
//int xEnd = (RTC.GetMinutes() * 60) + RTC.GetSeconds();
|
||||||
//int xDiff = xEnd - xStart;
|
//int xDiff = xEnd - xStart;
|
||||||
//Console.Write("Time to clear ");
|
//Console.Write("Time to clear ");
|
||||||
|
|
@ -62,7 +62,7 @@ namespace Cosmos.Kernel {
|
||||||
public static void CheckInit() {
|
public static void CheckInit() {
|
||||||
if (mFirstBlock == null) {
|
if (mFirstBlock == null) {
|
||||||
//Initialize(Hardware.CPU.EndOfKernel, (Hardware.CPU.AmountOfMemory * 1024 * 1024) - (Hardware.CPU.EndOfKernel + 4));
|
//Initialize(Hardware.CPU.EndOfKernel, (Hardware.CPU.AmountOfMemory * 1024 * 1024) - (Hardware.CPU.EndOfKernel + 4));
|
||||||
Initialize(Hardware.CPU.EndOfKernel, (Hardware.CPU.AmountOfMemory * 1024 * 1024) - 1024);
|
Initialize(Hardware.CPUOld.EndOfKernel, (Hardware.CPUOld.AmountOfMemory * 1024 * 1024) - 1024);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue