Page 1 of 2
Keyboard help
Posted: Mon Mar 07, 2005 12:55 pm
by ribas
i've tried to program my keyboard driver ... it works fine in US layout i presume, but i'm from Portugal so i modified the code i?ve found to be able to work with my keyboard .. all ok except for symbols like ( ? , ?, ?, ? ,?) and accents ?`? ... i send the right code ( i think ..) but for these i only get a dummy space with white background. if anyone knows hot to fix this, please help ....
The keyboard driver works fine without these key but i would like to make it work from the beginning (maybe a bios problem .. i really don't know). Thanks.
Ribas
Re:Keyboard help
Posted: Mon Mar 07, 2005 1:05 pm
by bubach
You cant just type in those characters in your char-table from windows.. Add these chars from a DOS editor or write the ASCII values by hand, like "a", 148, "bcde" etc....
All ASCII supported values can be found at:
http://www.lookuptables.com/
If you need support for other characters you would have to implement UTF-8 or similar.
Re:Keyboard help
Posted: Mon Mar 07, 2005 1:17 pm
by Candy
As bubach said, those characters don't exist. They're a figment of Microsoft's imagination.
Make a new character set other than ASCII (which you're now using and in which they don't exist) and use that for printing. You might need graphical modes.
Re:Keyboard help
Posted: Mon Mar 07, 2005 1:22 pm
by ribas
ok. i'm going to keep it this way just for testing .. anyway i want to go to svga mode and use bitmap fonts (i think this is possible), anyone knows where to find some info on bmp fonts, and how to switch to vga mode im pm mode??
thanks guys
Re:Keyboard help
Posted: Mon Mar 07, 2005 1:23 pm
by bubach
But most of them does exist.. I think that even ? is implemented in newer BIOS's (by the loss of some other not as used char.)
For example:
Code: Select all
` = ASCII value 96 dec.
? = ASCII value 144 dec.
? = ASCII value 175 dec.
Re:Keyboard help
Posted: Mon Mar 07, 2005 1:31 pm
by bubach
VGA modes can be switched to by registers.
SVGA modes are interfaced though the VESA standard and can be set by BIOS interrupt 0x10.
For that you will need code that can jump between 16- and 32-bit mode, or a VM86 monitor.
/ Christoffer
Re:Keyboard help
Posted: Mon Mar 07, 2005 1:34 pm
by ribas
thanks bubach .. now it prints the chars but i think i've to change the text mode cause all these chars change my text colour and background attributes ... i think i'm messing with some video memory.
Re:Keyboard help
Posted: Mon Mar 07, 2005 6:39 pm
by mystran
bubach wrote:
But most of them does exist.. I think that even ? is implemented in newer BIOS's (by the loss of some other not as used char.)
For example:
Code: Select all
` = ASCII value 96 dec.
? = ASCII value 144 dec.
? = ASCII value 175 dec.
ASCII is 7-bit and anything beyond 128 dec is not ASCII. Most definitely it also won't be the same values between computers in different countries (most of western europe+USA being main exception with Latin1), unless one agrees to use Unicode instead.
Re:Keyboard help
Posted: Tue Mar 08, 2005 12:46 am
by Brendan
Hi,
mystran wrote:
ASCII is 7-bit and anything beyond 128 dec is not ASCII. Most definitely it also won't be the same values between computers in different countries (most of western europe+USA being main exception with Latin1), unless one agrees to use Unicode instead.
Can someone confirm this?
I assumed that (even though ASCII is 7 bit) the standard IBM screen display codes are 8 bit and are used as the default for all text video modes and BIOS character fonts. I also thought DOS used to be able to change the default character set to support different languages (for e.g. "
MODE device CP SELECT=yyy").
I was hoping to convert Unicode into screen display codes for any character that has a "close enough" equivelent. If screen display codes aren't standard then I'll need to create my own "standard" character data
.
Cheers,
Brendan
Re:Keyboard help
Posted: Tue Mar 08, 2005 12:54 am
by Candy
Brendan wrote:
mystran wrote:
ASCII is 7-bit and anything beyond 128 dec is not ASCII. Most definitely it also won't be the same values between computers in different countries (most of western europe+USA being main exception with Latin1), unless one agrees to use Unicode instead.
Can someone confirm this?
Confirmed hereby. However, the limit is strictly speaking 127, whereas char 128 is not existant.
I assumed that (even though ASCII is 7 bit) the standard IBM screen display codes are 8 bit and are used as the default for all text video modes and BIOS character fonts. I also thought DOS used to be able to change the default character set to support different languages (for e.g. "MODE device CP SELECT=yyy").
They load a new "font" for the upper 128 blocks to do so. Mode does not function without the codepages on disk somewhere.
I was hoping to convert Unicode into screen display codes for any character that has a "close enough" equivelent. If screen display codes aren't standard then I'll need to create my own "standard" character data
.
No. You cannot squeeze more than a million characters in 256 (or 512) character spaces. You very much need graphical displays.
Re:Keyboard help
Posted: Tue Mar 08, 2005 2:03 am
by Brendan
Hi,
Candy wrote:Confirmed hereby. However, the limit is strictly speaking 127, whereas char 128 is not existant.
My original question was poorly worded. Specifically, if I had this code in a boot sector:
Code: Select all
mov cx,128
mov al,128
mov ah,0x0F
mov es,0xB800
mov di,0
cld
.l1:
stosw
inc al
loop .l1
Would it display the same results on every computer (assuming the BIOS starts the boot sector in text mode)?
I'm not talking ASCII here, but "standard IBM screen display codes"...
Candy wrote:I was hoping to convert Unicode into screen display codes for any character that has a "close enough" equivelent. If screen display codes aren't standard then I'll need to create my own "standard" character data
.
No. You cannot squeeze more than a million characters in 256 (or 512) character spaces. You very much need graphical displays.
Sure you can - you just end up with a lot of '?' characters
.
For example, the Unicode strings "f?vrier", "M?rz" and "vas?rnap" (French "February", German "March" and Hungarian "Sunday" respectively) can hopefully all be represented with standard IBM screen display codes (or text video modes), even though it can't be done with strict ASCII.
Something like "Կիրակի" (Armenian "Sunday") or "日曜日" (Japanese "Sunday") would end up being "??????" or "???" because these characters can't be displayed.
Cheers,
Brendan
Re:Keyboard help
Posted: Tue Mar 08, 2005 2:15 am
by Candy
Why do I have the feeling that ???? ?? ???? ? ?? ?????? ???? ?????? is not going to help japanese people use your OS?
Re:Keyboard help
Posted: Tue Mar 08, 2005 3:23 am
by Brendan
Hi,
Candy wrote:
Why do I have the feeling that ???? ?? ???? ? ?? ?????? ???? ?????? is not going to help japanese people use your OS?
You're right - there's many languages that can't be displayed in text mode regardless of what I do. Then there's many languages that will benefit from this in varying degrees (French, German, Hungarian, Greek, etc).
There's also cases where languages are mixed - "The vistor said '????? ???? ????' before riding his horse into the night.".
Anyway, it's better than displaying '?' for anything that's not strict ASCII...
Cheers,
Brendan
Re:Keyboard help
Posted: Tue Mar 08, 2005 7:12 am
by bubach
I'm not talking ASCII here, but "standard IBM screen display codes"...
Hmm.. From 127-255 is "Extended ASCII" which is the same on all computers I ever seen at bootup. It can be changed, but that is mostly done by the OS after bootup by changing the font.
-
http://www.webopedia.com/TERM/E/extended_ASCII.html
Re:Keyboard help
Posted: Tue Mar 08, 2005 8:26 am
by Brendan
Hi,
bubach wrote:
I'm not talking ASCII here, but "standard IBM screen display codes"...
Hmm.. From 127-255 is "Extended ASCII" which is the same on all computers I ever seen at bootup. It can be changed, but that is mostly done by the OS after bootup by changing the font.
-
http://www.webopedia.com/TERM/E/extended_ASCII.html
That's them!
There's actually 31 more of them (from 0x01 to 0x1F) - for e.g. "mov [0x000B8000],0x0A" will give you a reversed circle, where in ASCII it's a control code (linefeed).
I've never seen a computer that doesn't have these characters either (not that I'd expect to find one in South Australia). I guess/hope that no-one has created any variations on this..
Cheers,
Brendan