Common Console Question

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
amirsadig

Common Console Question

Post 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.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Common Console Question

Post 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.
Every good solution is obvious once you've found it.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Common Console Question

Post 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'.
amirsadig

Re:Common Console Question

Post 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?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Common Console Question

Post 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 ...
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Common Console Question

Post 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.
Every good solution is obvious once you've found it.
Post Reply