When I put a number into the video memory,there will be a char display on the monitor.
Then,how the video card konw which char will be display and how to show it? Is there any files in the video memory or pc memory control it ?
Because I want to write a OS can display Chinese in text mode,so it is important to me.
Thinks!
oizys
About video card text mode.
- thepowersgang
- Member
- Posts: 734
- Joined: Tue Dec 25, 2007 6:03 am
- Libera.chat IRC: thePowersGang
- Location: Perth, Western Australia
- Contact:
Re: About video card text mode.
http://wiki.osdev.org/VGA_Hardware
The basic gist is that in Text Mode, Planes 0 and 1 are used for the character and attributes and Plane 2 is the font data.
The basic gist is that in Text Mode, Planes 0 and 1 are used for the character and attributes and Plane 2 is the font data.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
- Combuster
- 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: About video card text mode.
The limit of text mode is that you can have only 256 (or 512 if you want to do VGA-specific stuff) different characters max on your screen. How do you intend to cope with the fact that chinese (as I recall it) has much more characters than that?
Re: About video card text mode.
About 20,000 in the Unified CJK section of Unicode, but I think one can get by with about 1000-4000 for daily use.Combuster wrote:The limit of text mode is that you can have only 256 (or 512 if you want to do VGA-specific stuff) different characters max on your screen. How do you intend to cope with the fact that chinese (as I recall it) has much more characters than that?
JAL
Re: About video card text mode.
Hi,
With 40*25 text mode there's a maximum of 1000 characters on the screen at a time, so worst case would be 510 unique characters and 490 characters that can't be displayed. If 250 of those characters are whitespace and 250 of them are used twice, then it works without any characters that can't be displayed properly. Also, if you halve the resolution (e.g. only use even columns, where odd columns always contain whitespace) then you'd always be able to display all characters.
However, it'd be a lot easier to just use graphics mode instead. This would give better results too. Creating 8 * 8 or 8 * 16 bitmap fonts is hard enough for ASCII characters without trying to adequately represent the fine brush-strokes of Chinese (you can't use anti-aliasing for text mode fonts, or 32 * 32 fonts).
Cheers,
Brendan
It might be theoretically possible to come slightly close - every time you draw a screen you find the 510 most frequently used characters, then auto-generate a new font that contains the 510 most frequently used characters. For the 2 remaining characters, one would be used for white-space. The last character would be a special "Sorry, can't display this properly at the moment" character.Combuster wrote:The limit of text mode is that you can have only 256 (or 512 if you want to do VGA-specific stuff) different characters max on your screen. How do you intend to cope with the fact that chinese (as I recall it) has much more characters than that?
With 40*25 text mode there's a maximum of 1000 characters on the screen at a time, so worst case would be 510 unique characters and 490 characters that can't be displayed. If 250 of those characters are whitespace and 250 of them are used twice, then it works without any characters that can't be displayed properly. Also, if you halve the resolution (e.g. only use even columns, where odd columns always contain whitespace) then you'd always be able to display all characters.
However, it'd be a lot easier to just use graphics mode instead. This would give better results too. Creating 8 * 8 or 8 * 16 bitmap fonts is hard enough for ASCII characters without trying to adequately represent the fine brush-strokes of Chinese (you can't use anti-aliasing for text mode fonts, or 32 * 32 fonts).
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: About video card text mode.
Combuster wrote:The limit of text mode is that you can have only 256 (or 512 if you want to do VGA-specific stuff) different characters max on your screen. How do you intend to cope with the fact that chinese (as I recall it) has much more characters than that?
I know that there is only 256 characters can be show in text mode,but the rule is set by someone who write and build it...
So I want to change it,and I just want to konw if it is possible.
oizys
Last edited by oizys on Fri Sep 12, 2008 8:49 am, edited 1 time in total.
Re: About video card text mode.
Brendan wrote:Hi,
It might be theoretically possible to come slightly close - every time you draw a screen you find the 510 most frequently used characters, then auto-generate a new font that contains the 510 most frequently used characters. For the 2 remaining characters, one would be used for white-space. The last character would be a special "Sorry, can't display this properly at the moment" character.Combuster wrote:The limit of text mode is that you can have only 256 (or 512 if you want to do VGA-specific stuff) different characters max on your screen. How do you intend to cope with the fact that chinese (as I recall it) has much more characters than that?
With 40*25 text mode there's a maximum of 1000 characters on the screen at a time, so worst case would be 510 unique characters and 490 characters that can't be displayed. If 250 of those characters are whitespace and 250 of them are used twice, then it works without any characters that can't be displayed properly. Also, if you halve the resolution (e.g. only use even columns, where odd columns always contain whitespace) then you'd always be able to display all characters.
However, it'd be a lot easier to just use graphics mode instead. This would give better results too. Creating 8 * 8 or 8 * 16 bitmap fonts is hard enough for ASCII characters without trying to adequately represent the fine brush-strokes of Chinese (you can't use anti-aliasing for text mode fonts, or 32 * 32 fonts).
Cheers,
Brendan
You are rigth,use graphics mode instead is much more simple.
I got a bin file of VIDEO ROM from my linux memroy by use "cat /proc/iomem" cmd,and I found there is a ASCII character bitmaps in it(sorry,I can't descrip it clearly by useing english).
Do you konw who will use these bitmaps,the video or the linux os,and how can I change it?
- Combuster
- 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: About video card text mode.
The VGA can either use one font bank (for a total of 256 character slots) or two (for a total of 512 character slots) and that's the limit for text mode, period.
So you either use one of the methods Brendan mentioned to try and have enough free slots to describe all, or better, use graphics mode (which is more straightforward than hacking at the font banks which essentially is a braindamaged graphics mode already)
[additional post made]
The font bank stored in the video rom contains the default font for when the system is booted and a font is needed. The only point for the OS to use it is, is for when it doesn't come with its own font and consequently wants to reuse the one coming with the video card. (Which will work pretty well if you only plan on using the first 128 entries), But since you want to print in Chinese, you'll have no use in grabbing an english character set from the graphics card.
So you either use one of the methods Brendan mentioned to try and have enough free slots to describe all, or better, use graphics mode (which is more straightforward than hacking at the font banks which essentially is a braindamaged graphics mode already)
[additional post made]
The font bank stored in the video rom contains the default font for when the system is booted and a font is needed. The only point for the OS to use it is, is for when it doesn't come with its own font and consequently wants to reuse the one coming with the video card. (Which will work pretty well if you only plan on using the first 128 entries), But since you want to print in Chinese, you'll have no use in grabbing an english character set from the graphics card.
Re: About video card text mode.
Hi,
I'm not sure of the exact method used to change the font data in the video card's RAM - for my OS I use graphics video modes only (even when I only need to display ASCII). I'd be tempted to try this video BIOS function though (and probably this one too)...
Cheers,
Brendan
The font data you found in the video card's ROM is copied to the video card's RAM and used as the default font whenever the video BIOS is used to set a text mode. It's extremely difficult to change the font data in ROM, but not that hard to change the font data after it's been copied into the video card's RAM.oizys wrote:I got a bin file of VIDEO ROM from my linux memroy by use "cat /proc/iomem" cmd,and I found there is a ASCII character bitmaps in it(sorry,I can't descrip it clearly by useing english).
Do you konw who will use these bitmaps,the video or the linux os,and how can I change it?
I'm not sure of the exact method used to change the font data in the video card's RAM - for my OS I use graphics video modes only (even when I only need to display ASCII). I'd be tempted to try this video BIOS function though (and probably this one too)...
Yes - it also let's you draw windows, icons, pictures, etc (everything that a modern OS needs to draw, not just characters)...oizys wrote:You are rigth,use graphics mode instead is much more simple.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.