J
Jordan Hazen
I'm having a problem with the integrated S3 ProSavage video chipset
(VT8605) on an older Socket 370 motherboard. Any attempt to change the
standard VGA palette (DAC color map) is silently ignored. I tried
Linux's virtual-console escape sequence:
(ESC) ] P c rr gg bb
e.g. (ESC)]P7F0F0F0
and also writing directly to the standard VGA DAC registers at 0x3c8,
0x3c9 using the code included below. Neither will work on this
particular board. Graphical framebuffer console behave the same as
text-mode.
Booting off a DOS floppy and running shareware tools like "palpal.exe"
also yield no change to the color table. With every other board, all
these methods work fine.
EGA Palette registers at 3c0, 3c1 do function correctly for remapping
the 16 "CGA" colors to 64 standard EGA colors, but with only three
luminance levels available, this doesn't help much in setting up
grayscale palettes for a monochrome monitor.
Does the VT8605 have a a special "lock" register I need to clear before
the VGA DAC palettes can be changed? Perhaps the DAC tables are mapped
differently on this chip than on every other VGA card?
Any insight would be appreciated...
/* vga-pset.c */
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/io.h>
void
ioport(int port) {
if (ioperm(port,2,1) == -1) {
fprintf(stderr,"Unable to set up i/o permissions, exiting.\n");
exit(1);
}
if (i386_set_ioperm(iomap) == -1)
errx(1, "Couldn't set I/O permissions.");
}
int
main(int argc, char **argv) {
int preg,r,g,b;
if (argc != 5) {
fprintf(stderr,"Need four arguments: preg [0-63], R, G, B values [all 0-63].\n");
exit(1);
}
preg=atoi(argv[1]);
r=atoi(argv[2]);
g=atoi(argv[3]);
b=atoi(argv[4]);
if (preg < 0 || preg > 63 || r < 0 || r > 63 || g < 0 || g > 63 || b < 0 || b > 63 ) {
fprintf(stderr,"Arguments out of range (preg [0-63], RGB colorvalues [0-63]).\n");
exit(1);
}
setuid(0);
ioport(0x3C6);
ioport(0x3C8);
ioport(0x3C9);
outb(0xFF,0x3C6);
outb(preg,0x3C8);
outb(r,0x3C9);
outb(g,0x3C9);
outb(b,0x3C9);
printf("set palette DAC reg %d to %d %d %d\n",preg,r,g,b);
return 0;
}
(VT8605) on an older Socket 370 motherboard. Any attempt to change the
standard VGA palette (DAC color map) is silently ignored. I tried
Linux's virtual-console escape sequence:
(ESC) ] P c rr gg bb
e.g. (ESC)]P7F0F0F0
and also writing directly to the standard VGA DAC registers at 0x3c8,
0x3c9 using the code included below. Neither will work on this
particular board. Graphical framebuffer console behave the same as
text-mode.
Booting off a DOS floppy and running shareware tools like "palpal.exe"
also yield no change to the color table. With every other board, all
these methods work fine.
EGA Palette registers at 3c0, 3c1 do function correctly for remapping
the 16 "CGA" colors to 64 standard EGA colors, but with only three
luminance levels available, this doesn't help much in setting up
grayscale palettes for a monochrome monitor.
Does the VT8605 have a a special "lock" register I need to clear before
the VGA DAC palettes can be changed? Perhaps the DAC tables are mapped
differently on this chip than on every other VGA card?
Any insight would be appreciated...
/* vga-pset.c */
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/io.h>
void
ioport(int port) {
if (ioperm(port,2,1) == -1) {
fprintf(stderr,"Unable to set up i/o permissions, exiting.\n");
exit(1);
}
if (i386_set_ioperm(iomap) == -1)
errx(1, "Couldn't set I/O permissions.");
}
int
main(int argc, char **argv) {
int preg,r,g,b;
if (argc != 5) {
fprintf(stderr,"Need four arguments: preg [0-63], R, G, B values [all 0-63].\n");
exit(1);
}
preg=atoi(argv[1]);
r=atoi(argv[2]);
g=atoi(argv[3]);
b=atoi(argv[4]);
if (preg < 0 || preg > 63 || r < 0 || r > 63 || g < 0 || g > 63 || b < 0 || b > 63 ) {
fprintf(stderr,"Arguments out of range (preg [0-63], RGB colorvalues [0-63]).\n");
exit(1);
}
setuid(0);
ioport(0x3C6);
ioport(0x3C8);
ioport(0x3C9);
outb(0xFF,0x3C6);
outb(preg,0x3C8);
outb(r,0x3C9);
outb(g,0x3C9);
outb(b,0x3C9);
printf("set palette DAC reg %d to %d %d %d\n",preg,r,g,b);
return 0;
}