Page 1 of 1
tty's and virtual consoles
Posted: Thu Oct 21, 2004 9:49 pm
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?
Re:tty's and virtual consoles
Posted: Fri Oct 22, 2004 2:37 am
by bubach
Maybe allocate memory for each virtual console and then flip between the allocated memory and 0xB8000?
Re:tty's and virtual consoles
Posted: Fri Oct 22, 2004 3:18 am
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
Re:tty's and virtual consoles
Posted: Sat Oct 23, 2004 7:00 am
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
Re:tty's and virtual consoles
Posted: Sat Oct 23, 2004 7:10 am
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.