okay, time to make myself clear.
VGA has about 16K of text VRAM, which is enough for 4 screens of 80x25. It also has a registerfor selecting from which address in this VRAM the actual screen rendering starts. Here's a small example assuming you have in bx the
offset within 0xb800 segment where your screen begins (bx=0 -> starting at 0xb800:0 to 0xb800:0f9f is visible, bx=80 you have skipped one row, etc.)
show:
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
ret
Now, there are several way to use this, but in OS programming, you mainly have 2 interresting ones:
- use each 80x25 vram space to store different infos (normal progress screen, administrator console, log, debug console, whatever
and implement a keyboard handler that can (for instance) hook ALT+Fx to switch to the xth virtual screen by just setting bx=0x1000 * x and then call show.
- use a single 80x50 vram space to simulate scrolling: when you arrive with your cursor at line 25, instead of scrolling everything, you just move to bx=80 and go on, then bx=160 and call show, etc. until you reach line 50 (or 100, that's like you want).
When that final limit is reached, you'll have to do a real scroll by copying [0xb800:bx..0xb800:bx+f00] to [0xb800:0..0xb800:f00] and resetting bx=0.
As this copy occurs once every 50 or 100 rows instead of every row in the usual scrolling techinque, you will speed up your console output dramatically !!
This is higher ASM, so use it wisely
For hardware infos, check your fav' docs about CRT controller (i think that's the chip ...)