Page 1 of 1
Common Console Question
Posted: Wed Jun 02, 2004 2:22 am
by amirsadig
I am trying to complete the console driver, but I do not have enough information about consle. for example what should the console have, so that it can run most of console program, also complex console programs.
another questions, could I make console display others langauge,which have others than latin character like arabic, chinese?
my current console driver only can display alphabet.
Re:Common Console Question
Posted: Wed Jun 02, 2004 7:36 am
by Solar
amirsadig wrote:
for example what should the console have, so that it can run most of console program, also complex console programs.
You are talking two sets of features here.
One, what underlying features do those "complex console programs" (e.g. vim) rely upon. The answer is, most (not all) of them rely on a library called "ncurses" - as well as on various other features unrelated to your console. Even if your console would provide all the required features to support ncurses, you would still have to port ncurses to your console.
Two, what are those features that ncurses requires? For that you'd best refer to the ncurses homepage,
http://www.gnu.org/software/ncurses/.
another questions, could I make console display others langauge,which have others than latin character like arabic, chinese?
If you mean "console" as in bare-bones I-poke-0xb8000 functionality, then no. Your BIOS is not prepared to display arabic or chinese characters.
But it is certainly possible to
implement support for such.
Re:Common Console Question
Posted: Wed Jun 02, 2004 8:49 am
by Pype.Clicker
http://www.gnu.org/directory/libs/ncurses.html
ncurses looks to have moved within gnu.org ...
arabic, chinese, etc
Your VGA card has the ability to reprogram characters, and may use two distinct character sets (toggled by the highest 'attr' bit), so you could decide to map chinese unicode strings to a collection of reprogrammed characters that will appear as a chinese glyph.
However, i doubt the 'fixed-length' of characters will produce a nice output anyway, so i'd say 'leave exotic languages for the GUI-equipped version'.
Re:Common Console Question
Posted: Wed Jun 02, 2004 11:49 am
by amirsadig
One, what underlying features do those "complex console programs" (e.g. vim) rely upon. The answer is, most (not all) of them rely on a library called "ncurses" - as well as on various other features unrelated to your console.
I know that most console program rely on ncurses. but ncurses should use resources from OS, which should provide it, so that complex console run.
I want late to write a library which let program uses my console and keyboard. ncurses need a lot of time to port than write a library do what I want to programs, but still those program need complex console operations.
what console should provide to let such program or to write a library which uses it?
Re:Common Console Question
Posted: Wed Jun 02, 2004 4:01 pm
by Pype.Clicker
most support for ANSI stuff ... They also have 'raw input mode' for delivering each keystroke to the reader without waiting for a 'end of line'. Get a look at <linux/tty.h> (posix) and you'll see how many ugly modes exists to echo characters, force uppercase and things alike ...
There are also 'special' characters like VREPRINT, VERASE, VKILL, etc which provide basic control. There's also set_termios, which appears to be used when terminal is 'resized', etc ...
Re:Common Console Question
Posted: Fri Jun 04, 2004 6:54 am
by Solar
Still not sure I understand you correctly.
Sure you could claim that porting ncurses would be too much work, and write your own library. However, you basically have only four choices:
* take pains porting ncurses (as sole or additional console lib);
* take pains porting ncurses-using tools to your library, one at a time;
* hope that someone else ports ncurses to your library;
* forget about getting ncurses-using tools to your OS.
All four are valid design decisions. Just make sure you know what you're doing.
If you want to know what ncurses requires to run on your console, well, you should look it up in the ncurses sources / docs.
If you want to know what ncurses-using tools require to be ported to your console, still, the ncurses docs / sources are the starting point.
If you want to know what a good console library of your own should provide... well, I'd still have a look at the ncurses lib, and decide what's good and what's legacy.