bios interuppts
My problem is i was using turbo c++ compiler before and frequently
used ROM-BIOS interupts for
certain functions ( like handling the screen, calling the mouse etc all in dos based programs
using 386 based registers like ah al etc).
Now I've started using gcc and find that even a basic screen clearing function requires me to use the
"ncurses" library. this i did but it handles the screen only using
windows and does not treat the console as an unlimited buffer.
I dont wanna use the library therefore. plus it was a lot easier calling interupts for most simple tasks.
I've read somewhere that Linux does not allow BIOS interupts since
it runs in 'protected' mode.
therefore, I cant do simple stuff like clearing a screen myself.
Is there some way to do the above task easily (with or without assembly ?)
Please help.
Anant
Anant Aneja am Dienstag, 4. März 2003 12:07:
[...]
Quoted 3 lines
Is there some way to do the above task easily (with or without assembly ?)
VT100/102 controls. the basic ones apply to any sort of console/tty emulation (function keys are different, designers seem to care for in-compatibility...)
best,
hp
Signature · 8 lines
RTFM + the FAQ(s) + those many DOCs, at http://linuxassembly.org -- Linux,Assembly,Forth: http://www.lxhp.in-berlin.de/index-lx.shtml en/de pse, reply to << lx -at- lxhp -dot- in-berlin -dot- de >> - To unsubscribe from this list: send the line "unsubscribe linux-assembly" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
The simplest way to do it is to use terminal escape codes. That is, you put these codes in a string and print the string with a simple write() or printf() call. The terminal will recognize the codes in the string and execute some special intructions such as clear the screen.
For example:
#include <stdio.h>
#define ESC 0x1B /* escape code */
int main()
{
/* Escape codes */
char clr[5] = {ESC, '[', '2', 'J', 0}; /* clear screen */
char cur[6] = {ESC, '[', '0', '0', 'H', 0}; /* goto 0,0 */ printf(clr);
printf(cur);
return(0);}
More escape codes can be found at:
http://ilkerf.tripod.com/cdoc/vt100ref.html
and many other similar links.
Hope this helps,
--Emanuele
Quoted 35 lines · Anant Aneja
My problem is i was using turbo c++ compiler before and frequently
used ROM-BIOS interupts for
certain functions ( like handling the screen, calling the mouse etc all in dos based programs
using 386 based registers like ah al etc).Now I've started using gcc and find that even a basic screen clearing function requires me to use the
"ncurses" library. this i did but it handles the screen only using
windows and does not treat the console as an unlimited buffer.I dont wanna use the library therefore. plus it was a lot easier calling interupts for most simple tasks.
I've read somewhere that Linux does not allow BIOS interupts since
it runs in 'protected' mode.
therefore, I cant do simple stuff like clearing a screen myself.Is there some way to do the above task easily (with or without assembly ?)
Please help.
Anant-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 1 line
The simplest way to do it is to use terminal escape codes.
vt100 escape codes aren't guaranteed to work everywhere, though.
If you don't care much about portability, then use the escape codes that are shared between VT100, ANSI, and xterm. That will probably work fine 99% of the time, on a Linux machine.
If you don't care at all about portability, then use whatever escape codes your own particular terminal uses.
If you do care about portability, then use ncurses. Or else don't even try to draw on the screen. After all, the "screen" might actually be a TTY (at least in theory).
b
Quoted 8 lines
Quoted 2 lines
The simplest way to do it is to use terminal escape codes.
vt100 escape codes aren't guaranteed to work everywhere, though.
If you don't care much about portability, then use the escape codes that are shared between VT100, ANSI, and xterm. That will probably work fine 99% of the time, on a Linux machine.
also, if you only care about working on the text console you can read/write to the /dev/vcs* devices ( "man vcs" ) which give you more or less the equivelant of poking around in the DOS text-framebuffer.
Vince
Brian Raiter am Dienstag, 4. März 2003 20:28:
Quoted 3 lines
Quoted 1 line
The simplest way to do it is to use terminal escape codes.
vt100 escape codes aren't guaranteed to work everywhere, though.
[...]
simplest 'clearscreen', standard even in those times where the 'tty' was a real tty writer is by VT control <ff>, i.e. char 12. def'd in ANSI, VT52, etc. it should be handled by a displaying program such that it clears the screen or, sends a form feed if output is not a video display.
hp
--
Linux,Assembly,Forth: http://www.lxhp.in-berlin.de/index-lx.shtml en/de
pse, reply to << lx -at- lxhp -dot- in-berlin -dot- de >>
-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 5 lines
simplest 'clearscreen', standard even in those times where the 'tty' was a real tty writer is by VT control <ff>, i.e. char 12. def'd in ANSI, VT52, etc. it should be handled by a displaying program such that it clears the screen or, sends a form feed if output is not a video display.
I agree that it *should*. However, FF does not clear the screen in the Linux console, or in any of the xterm programs that I tested it with. That makes it pretty unportable in my book, at least in the context of a linux-based mailing list.
b
indeed. I'm very disappointed...
<ff> doesn't work. nowhere, tried lx console, eterm, rxvt, konsole(kde), xterm
Brian Raiter am Mittwoch, 5. März 2003 19:42:
Quoted 9 lines
Quoted 2 lines
that it clears the screen or, sends a form feed if output is not a video display.
I agree that it *should*. However, FF does not clear the screen in the Linux console, or in any of the xterm programs that I tested it with. That makes it pretty unportable in my book, at least in the context of a linux-based mailing list.
b
--
Linux,Assembly,Forth: http://www.lxhp.in-berlin.de/index-lx.shtml en/de
pse, reply to << lx -at- lxhp -dot- in-berlin -dot- de >>
-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html