diff --git a/Demos/CosmosGraphicSubsystem/CosmosGraphicSubsystem.csproj b/Demos/CosmosGraphicSubsystem/CosmosGraphicSubsystem.csproj index c3e773797..d57ca8c04 100644 --- a/Demos/CosmosGraphicSubsystem/CosmosGraphicSubsystem.csproj +++ b/Demos/CosmosGraphicSubsystem/CosmosGraphicSubsystem.csproj @@ -2,10 +2,11 @@ netstandard2.0 + CosmosGraphicSubsystemBoot - elf + Bin True Source User @@ -17,9 +18,9 @@ MethodFooters False Serial: COM1 - Bochs - Bochs - Use Bochs emulator to deploy and debug. + VMware + VMware + Use VMware Player or Workstation to deploy and debug. 192.168.0.8 True MethodFooters diff --git a/Demos/CosmosGraphicSubsystem/Kernel.cs b/Demos/CosmosGraphicSubsystem/Kernel.cs index e80696484..c23251ab6 100644 --- a/Demos/CosmosGraphicSubsystem/Kernel.cs +++ b/Demos/CosmosGraphicSubsystem/Kernel.cs @@ -14,11 +14,15 @@ namespace Cosmos_Graphic_Subsytem protected override void BeforeRun() { Console.WriteLine("Cosmos booted successfully. Let's go in Graphic Mode"); + Console.WriteLine("Specifying custom graphics mode as 800x600@32"); + // Specify custom graphics mode (800x600 @ 16) + Mode start = new Mode(800, 600, ColorDepth.ColorDepth32); - /* Get on instance of the Canvas that is all the Screen */ - Mode start = new Mode(640, 480, ColorDepth.ColorDepth32); + Console.WriteLine("Here we go!"); + // Create new instance of FullScreenCanvas, specifying graphics mode canvas = FullScreenCanvas.GetFullScreenCanvas(start); + /* Clear the Screen with the color 'Blue' */ canvas.Clear(Color.Blue); } diff --git a/Kernel.sln b/Kernel.sln index f6adc82d7..7fec20689 100644 --- a/Kernel.sln +++ b/Kernel.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.27130.2010 +VisualStudioVersion = 15.0.27130.2036 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Kernel G2", "Kernel G2", "{9A923E6F-FF63-4F02-A4EA-C2D44F9323FD}" EndProject @@ -94,6 +94,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Spruce", "..\XSharp\source\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XSharp.x86", "..\XSharp\source\XSharp.x86\XSharp.x86.csproj", "{7370A62F-12DA-4181-BE3B-009D0926CA7E}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PCITest", "PCITest", "{58AEE3B6-80BF-4ED3-AD1E-17359139E3FC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PCITest", "Demos\PCITest\PCITest.csproj", "{D3639BE5-49A0-4163-9174-1D0CC6823E06}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -335,6 +339,14 @@ Global {7370A62F-12DA-4181-BE3B-009D0926CA7E}.Release|Any CPU.Build.0 = Release|Any CPU {7370A62F-12DA-4181-BE3B-009D0926CA7E}.Release|x86.ActiveCfg = Release|Any CPU {7370A62F-12DA-4181-BE3B-009D0926CA7E}.Release|x86.Build.0 = Release|Any CPU + {D3639BE5-49A0-4163-9174-1D0CC6823E06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D3639BE5-49A0-4163-9174-1D0CC6823E06}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3639BE5-49A0-4163-9174-1D0CC6823E06}.Debug|x86.ActiveCfg = Debug|Any CPU + {D3639BE5-49A0-4163-9174-1D0CC6823E06}.Debug|x86.Build.0 = Debug|Any CPU + {D3639BE5-49A0-4163-9174-1D0CC6823E06}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D3639BE5-49A0-4163-9174-1D0CC6823E06}.Release|Any CPU.Build.0 = Release|Any CPU + {D3639BE5-49A0-4163-9174-1D0CC6823E06}.Release|x86.ActiveCfg = Release|Any CPU + {D3639BE5-49A0-4163-9174-1D0CC6823E06}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -380,6 +392,8 @@ Global {E35E0DBF-555F-4D38-8F28-ACDFA9DC97BD} = {5FF9BF2A-5162-4F12-82B6-1693AD776636} {0812DD0A-4CEE-4376-B78A-02EBCBAA14C2} = {3CD3D9A5-9BC5-4FEB-8D63-4D535C0ABB78} {7370A62F-12DA-4181-BE3B-009D0926CA7E} = {3CD3D9A5-9BC5-4FEB-8D63-4D535C0ABB78} + {58AEE3B6-80BF-4ED3-AD1E-17359139E3FC} = {B56A6119-1B8F-44E4-9446-291E52F47D4C} + {D3639BE5-49A0-4163-9174-1D0CC6823E06} = {58AEE3B6-80BF-4ED3-AD1E-17359139E3FC} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {1A1E8F1D-82B3-471F-9B59-0350DEA9203D} diff --git a/source/Cosmos.HAL2/PciDevice.cs b/source/Cosmos.HAL2/PciDevice.cs index 6419beceb..7d6d372ad 100644 --- a/source/Cosmos.HAL2/PciDevice.cs +++ b/source/Cosmos.HAL2/PciDevice.cs @@ -107,8 +107,14 @@ namespace Cosmos.HAL HeaderType = (PCIHeaderType)ReadRegister8((byte)Config.HeaderType); BIST = (PCIBist)ReadRegister8((byte)Config.BIST); InterruptPIN = (PCIInterruptPIN)ReadRegister8((byte)Config.InterruptPIN); - - DeviceExists = (uint)VendorID != 0xFFFF && (uint)DeviceID != 0xFFFF; + if ((uint)VendorID == 0xFF && (uint)DeviceID == 0xFFFF) + { + DeviceExists = false; + } + else + { + DeviceExists = true; + } if (HeaderType == PCIHeaderType.Normal) { BaseAddressBar = new PCIBaseAddressBar[6]; diff --git a/source/Cosmos.System2/Graphics/FullScreenCanvas.cs b/source/Cosmos.System2/Graphics/FullScreenCanvas.cs index 0b36e1926..18ec3928b 100644 --- a/source/Cosmos.System2/Graphics/FullScreenCanvas.cs +++ b/source/Cosmos.System2/Graphics/FullScreenCanvas.cs @@ -15,7 +15,23 @@ namespace Cosmos.System.Graphics private static PCIDevice SVGAIIDevice = PCI.GetDevice(VendorID.VMWare, DeviceID.SVGAIIAdapter); - private static bool SVGAIIExists = SVGAIIDevice.DeviceExists; + public static bool DoesSVGAIIExist() + { + if (SVGAIIDevice != null) + { + if (SVGAIIDevice.DeviceExists == true) + { + return true; + } + return false; + } + else + { + return false; + } + + } + //public static bool SVGAIIExists = SVGAIIDevice != null; private static VideoDriver videoDevice; @@ -50,12 +66,12 @@ namespace Cosmos.System.Graphics } public static Canvas GetFullScreenCanvas(Mode mode) { - Global.mDebugger.SendInternal($"GetFullScreenCanvas() with default mode"); + Global.mDebugger.SendInternal($"GetFullScreenCanvas() with mode" + mode); // If MyVideoDriver is null (hasn't checked if VMWare SVGA exists), // Do necessary check and set gfx mode as specified (mode) if (MyVideoDriver == null) { - if (SVGAIIExists) + if (DoesSVGAIIExist()) { // Set videoDevice to SVGA, initialize MyVideoDriver as an SVGA display using specified mode // MyVideoDriver.Mode = mode; isn't exactly needed, just done in case it doesn't set.