home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / linux / 10777 < prev    next >
Encoding:
Text File  |  1992-09-15  |  1.8 KB  |  61 lines

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!usc!rpi!bu.edu!dartvax!coos.dartmouth.edu!platt
  2. From: platt@coos.dartmouth.edu (The Crouton Man)
  3. Newsgroups: comp.os.linux
  4. Subject: Re: Can you access a virtual console directly?
  5. Message-ID: <1992Sep16.010315.29093@dartvax.dartmouth.edu>
  6. Date: 16 Sep 92 01:03:15 GMT
  7. References: <1992Sep14.164729.28907@mits.mdata.fi> <1992Sep14.220800.12868@klaava.Helsinki.FI> <1992Sep15.164930.11353@mits.mdata.fi>
  8. Sender: news@dartvax.dartmouth.edu (The News Manager)
  9. Organization: Dartmouth College, Hanover, NH
  10. Lines: 49
  11.  
  12. In article <1992Sep15.164930.11353@mits.mdata.fi> kennu@mits.mdata.fi (Kenneth Falck) writes:
  13. :In article <1992Sep14.220800.12868@klaava.Helsinki.FI> wirzeniu@klaava.Helsinki.FI (Lars Wirzenius) writes:
  14. :
  15. :>kennu@mits.mdata.fi (Kenneth Falck) writes:
  16. :>>It feels a bit dumb to use termcap-codes to handle the local output, if
  17. :>>you know you'll be using this terminal from the virtual consoles only. 
  18. :
  19. :>[stuff deleted...]
  20. :>[ Does anybody else get tired of MS-DOS programmers whose first (and
  21. :>often enough only) thought is: ``How do I write directly to video
  22. :>memory?'' Perhaps we'll see requests for adding TSR support into Linux
  23. :>next. Urgh. ]
  24. :
  25. [stuff deleted ]
  26.  
  27. :int main (void)
  28. :{
  29. : int curvt;
  30. : int cols, rows;
  31. : unsigned char *vtbuf;
  32. : cols = vt_get_columns ();
  33. : rows = vt_get_rows ();
  34. : curvt = vt_get_current ();
  35. : vtbuf = vt_get_address (curvt);
  36. : vtbuf [0] = 'L'; vtbuf [1] = 0x07;
  37. : vtbuf [2] = 'i'; vtbuf [3] = 0x07;
  38. : vtbuf [4] = 'n'; vtbuf [5] = 0x07;
  39. : vtbuf [6] = 'u'; vtbuf [7] = 0x07;
  40. : vtbuf [8] = 'x'; vtbuf [9] = 0x07;
  41. : vt_update_buffers (curvt);
  42. : return 0;
  43. :}
  44.  
  45. you can already do this for all terminals at once.
  46.  
  47. int main()
  48. {
  49.     ...
  50.     initscr();
  51.     standout()
  52.     printw("Linux");
  53.     standend();
  54.     refresh();
  55. }
  56.  
  57. man 3 curses
  58.  
  59. croutons.
  60.