Text mode paging

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
jasonc122
Member
Member
Posts: 27
Joined: Fri Jan 01, 2010 7:51 am

Text mode paging

Post 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
H Technology Solutions - Business Operating System Specialists
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: Text mode paging

Post by thepowersgang »

Simple, keep a backbuffer somewhere else in the kernel's memory, and use memcpy to scroll.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
jasonc122
Member
Member
Posts: 27
Joined: Fri Jan 01, 2010 7:51 am

Re: Text mode paging

Post 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?
H Technology Solutions - Business Operating System Specialists
User avatar
djsilence
Member
Member
Posts: 70
Joined: Wed Oct 01, 2008 11:18 am
Location: Ukraine, Kiev
Contact:

Re: Text mode paging

Post 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.
Don't think a ****, but in ukrainian schools English is TOO BAD!
Selenic
Member
Member
Posts: 123
Joined: Sat Jan 23, 2010 2:56 pm

Re: Text mode paging

Post 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)
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Text mode paging

Post 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!
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Selenic
Member
Member
Posts: 123
Joined: Sat Jan 23, 2010 2:56 pm

Re: Text mode paging

Post 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.
Post Reply