From: olaf@bigred.ka.sub.org (Olaf Titz) Subject: [Source] REALTEK VGA and inverse video mode Date: Mon, 5 Apr 1993 20:47:05 GMT
Here are my diffs to get a video mode with 80x30 chars and inverse
(i.e. black on white, including white border) running on a REALTEK
VGA. The biggest part is actually for inverse video mode, which should
run on every VGA card.
The files are:
gcsetup.s - new file to go into /usr/src/linux/local
(create that directory if you haven't already)
setup.S.diff - diffs for /usr/src/linux/boot/setup.S
console.c.diff - diffs for /usr/src/linux/kernel/chr_drv/console.c
Initializing the VGA isn't hard. If you want standard white-on-black
80x30 (or higher) mode, you need just the trivial first BIOS call in
gcsetup.s. The mode number in AX is to be taken from the manual.
The #define NOSVGA takes the SVGA-detection code out (my invention),
and includes local/gcsetup.s, this is what the diff of setup.S is
for.
gcsetup.s is straightforward: all calls are standard BIOS calls.
These are still permitted in setup, just before going into protected
mode. The biggest part is concerned with swapping palette entries.
For the swapped palette, a different screen blanker has to be employed
(otherwise, blanking would make the screen white.) The new blanker
does some twiddling with the registers to turn the screen off. (There
is a bit in the VGA explicitly for this purpose.) It should run on
other video hardware as well (untested). This screen blanker is the
diff to console.c.
The code shoud work with any VGA for the inverse-video mode if you
undefine NOSVGA and leave out the first BIOS call in gcsetup.s, and it
should work for REALTEK without inversion if you leave out the rest of
gcsetup.s.
With both REALTEK VGA and inversion this runs stable for several
months now at my machine. The diffs are against Linux 0.99.4, but I
assume higer versions don't pose any problems.
This doesn't affect the operation of X11. A problem with X11 is that
sometimes the text font doesn't get restored right after leaving X11,
but this affects other video cards too and it does affect my VGA even
without the patches.
Olaf Titz
(s_titz@ira.uka.de)
[Please don't flame me for posting source here; it is really short and
uploading it to FTP archives would be much more difficult for me.
Thanks.]
begin 644 vgadiffs.tar.Z
M'YV0<NC8.1.F!9DT9LS,>0&@H<.'$"-*G$BQHL6+%4%HO%&C!@@`&D'8D.$1
M9$B1'T^J!`%#8XT9-F#`X'C#!@V-,6+0D#$#9`V,0(,*'4I48ITY=,+(T0C@
M#9LP9HI2/%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WN:`-N9*..*$!BC0\
MZ9/[4GI1>7FHIQ9<&"652'3\9#)E<`?BR'>F62T(1S6*HA,QTYKX43:S]V(I
M-IM3AV;A]I>229?[=I=(J92Y>6Y]^7S[Q&9L&9SVR6J`26WF=FV$J6V&F7I@
M!V[X%J2;%IC5IIM5FIGMIFI25YM#6FNXR91(*G"\26Q)LIBBV9C.EHWW&:6"
M":;I9J6IEJ5B5Z9<2IEKFJ=BNIGN!F^;&9IR5F^.N:6O9ILVTF][B:>(QIN_
M-5^6>JF8FJF:NJF<VJF>^JF@&JJB.JJD6JJF>JJHFJJJNJJLVJJN^JJP&JNR
"VJJ6
`
end
--
olaf titz o olaf@bigred.ka.sub.org voice@49-721-60439
comp.sc.student _>\ _ s_titz@ira.uka.de praetorius@irc
karlsruhe germany (_)<(_) uknf@dkauni2.bitnet happy linux user
what good is a photograph of you? everytime i look at it it makes me feel blue