OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 10:38 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Switch from graphics mode to textmode
PostPosted: Tue Jun 08, 2021 4:40 am 
Offline
Member
Member

Joined: Tue Aug 30, 2016 1:31 pm
Posts: 69
Hello everyone,

First of all thanks to the author who wrote the tutorial about VGA.

The thing is, I want my OS to be able to switch back to textmode. Since the tutorial is full of warnings about unhealthy switching habbits, I would like to ask what the best method is to switch back from vga to textmode.

Thank you in advantage!


Top
 Profile  
 
 Post subject: Re: Switch from graphics mode to textmode
PostPosted: Tue Jun 08, 2021 5:38 am 
Offline
Member
Member

Joined: Sat Nov 21, 2009 5:11 pm
Posts: 852
In text mode, plane 0 holds character indices, plane 1 holds attributes and plane 2 holds up to 8 different fonts with 256 characters of 32 bytes each. Each byte represents one character row.

Important register settings:
Graphics register 5 should be set to 0x10. (chain odd/even when reading, 2 bit mode off, 8 bit mode off)
Graphics register 6 should be set to 0x0e. (graphics mode off, chain odd/even when writing, decode B8000-BFFFF - required for Bochs)
Sequencer register 1 bit 2 should be set. (word mode)
Sequencer register 2 should be set to 0x03. (write to planes 0 and 1)
Attribute register 16 should have bits 0 and 6 cleared. (no graphics mode, no 8 bit color)
CRTC register 9 bits 0-4 should be programmed with the font height minus one.
CRTC register 20 should have bits 5 and 6 cleared. (no doubleword addressing)
CRTC register 23 should have bit 6 cleared. (word mode)

Other things to consider are things such as the cursor, underline location, blinking, font selection, 9 dot mode and line graphics continuity mode.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 61 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group