From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <41A62B1A.4010008@sitetronics.com> Date: Thu, 25 Nov 2004 19:57:30 +0100 From: "Devon H. O'Dell" User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) MIME-Version: 1.0 To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] VBE 1.2/2.0+ functions for Plan9 References: <74f32320e9b5042e0d79f57b4c38aeca@vitanuova.com> In-Reply-To: <74f32320e9b5042e0d79f57b4c38aeca@vitanuova.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 0cb907e8-eace-11e9-9e20-41e7f4b1d025 rog@vitanuova.com wrote: >>I got some tips to look in Inferno code, since Roger Peppe had >>implemented a VESA driver there. After looking through the Inferno >>source, it appears that any VESA code has been left out of the public >>source. > > > the code is here: > > http://www.vitanuova.com/dist/vesa.tgz > > it was done for an earlier version of inferno, but should > still be applicable (probably with some changes - i haven't looked > at it for years). > > at the time, most video cards i found did not implement VBE2.0 > so there's some probe code taken off the net that probes the > card kind to see how to do bank swapping. > presumbly VBE2.0-compatible cards are more prevalent now, > which allow the portable setting of a linear framebuffer - > it would be nice to remove that dross > > the main complexity is that the vid card setup must be done in > 16 bit mode, so it has to be done in 16-bit assembler before > the main bootstrap runs. this is done in boot-pc/l16.s, > which presents a menu of possible video modes, allows the > user to select one and presents a test display to allow the user > to verify that the mode works. > > most of the code is there (in l16.s) - other changed stuff deals > with bank swapping (mentioned above), passing the > video params through to the main kernel (this will probably have > changed), and stealing the SVGA font so that the bootstrap > knows how to print stuff (since the bootstrap code is entered > in graphics mode, not CGA mode, so we can't easily print chars). > > life would have been much easier if i had been able to figure > a way of invoking 16-bit BIOS calls from 32-bit real mode, > but i failed. anyone know how? other systems seem to manage it. > > my memory is very rusty, but email me if you want help figuring > out my crappy code! > > cheers, > rog. Thanks for this code, Roger! I'm definitely going to take a look at it. I think I'm going to start with a VBE3.0 driver, since that can be implemented fully in protected mode, and then look at implementing some kind of emulation (similar to what XFree86 might do) for VBE 1.2 and 2.0. This is a real help for that, in any case. You'll definitely hear from me if I've got questions :). Kind regards, Devon H. O'Dell