tty's and virtual consoles

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
steve

tty's and virtual consoles

Post by steve »

I haven't been able to find anything about tty's through google so I am wondering if anyone can tell me what it is supposed to do, and maybe point me too a good site. I've also started coding virtual consoles. Is there a way to make my vidmem start at an address different from 0xB8000? I'm thinking of just sticking a couple pointers in to 0xB0000-0xC0000. Is this how you would do it or is there a better way?
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:tty's and virtual consoles

Post by bubach »

Maybe allocate memory for each virtual console and then flip between the allocated memory and 0xB8000?
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
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:tty's and virtual consoles

Post by Pype.Clicker »

beware that b0000-c0000 is some video memory. that means that you won't have the full 64K for you, but usually only a half of it (either b0000-b7fff for a monochrome card or b8000-bfffff for a colour card)

You can have up to 4 "pages" of screen on which you'll put consoles and toggle between those pages by programming VGA registers ...
Quoting http://cvs.sourceforge.net/viewcvs.py/c ... &view=auto,

Code: Select all

_show:
;[item:SHW]---------------------------------------------------------
;     show console #(eax)
;   this just change offset in VideoRam ;-)
;   we assume VGA display and FULL eax is #console
;   #console ranges from 0 to 3 - higher number won't change it.
;   returns the position of the "current console" pointer in eax.
;-------------------------------------------------------------------
   push ebp
   mov ebp,esp
   cmp eax,4
   jae .out
   pushad
   shl eax,11      ; console offset in VRAM (*0x2000)
   mov ebx,eax
   mov ah,bh      ; first the low byte of the address
   mov al,0x0c
   mov dx,0x03D4      ; CRTC port
   out dx,ax
   mov ah,bl
   inc al
   out dx,ax      ; then the high one
   popad
   pop ebp
   ret

User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:tty's and virtual consoles

Post by bubach »

On my interrupt list it say that mode 0x03 can have 8 pages, does it use the monochrome memory area?

Hmm.. Maybe it?s the reson i can?t get colors to work in DOS.. (they use the color bytes as extra memory?) :-)

/ Christoffer
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
User avatar
df
Member
Member
Posts: 1076
Joined: Fri Oct 22, 2004 11:00 pm
Contact:

Re:tty's and virtual consoles

Post by df »

nah you can put 8 80x25 pages into 32k ram (b8000-bffff).

if you have 80x50 or some other mode, obviously you have less pages.

also.. if your in plain text mode and you dont change video modes, you can decouple the vga memory (64kb) and use it as normal. One of my bootloaders did this and moved itself to run at 0xA0000 so you could load a kernel anywhere in low memory.. nifty trick.
-- Stu --
Post Reply