mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-22 05:48:37 +00:00
Finally! Fixed PCIDeviceExists returning null if it doesn't instead of false - Bit of a hack but it's done the job for now, needs redoing
This commit is contained in:
parent
efa36d1600
commit
becfc92417
5 changed files with 53 additions and 12 deletions
|
|
@ -2,10 +2,11 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<Bochs_Name>CosmosGraphicSubsystemBoot</Bochs_Name>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<BinFormat>elf</BinFormat>
|
||||
<BinFormat>Bin</BinFormat>
|
||||
<DebugEnabled>True</DebugEnabled>
|
||||
<DebugMode>Source</DebugMode>
|
||||
<TraceMode>User</TraceMode>
|
||||
|
|
@ -17,9 +18,9 @@
|
|||
<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>
|
||||
<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>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
16
Kernel.sln
16
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}
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue