Modules/BochsGA - Comment on new MMIO registers, output full BAR set
authorJohn Hodge <[email protected]>
Sat, 10 May 2014 07:44:32 +0000 (15:44 +0800)
committerJohn Hodge <[email protected]>
Sat, 10 May 2014 07:44:32 +0000 (15:44 +0800)
KernelLand/Modules/Display/BochsGA/bochsvbe.c

index a6338ae..7674ed9 100644 (file)
@@ -118,8 +118,15 @@ int BGA_Install(char **Arguments)
        dev = PCI_GetDevice(0x1234, 0x1111, 0);\r
        if(dev == -1)\r
                base = VBE_DISPI_LFB_PHYSICAL_ADDRESS;\r
-       else\r
-               base = PCI_GetBAR(dev, 0);\r
+       else {\r
+               Log_Debug("BGA", "BARs %x,%x,%x,%x,%x,%x",\r
+                       PCI_GetBAR(dev, 0), PCI_GetBAR(dev, 1), PCI_GetBAR(dev, 2),\r
+                       PCI_GetBAR(dev, 3), PCI_GetBAR(dev, 4), PCI_GetBAR(dev, 5));\r
+               base = PCI_GetValidBAR(dev, 0, PCI_BARTYPE_MEM);\r
+               // TODO: Qemu/bochs have MMIO versions of the registers in BAR2\r
+               // - This range is non-indexed\r
+               //mmio_base = PCI_GetValidBAR(dev, 2, PCI_BARTYPE_MEM);\r
+       }\r
 \r
        // Map Framebuffer to hardware address\r
        gBGA_Framebuffer = (void *) MM_MapHWPages(base, 768);   // 768 pages (3Mb)\r

UCC git Repository :: git.ucc.asn.au