Re: [Freedos-devel] changing keyboard layout

2020-12-12 Thread Ralf Quint

On 12/11/2020 7:57 AM, Bret Johnson wrote:
And none of this even addresses what happens if you try to print 
something to a printer since a printer "Code Page" doesn't necessarily 
match what's on the screen.  As long as you limit yourself to the 
first 128 ASCII codes you usually don't have problems.


Which is a problem for almost all people not using US English as their 
language...


German "umlauts", French and Spanish accented characters are all using 
codes above 128, regardless of the code pages involved... (OK, some 
pre-DOS printers were replacing certain characters <= ASCII 127 to print 
those, but for example in German, you were losing the brackets and 
braces in that case.)


Ralf



--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] changing keyboard layout

2020-12-12 Thread Aitor Santamaría
Hello Bret  (and the rest):

On Fri, 11 Dec 2020 at 17:00, Bret Johnson  wrote:

> The interaction between the screen (Code Page) and Keyboard is pretty
> critical so that everything is displayed correctly.  In addition to
> DISPLAY, DOS has other "utilities" like "CHCP", "MODE CON CODEPAGE
> PREPARE", and "MODE CON CODEPAGE SELECT" to manipulate the screen and it
> all must interact correctly with KEYB.  In addition, many (if not all) of
> the KEYB languages will work with two different screen Code Pages (a
> primary and an alternate) and must know what the current Code Page is to
> work correctly.  There are even ways to manipulate the screen so you can
> get 512 different characters instead of just 256.  It can be VERY confusing
> to set things up correctly, especially if you're using an "unusual"
> language.
>

It is indeed very complex. Actually, you should avoid "MODE CON CODEPAGE
SELECT", even if MS-DOS boot disk used this command. Using MODE CON CP
SELECT leaves kernel and CON device (i.e. screen+keyboard) misaligned.
I suppose Microsoft did so as they didn't want to get NLSFUNC to the
bootdisk (NLSFUNC adds this codepage aware functionality to kernel). And
because if you use COUNTRY=... in CONFIG.SYS, then you don't need NLSFUNC
(it is very unlikely that you'll want to change the codepage) and thus the
COUNTRY= and MODE CON CP SELECT works. They wouldn't care about printer's
codepage :)

The correct sequence would be:

load the nls functionality:
DISPLAY.SYS/.COM   (in CONFIG.SYS for MS-DOS, in AUTOEXEC for FreeDOS)
PRINTER.SYS (in CONFIG.SYS, MS-DOS only)
NLSFUNC

prepare all the devices for the codepages you want to use:
COUNTRY= ...  (in CONFIG.SYS)
MODE  CP PREPARE=...
MODE  CP PREPARE=...
MODE  CP PREPARE=...
...

And then, change the codepage everywhere at once with CHCP:
CHCP 850


> And none of this even addresses what happens if you try to print something
> to a printer since a printer "Code Page" doesn't necessarily match what's
> on the screen.  As long as you limit yourself to the first 128 ASCII codes
> you usually don't have problems.
>

This would be PRINTER.SYS' job.
I was tempted to write a PRINTER.SYS myself years ago, but I lack the
information of which printer commands are needed to load/prepare a codepage
(MODE CON CP) and how to select it. I guess this information is
printer-specific, and I don't know if it is compiled somewhere (links are
welcome :)).
I think MS-DOS  PRINTER.SYS will not work in FreeDOS (unless I missed
something), as MODE xxx CP SELECT is only implemented to interact with
FreeDOS' DISPLAY  (and I am not sure of how FreeDOS NLSFUNC is implemented,
whether it would do the GENIOCTL call for every character mode device.

Best wishes,
Aitor
___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] changing keyboard layout

2020-12-11 Thread Bret Johnson
>> * KEYB does not hook int 2Fh just for installation check. KEYB is
>> "codepage aware", as it has produce the appropriate character code
>> for that particular codepage (font), and that is why INT 2Fh/AD81h
>> exists: DISPLAY will call KEYB whenever there's a codepage change
>> request, so that KEYB keeps aligned with the current codepage.

> I wasn't aware of this. Thanks for correcting.

> Tom

The interaction between the screen (Code Page) and Keyboard is pretty critical 
so that everything is displayed correctly.  In addition to DISPLAY, DOS has 
other "utilities" like "CHCP", "MODE CON CODEPAGE PREPARE", and "MODE CON 
CODEPAGE SELECT" to manipulate the screen and it all must interact correctly 
with KEYB.  In addition, many (if not all) of the KEYB languages will work with 
two different screen Code Pages (a primary and an alternate) and must know what 
the current Code Page is to work correctly.  There are even ways to manipulate 
the screen so you can get 512 different characters instead of just 256.  It can 
be VERY confusing to set things up correctly, especially if you're using an 
"unusual" language. And none of this even addresses what happens if you try to 
print something to a printer since a printer "Code Page" doesn't necessarily 
match what's on the screen.  As long as you limit yourself to the first 128 
ASCII codes you usually don't have problems.

Sponsored by 
https://www.newser.com/?utm_source=part_medium=uol_campaign=rss_taglines_more

Utah Senator Blocks National Latino Museum
http://thirdpartyoffers.juno.com/TGL3141/5fd39730b41c217307c0ast02vuc1
'Brandon's Execution Is a Stain'
http://thirdpartyoffers.juno.com/TGL3141/5fd39730d826117307c0ast02vuc2
'Sometimes You Trip': COVID Vaccine Is Abandoned
http://thirdpartyoffers.juno.com/TGL3141/5fd397317e7d17307c0ast02vuc3___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] changing keyboard layout

