Skip to content

Commit

Permalink
Merge pull request CosmosOS#552 from cjhannah/patch-1
Browse files Browse the repository at this point in the history
Add check for BGA
  • Loading branch information
fanoI authored Dec 31, 2016
2 parents ce406f9 + 99adf8d commit d804a30
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion source/Cosmos.HAL/Drivers/VBEDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,19 @@ public class VBEDriver
{

private Core.IOGroup.VBE IO = Core.Global.BaseIOGroups.VBE;

public VBEDriver()
{
if (Cosmos.HAL.PCI.GetDevice(1234, 1111) == null){
throw new NotSupportedException("No BGA adapter found..");
}
}
public VBEDriver(ushort x, ushort y, ushort bpp)
{
if (Cosmos.HAL.PCI.GetDevice(1234, 1111) == null){
throw new NotSupportedException("No BGA adapter found..");
}
vbe_set(x,y,bpp);
}
private void vbe_write(ushort index, ushort value)
{
IO.VbeIndex.Word = index;
Expand All @@ -19,6 +31,7 @@ private void vbe_write(ushort index, ushort value)

public void vbe_set(ushort xres, ushort yres, ushort bpp)
{

//Disable Display
vbe_write(0x4, 0x00);
//Set Display Xres
Expand Down

0 comments on commit d804a30

Please sign in to comment.