Switching From Graphics To Text

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
melgmry0101b
Member
Member
Posts: 109
Joined: Wed Nov 10, 2010 10:49 am

Switching From Graphics To Text

Post by melgmry0101b »

Hi everyone,
this question is familiar and i found many questions like this in the forum.
I used this code:
http://files.osdev.org/mirrors/geezer/o ... cs/modes.c
but it has many errors in the modes setting registers like g_80x25_text .
Now i want to know how can i write something like these registers because the provided registers is wrong and it case a garbage on the screen.
I don't need source codes but i need how to write these registers.
Can you help me?
Is there any risks if i made an error in these registers?
---------------------------------------------------------
Thank you in advance.
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: Switching From Graphics To Text

Post by Combuster »

Register dumps do not automagically load a font into RAM :wink:

Also, DAC settings are not included, and VGA code does not usually get you properly out of VESA modes.
"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 ]
melgmry0101b
Member
Member
Posts: 109
Joined: Wed Nov 10, 2010 10:49 am

Re: Switching From Graphics To Text

Post by melgmry0101b »

Really I don't understand your post :)
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: Switching From Graphics To Text

Post by Combuster »

Several things:
1) you are the first to claim bugs in the values of g_80x25_text (without even going into details of those errors)
2) After your second post I even cross-checked the values with my own source and found them to be identical.
Which basically comes down to the fact that there is no bug other than yourself.

Since the problem has now shown to exist between the keyboard and chair, and flaming an OP for not following relevant forum rules (read!) is usually not appreciated, the top 3 of frequently-implemented-bugs relevant to the description had to be posted as the next best alternative.

Make from that what you want, add sarcasm where appropriate.
"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 ]
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Switching From Graphics To Text

Post by neon »

Hello,

The register dump values used in that source code are probably correct; but according to my resource are not the VGA BIOS default values for the video modes being requested. The resource provided by the OP obtained register dumps from the BIOS and are thus may not be entirely portable. I can post what my resource provides as the default BIOS register values if requested.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Post Reply