Page 1 of 1

Text mode paging

Posted: Sat Feb 27, 2010 5:08 am
by jasonc122
Hi,

Can anyone point me to a tutorial which explains how paging can be achieved using 80x25 text mode from protected mode?

I need to implement scrolling for up to 8 pages.

Thanks

Re: Text mode paging

Posted: Sat Feb 27, 2010 5:19 am
by thepowersgang
Simple, keep a backbuffer somewhere else in the kernel's memory, and use memcpy to scroll.

Re: Text mode paging

Posted: Sat Feb 27, 2010 6:51 am
by jasonc122
Thanks but I was hoping for a less memory consumptive solution.

I think I read somewhere that 8 pages (one page = 80*25) can be addressed from 0xb8000 and it's possible to send I/O commands to have the VGA controller select different pages to display. Is this possible?

Re: Text mode paging

Posted: Sat Feb 27, 2010 7:01 am
by djsilence
Actually if there is way via ports to select pages, that anyway it is slower than memcpy (or memmove). In 80x25 mode displayed just 80*25 words. If you'll find way to change buffer address - great, but I guess all of us use simple memmove.

Re: Text mode paging

Posted: Sat Feb 27, 2010 7:05 am
by Selenic
jasonc122 wrote:I think I read somewhere that 8 pages (one page = 80*25) can be addressed from 0xb8000 and it's possible to send I/O commands to have the VGA controller select different pages to display. Is this possible?
Yes, but that only does full-page scrolling, not line-at-a-time. For the latter (or if you want more than 200 lines total, even less if you're doing multiple terminals like Linux can) you'll need to use memcpy; besides, a 4K memcpy isn't even going to be noticed, even with a 1-byte-at-a-time copy.

Besides, storing the text separately and using memcpy makes it much easier to change to using a framebuffer console (80*25 text on a big screen is quite annoying, especially when a framebuffer console can probably get at least three or four times that in each dimension depending on screen size)

Re: Text mode paging

Posted: Sat Feb 27, 2010 9:01 am
by Combuster
Selenic wrote:
jasonc122 wrote:I think I read somewhere that 8 pages (one page = 80*25) can be addressed from 0xb8000 and it's possible to send I/O commands to have the VGA controller select different pages to display. Is this possible?
Yes, but that only does full-page scrolling, not line-at-a-time.
Wrong!

Re: Text mode paging

Posted: Sat Feb 27, 2010 4:16 pm
by Selenic
Combuster wrote:
Selenic wrote:
jasonc122 wrote:I think I read somewhere that 8 pages (one page = 80*25) can be addressed from 0xb8000 and it's possible to send I/O commands to have the VGA controller select different pages to display. Is this possible?
Yes, but that only does full-page scrolling, not line-at-a-time.
Wrong!
Oh, interesting. That also allows (theoretically) 128K of characters, which is still a 16K buffer per terminal for eight virtual terminals (which I think is a very nice feature to have)

Either way, framebuffers are even better, IMHO, because you can then mix graphics in really easily, and changing video mode doesn't screw everything up.