OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Apr 16, 2024 12:17 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: VGA mode hack
PostPosted: Sun May 22, 2011 12:57 pm 
Offline
Member
Member

Joined: Sat Oct 16, 2010 3:38 pm
Posts: 587
There isn't much information on the internet about this, and I really want it quite simple. I've made a panic screen, and I think it may have trouble when the GUI is enabled. My question is: how can I switch to 80x25 16-color text mode by modifying a VGA register or something? I can't use the BIOS in Protected Mode, and setting up VM86 is pointless when I only want this one, simple procedure Any help?


Top
 Profile  
 
 Post subject: Re: VGA mode hack
PostPosted: Sun May 22, 2011 3:27 pm 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
If you're using a VESA mode, forget it. You need VBE or a dedicated device-specific driver to tear it down as it is not in VGA mode. Most devices I have actually developed native drivers for will stick in graphics mode whatever VGA writes you do, with results varying between no change to garbled displays or even defective signals that can potentially blow up monitors or require epilepsy warnings.

If you're in a VGA mode, it is still some work to do it properly:
- Unlock VGA registers, disable screen
- Restore the font (it must come from somewhere, and your typical sources may not be reliable anymore)
- Write a register image corresponding to mode 3h
- Reload the DAC and palettes if they might be modified. (available regdumps occasionally include the palette by default)
- Enable screen again and write text.

In other words, there's no quick hack to do it and be fairly sure you get a visible coredump. If you want a simple and reliable method during crashes, you may want to consider setting up a serial connection instead.

_________________
"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 ]


Top
 Profile  
 
 Post subject: Re: VGA mode hack
PostPosted: Sun May 22, 2011 4:13 pm 
Offline
Member
Member
User avatar

Joined: Tue Feb 08, 2011 1:58 pm
Posts: 496
When I faced the same problem, I searched the wiki, and found this in a minute:
http://files.osdev.org/mirrors/geezer/o ... cs/modes.c
quite useful.


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot], TYDQSoft and 65 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