Linux assembly list
 help / color / mirror / Atom feed
* bios interuppts
@ 2003-03-04 12:07 Anant Aneja
  2003-03-04 16:24 ` hp
  2003-03-04 18:04 ` Emanuele Altieri
  0 siblings, 2 replies; 8+ messages in thread
From: Anant Aneja @ 2003-03-04 12:07 UTC (permalink / raw)
  To: linux-assembly

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





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: bios interuppts
  2003-03-04 12:07 bios interuppts Anant Aneja
@ 2003-03-04 16:24 ` hp
  2003-03-04 18:04 ` Emanuele Altieri
  1 sibling, 0 replies; 8+ messages in thread
From: hp @ 2003-03-04 16:24 UTC (permalink / raw)
  To: Anant Aneja, linux-assembly

Anant Aneja am Dienstag, 4. März 2003 12:07:
	[...]
>
> 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
-- 
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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: bios interuppts
  2003-03-04 12:07 bios interuppts Anant Aneja
  2003-03-04 16:24 ` hp
@ 2003-03-04 18:04 ` Emanuele Altieri
  2003-03-04 20:28   ` Brian Raiter
  1 sibling, 1 reply; 8+ messages in thread
From: Emanuele Altieri @ 2003-03-04 18:04 UTC (permalink / raw)
  To: Anant Aneja; +Cc: linux-assembly

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



Anant Aneja wrote:

> 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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: bios interuppts
  2003-03-04 18:04 ` Emanuele Altieri
@ 2003-03-04 20:28   ` Brian Raiter
  2003-03-04 20:34     ` Vince Weaver
  2003-03-05  6:55     ` hp
  0 siblings, 2 replies; 8+ messages in thread
From: Brian Raiter @ 2003-03-04 20:28 UTC (permalink / raw)
  To: linux-assembly

> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: bios interuppts
  2003-03-04 20:28   ` Brian Raiter
@ 2003-03-04 20:34     ` Vince Weaver
  2003-03-05  6:55     ` hp
  1 sibling, 0 replies; 8+ messages in thread
From: Vince Weaver @ 2003-03-04 20:34 UTC (permalink / raw)
  To: linux-assembly


> > 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



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: bios interuppts
  2003-03-04 20:28   ` Brian Raiter
  2003-03-04 20:34     ` Vince Weaver
@ 2003-03-05  6:55     ` hp
  2003-03-05 19:42       ` Brian Raiter
  1 sibling, 1 reply; 8+ messages in thread
From: hp @ 2003-03-05  6:55 UTC (permalink / raw)
  To: Brian Raiter, linux-assembly

Brian Raiter am Dienstag, 4. März 2003 20:28:
> > 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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: bios interuppts
  2003-03-05  6:55     ` hp
@ 2003-03-05 19:42       ` Brian Raiter
  2003-03-05 20:54         ` hp
  0 siblings, 1 reply; 8+ messages in thread
From: Brian Raiter @ 2003-03-05 19:42 UTC (permalink / raw)
  To: hp; +Cc: linux-assembly

> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: bios interuppts
  2003-03-05 19:42       ` Brian Raiter
@ 2003-03-05 20:54         ` hp
  0 siblings, 0 replies; 8+ messages in thread
From: hp @ 2003-03-05 20:54 UTC (permalink / raw)
  To: Brian Raiter, hp; +Cc: linux-assembly

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:
> > 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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-03-05 20:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-04 12:07 bios interuppts Anant Aneja
2003-03-04 16:24 ` hp
2003-03-04 18:04 ` Emanuele Altieri
2003-03-04 20:28   ` Brian Raiter
2003-03-04 20:34     ` Vince Weaver
2003-03-05  6:55     ` hp
2003-03-05 19:42       ` Brian Raiter
2003-03-05 20:54         ` hp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox