From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from duke.felloff.net ([216.126.196.34]) by ur; Tue Jul 5 08:26:11 EDT 2016 Message-ID: Date: Tue, 5 Jul 2016 14:26:03 +0200 From: cinap_lenrek@felloff.net To: 9front@9front.org Subject: Re: [9front] core-i3 and vesa mode In-Reply-To: <940ee5edc20dfe080c9dd77bd12af250@titan.jitaku.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: descriptor just-in-time realtime-java-aware solution the bios probably didnt map all the graphics memory, just enougth for the screen on boot. the kernel vgaigfx driver already has code to determine how much memory got mapped in the gtt. we could make it map all the physical memory there in case the bios didnt do it for us. static uintptr gmsize(Pcidev *pci, void *mmio) { u32int x, i, npg, *gtt; npg = stolenmb(pci)<<(20-12); if(npg == 0) return 0; gtt = (u32int*)((uchar*)mmio + pci->mem[0].size/2); if((gtt[0]&1) == 0) return 0; x = (gtt[0]>>12)+1; for(i=1; i>12) != x) break; x++; } if(0) print("igfx: graphics memory at %p-%p (%ud MB)\n", (uintptr)(x-i)<<12, (uintptr)x<<12, (i>>(20-12))); return (uintptr)i<<12; } -- cinap