From: pete@q106fm.UUCP (pete cervasio) Subject: Re: Can you access a virtual console directly? Date: Wed, 16 Sep 1992 21:49:45 CDT
kjb@cgl.citri.edu.au (Kendall Bennett) writes:
> wirzeniu@klaava.Helsinki.FI (Lars Wirzenius) writes:
>
> >How do you know it will be used on virtual consoles only? How do you
> >know what kind of virtual console it is? Is it VGA, CGA, XGA, Hercules,
> >something else? If you happen to know it is VGA, do you know it is
> >80x25? 80x50? 80x43? 100x40? 100x32? 132x25? 132x44? 40x25? Some
> >dimensions you've never even heard of? Do you even know that it will run
> >on Linux? Do you _really_ want to fall into the MS-DOS trap of having a
> >special driver for each and every piece of hardware that the program is
> >supposed to run on, instead of using the driver that already exists in
> >the operating system?
>
> Well, someone has to do it right? How does curses handle this. It is
> a normal C library that handles this sort of stuff for you, so surely
> you can get the same info that curses uses and figure it out from there.
Curses gets the screen dimensions from the termcap entry. It keeps a
character array in memory that it uses as a map of "what's on the
screen". When it comes time to write out the characters that have
changed (via refresh()), it uses the terminal control sequences to move
to the correct location and outputs those changed characters. The
{terminal|xterm|console driver in the kernel} handle the actual moving
of the cursor, putting the characters on the screen, etc.
A lot of times I don't want all the curses baggage, so I use the termcap
library all by itself. You don't get all the nifty window routines
unless you write them yourself, but it's great for just clearing the
screen, positioning the cursor, and setting character attributes. I've
never really noticed any programs being "slow" with their screen
updating (like when using the DOS video output routines - not BIOS), so
I can't really see a reason to want to write directly to video ram other
than "that's the way we've done it before".
Just my US$.02 worth.
Pete C.
+----------------------------------------------------------------------+
| Pete Cervasio | pete%q106fm.uucp@wupost.wustl.edu |
| I fish, therefore I am. | pete.cervasio@f1.n2250.z1.fidonet.org |
+----------------------------------------------------------------------+
| If you think of C as a preprocessor for your assembler, it makes |
| just as little sense as before. (me) |
+----------------------------------------------------------------------+