change extended ascii fonts in pmode

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
psnix
Member
Member
Posts: 50
Joined: Fri Oct 24, 2008 12:34 pm

change extended ascii fonts in pmode

Post by psnix »

hi

how i can change extended ASCII fonts in pmode?! (please describe with sample code)

and

is default mode 7? can i change fonts in this mode?!

sorry for bad english
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: change extended ascii fonts in pmode

Post by neon »

What do you mean by "default mode"? The video mode the system runs at startup? Its useually Mode 3.

You can technically change fonts in any mode via VGA programming.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
psnix
Member
Member
Posts: 50
Joined: Fri Oct 24, 2008 12:34 pm

Re: change extended ascii fonts in pmode

Post by psnix »

hi
i mean this (video mode at startup). but how can i change fonts in this mode ?(mode 3) (i must do it at pmode)
djmauretto
Member
Member
Posts: 116
Joined: Wed Oct 22, 2008 2:21 am
Location: Roma,Italy

Re: change extended ascii fonts in pmode

Post by djmauretto »

Ciao :D
You can change font before to switch in pmode by BIOS function .
Note that some video card ( example my ATI video card)
use card specific register not compatible with VGA.
I have disassembly my BIOS function and it use port 0xc000,this is not a VGA port.
Sure you can do it with classic VGA register , but it's not safe,anyway
the code is complex,note that you must recalculate everytime
the CRT with size of your character and so on.....
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: change extended ascii fonts in pmode

Post by Combuster »

BS. Almost all video cards support VGA and a card-specific method.

This question has been asked like 10 times in the past few months. I'm not going to provide links again.
"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: change extended ascii fonts in pmode

Post by neon »

Note that some video card ( example my ATI video card)
use card specific register not compatible with VGA.
Card-specific registers are of course not compatible with VGA. This does not mean the card doesn't support VGA.
Sure you can do it with classic VGA register , but it's not safe,anyway
Fundamentally hardware programming is not safe. VGA is portable among all modern video cards hence is "more safe" to use then card-specific interfaces as it is more guaranteed to work.
but how can i change fonts in this mode ?(mode 3) (i must do it at pmode)
djmauretto mentioned the use of a bios interrupt (You can switch to real mode to use it or do it before switching to pmode.) or directly via VGA (or similar) programming. As Combuster posted, this has been asked quite a few times (You may even see posts on the first or second page) related to your question--do some searching.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Post Reply