OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Nov 17, 2017 7:06 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Finding 4-color standard graphics mode 4h register values
PostPosted: Fri Jul 21, 2017 6:46 pm 
Offline
Member
Member
User avatar

Joined: Tue Mar 06, 2007 11:17 am
Posts: 1016
I need a place to find the actual register values for VGA so that I can manually set 320x200 4-color graphics mode (BIOS mode 4h).

So far, my kernel has the registers for:

- 80x25 16-color text mode.
- 640x480 16-color.
- 320x200 256 colors.
- 320x200 Mode X.

Also, is there some way or some tool to read all the VGA registers and save them while I'm running a given video mode?

_________________
Image http://www.archefire.org/_PROJECTS_/ (udocproject@yahoo.com)

YouTube Development Videos:
http://www.youtube.com/user/AltComp126/videos

Current IP address for hosts file (all subdomains):
190.150.9.244 archefire.org


Last edited by ~ on Sat Jul 22, 2017 8:40 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Finding 4-color standard graphics mode 3h register value
PostPosted: Sat Jul 22, 2017 5:34 am 
Offline
Member
Member

Joined: Sat Nov 21, 2009 5:11 pm
Posts: 647
Mode 3 is 80x25 text mode. You mean mode 4. The registers are set as follows:

Clocking mode: 09h
Map mask: 03h
Character map: 00h
Memory mode: 02h
Output register: 63h
CRTC registers: 2Dh, 27h, 28h, 90h, 2Ah, 80h, 0BFh, 1Fh, 0, 0C1h, 0, 0, 0, 0, 0, 0, 9Ch, 8Eh, 8Fh, 14h, 0, 96h, 0B9h, 0A2h, 0FFh
Attribute controller registers: 0, 13h, 15h, 17h, 2, 4, 6, 7, 10h, 11h, 12h, 13h, 14h, 15h, 16h, 17h, 1, 0, 3, 0
Graphics registers: 0, 0, 0, 0, 0, 30h, 0fh, 0, 0ffh

You read the VGA registers like this:
- To read an attribute controller register, write the index normally and read the data from port 3C1h.
- To read the output register, read from port 3CCh.
- To read color registers, write the starting index to port 3C7h and read color triplets sequentially from port 3C9h.
- To read any other register, write the index normally and read the data from the corresponding data port.


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], DropDemBits, Google [Bot] and 24 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