2020-12-09 Thread Aitor Santamaría
No problem!

The original note that Matthias Paul wrote a long time ago was very
interesting, but a very long post too :)


On Wed, 9 Dec 2020 at 20:43, tom ehlert  wrote:

> > * KEYB does not hook int 2Fh just for installation check. KEYB is
> > "codepage aware", as it has produce the appropriate character code
> > for that particular codepage (font), and that is why INT 2Fh/AD81h
> > exists: DISPLAY will call KEYB whenever there's a codepage change
> > request, so that KEYB keeps aligned with the current codepage.
>
> I wasn't aware of this. Thanks for correcting.
>
> Tom
>
>
>
> ___
> Freedos-devel mailing list
> Freedos-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/freedos-devel
>
___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] changing keyboard layout

2020-12-09 Thread tom ehlert
> * KEYB does not hook int 2Fh just for installation check. KEYB is
> "codepage aware", as it has produce the appropriate character code
> for that particular codepage (font), and that is why INT 2Fh/AD81h
> exists: DISPLAY will call KEYB whenever there's a codepage change
> request, so that KEYB keeps aligned with the current codepage.

I wasn't aware of this. Thanks for correcting.

Tom



___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] changing keyboard layout

2020-12-09 Thread Aitor Santamaría
In addition to what Tom said (and regarding KEYB):
*   int 09 calls int 15h/4Fh is guaranteed for PC/ATs. For older keyboards
where it does not happen,  /9 option will hook the int9h handler to
precisely add this call to the present int9h handler.
* KEYB does not hook int 2Fh just for installation check. KEYB is "codepage
aware", as it has produce the appropriate character code for that
particular codepage (font), and that is why INT 2Fh/AD81h exists: DISPLAY
will call KEYB whenever there's a codepage change request, so that KEYB
keeps aligned with the current codepage.

Maybe you can find out more on this topic here:

'Re: [fd-dev] Changing codepages in FreeDOS' - MARC


Aitor


On Wed, 9 Dec 2020 at 19:40, tom ehlert  wrote:

>
> > After installing new layout and calling int 15h/4Fh manually,
> > causes correct scan code / ascii code pair is enqueued into the
> > keyboard buffer and carry flag isn't set because something is
> > changed this time. In short, this function is responsible for
> > changing keyboard layout, obviously. But how? I mean, how do
> > keyb.com know where exactly code page is in memory.
>
> KEYB doesn't know. AT ALL.
>
> KEYB translates scan codes (as transmitted form the keyboard) to
> 8 bit codes according to the keyboard language.
>
> ascii is the wrong term here.
> ASCII is defined (mostly) for the lower 128 of 256 characters, like
> the usual aAbBcB...zZ1..9.,;:...  that are common to most languages.
>
> as there is not enough space above 128 to have all possible russian,
> greek, spanish, indonesian, ...  codepages where invented.
>
> codepages assume a particular character set which differs for each
> language.
>
> most likely (I am no language expert) the code 0x31 will display
> identical (as '1') in all codepages, but 0x99 will display differently
> for greek and russian. it's probably best to think of 'codepages' as
> 'fonts'.
>
> Tom
>
>
>
> ___
> Freedos-devel mailing list
> Freedos-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/freedos-devel
>
___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


Re: [Freedos-devel] changing keyboard layout

2020-12-09 Thread tom ehlert


> After installing new layout and calling int 15h/4Fh manually,
> causes correct scan code / ascii code pair is enqueued into the
> keyboard buffer and carry flag isn't set because something is
> changed this time. In short, this function is responsible for
> changing keyboard layout, obviously. But how? I mean, how do
> keyb.com know where exactly code page is in memory.

KEYB doesn't know. AT ALL.

KEYB translates scan codes (as transmitted form the keyboard) to
8 bit codes according to the keyboard language.

ascii is the wrong term here.
ASCII is defined (mostly) for the lower 128 of 256 characters, like
the usual aAbBcB...zZ1..9.,;:...  that are common to most languages.

as there is not enough space above 128 to have all possible russian,
greek, spanish, indonesian, ...  codepages where invented.

codepages assume a particular character set which differs for each
language.

most likely (I am no language expert) the code 0x31 will display
identical (as '1') in all codepages, but 0x99 will display differently
for greek and russian. it's probably best to think of 'codepages' as
'fonts'.

Tom



___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel


[Freedos-devel] changing keyboard layout

2020-12-09 Thread Bora Akaydin via Freedos-devel

Hi everybody, 
I would like to know what things are happening in the background when I change 
keyboard layout in FreeDOS. 

Normally, each time I press a key int 09 is called as a consequence of irq 1 
and int 09 calls int 15h/4Fh, which has no effect when no layout is installed. 
So, if it is called sets carry flag on return when nothing changed. I read the 
source of keyb.com (I noticed, I had become quite rusty with Pascal) and found 
out it hooks to int 15h in order to take possession of 4Fh function. It 
additionally hooks to int 2Fh as well as int 16h. From my understanding, 
hooking to 2Fh is just for 0AD80h function (keyb.com installation check), 
please correct me if I am wrong. I did not understand why int 16h is changed. 

After installing new layout and calling int 15h/4Fh manually, causes correct 
scan code / ascii code pair is enqueued into the keyboard buffer and carry flag 
isn't set because something is changed this time. In short, this function is 
responsible for changing keyboard layout, obviously. But how? I mean, how do 
keyb.com know where exactly code page is in memory. And how does this whole 
mechanism work? (In case it is long to explain, please point me a document for 
that if possible). 

Any help would be appreciated. 

Kind regards,
Bora Akaydin___
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel