On Tue, 29 Feb 2000, Alistair MacDonald wrote:
> support but they don't support them all. You might notice that most of the
> supported cards are now quite old. They were written at a time when
> running X was too much of an overhead. I remember my original linux
> machine with its massive 4Mb of memory paging madly just trying to run
> twm. (The worst thing is that I used to *use* it like that ... ah the old
> days ...) In these days when most machines have at least 32Mb of memory X
I didn't even install X on my 386SX-20 with 5 MB RAM and 2 40Mb harddisks,
one dedicated to DOS and the other to linux. And gcc was quite slow
compared to the Borland DOS compilers ...
All is different now of course ...
> Its unlikely that any new console drivers will be developed. If someone
> feels the desperate need to write one then a generic VESA driver *might*
> be useful. However, it would be more fun (and more use) to deal with the
> limitations of VGAEmu (such as 16-colour modes, Mode-X, etc)
I was actually looking into this since it is a whole lot easier to
implement a vesa video mode save/restore routine than emulating 16 color
modes, as far as I can see. I can use my graphics card with vesa 2.0 for
just about anything under the console with dosemu, except for vc-
switching. And of course switching from X to the console is always
possible with Ctrl-Alt-F something.
The vesa video save/restore routines are as follows (this is from
svgalib):
/* Read and save chipset-specific registers */
static int vesa_saveregs(unsigned char regs[])
{
void * buf;
buf=LRMI_mem1;
vesa_r.eax=0x4f04;
vesa_r.ebx=0;
vesa_r.es=((long)buf)>>4;
vesa_r.edx=1;
vesa_r.ecx=__svgalib_VESA_savebitmap;
__svgalib_LRMI_int(0x10,&vesa_r);
memcpy(®s[VGA_TOTAL_REGS],buf,vesa_regs_size);
return vesa_regs_size;
}
/* Set chipset-specific registers */
static void vesa_setregs(const unsigned char regs[], int mode)
{
void * buf;
buf=LRMI_mem1;
memcpy(buf,®s[VGA_TOTAL_REGS],vesa_regs_size);
vesa_r.eax=0x4f04;
vesa_r.ebx=0;
vesa_r.es=((long)buf)>>4;
vesa_r.edx=2;
vesa_r.ecx=__svgalib_VESA_savebitmap;
__svgalib_LRMI_int(0x10,&vesa_r);
}
What I need to figure out is what is the dosemu equivalent of
__svgalib_LRMI_int(), which calls the real vesa bios. I looked
through the source to find the example where c000:3 is called, but
one place in src/env/vga.c, where other comments point to, is commented
out with a "#if 0". I would greatly appreciate it if somebody could point
me to the cleanest way of implementing this.
Bart