[PATCH] devc-con for Japanese 106 keyboard

bridged with qdn.public.qnxrtp.x86
Post Reply
Guest

[PATCH] devc-con for Japanese 106 keyboard

Post by Guest » Tue Jan 08, 2002 5:36 am

The distributed devc-con only provides US-101 keyboard mapping
for consoles, so I've patched it up to Japanese-106 keyboard.

Apply this patch to the Character DDK and recompile.
*Using* this devc-con under usual "diskboot" (ie qnxbase.ifs)
environment is the tricky part, so I'll post it in the separate article.

Note you don't need this under Photon environment.
(I don't think anyone besides me reading qdn.* uses this anyway...)
--
kabe

Index: devc/con/intr.c
===================================================================
RCS file: /home/kabe/CVSROOT/hardware/devc/con/intr.c,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.5
diff -u -r1.1.1.1 -r1.1.1.1.2.5
--- devc/con/intr.c 2001/03/24 18:17:43 1.1.1.1
+++ devc/con/intr.c 2002/01/04 21:07:09 1.1.1.1.2.5
@@ -149,49 +149,79 @@
/*
* Base codes
*/
-static unsigned short kbtable[5*96] ={
+/*
+ * Changed around for Japanese 106 type keyboard
+ */
+#define KBTABSIZE 0x80
+static unsigned short kbtable[5*KBTABSIZE] ={
0x8000,0x001B,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036, /* 00 */
- 0x0037,0x0038,0x0039,0x0030,0x002D,0x003D,0x007F,0x0009,
+ 0x0037,0x0038,0x0039,0x0030,0x002D, '^',0x007F,0x0009,
0x2071,0x2077,0x2065,0x2072,0x2074,0x2079,0x2075,0x2069, /* 10 */
- 0x206F,0x2070,0x005B,0x005D,0x000D,0x0202,0x2061,0x2073,
+ 0x206F,0x2070, '@', '[',0x000D,0x0202,0x2061,0x2073,
0x2064,0x2066,0x2067,0x2068,0x206A,0x206B,0x206C,0x003B, /* 20 */
- 0x0027,0x0060,0x0201,0x005C,0x207A,0x2078,0x2063,0x2076,
+ ':',0x001B,0x0201, ']',0x207A,0x2078,0x2063,0x2076,
0x2062,0x206E,0x206D,0x002C,0x002E,0x002F,0x0208,0x002A, /* 30 */
- 0x0204,0x0020,0x0804,0x0181,0x0182,0x0183,0x0184,0x0185,
+ 0x0204,0x0020,0x0202,0x0181,0x0182,0x0183,0x0184,0x0185,
0x0186,0x0187,0x0188,0x0189,0x018A,0x0802,0x0801,0x05A0, /* 40 */
0x05A1,0x05A2,0x05A3,0x05A4,0x05A5,0x05A6,0x05A7,0x05A8,
0x05A9,0x05AA,0x05AB,0x05AC,0x8000,0x8000,0x8000,0x01AE, /* 50 */
0x01AF,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+/* Japanese-106 additional codes:
+ * 0x29 Hankaku/Zenkaku (map Esc for now)
+ * 0x70 Hiragana/Katakana (map invalid)
+ * 0x73 Backslash/Underbar
+ * 0x79 Henkan/MaeKouho (map space)
+ * 0x7B Muhenkan (map space)
+ * 0x7D Yen/Verticalbar
+ *
+ * Note that this keyboard's scancode generates above 0x60.
+ *
+ * Other maps:
+ * Shift-Capslock mapped to CapsLock
+ * plain Capslock mapped to Ctrl
+ */
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000, /* 60 */
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000, '\\',0x8000,0x8000,0x8000,0x8000, /* 70 */
+ 0x8000, ' ',0x8000, ' ',0x8000, '\\',0x8000,0x8000,
/*
* Shift codes
*/
- 0x8000,0x001B,0x0021,0x0040,0x0023,0x0024,0x0025,0x005E, /* 00 */
- 0x0026,0x002A,0x0028,0x0029,0x005F,0x002B,0x01FC,0x0180,
+ 0x8000,0x001B,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026, /* 00 */
+ 0x0027,0x0028,0x0029, '~', '=', '~',0x01FC,0x0180,
0x2051,0x2057,0x2045,0x2052,0x2054,0x2059,0x2055,0x2049, /* 10 */
- 0x204F,0x2050,0x007B,0x007D,0x01E0,0x0202,0x2041,0x2053,
- 0x2044,0x2046,0x2047,0x2048,0x204A,0x204B,0x204C,0x003A, /* 20 */
- 0x0022,0x007E,0x0201,0x007C,0x205A,0x2058,0x2043,0x2056,
+ 0x204F,0x2050, '`', '{',0x01E0,0x0202,0x2041,0x2053,
+ 0x2044,0x2046,0x2047,0x2048,0x204A,0x204B,0x204C, '+', /* 20 */
+ '*',0x001B,0x0201, '}',0x205A,0x2058,0x2043,0x2056,
0x2042,0x204E,0x204D,0x003C,0x003E,0x003F,0x0208,0x01AD, /* 30 */
- 0x0204,0x0020,0x8000,0x018B,0x018C,0x018D,0x018E,0x018F,
+ 0x0204,0x0020,0x0804,0x018B,0x018C,0x018D,0x018E,0x018F,
0x0190,0x0191,0x0192,0x0193,0x0194,0x8000,0x8000,0x0437, /* 40 */
0x0438,0x0439,0x042D,0x0434,0x0435,0x0436,0x042B,0x0431,
0x0432,0x0433,0x0430,0x042E,0x8000,0x8000,0x8000,0x01DB, /* 50 */
0x01DC,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000, /* 60 */
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000, '_',0x8000,0x8000,0x8000,0x8000, /* 70 */
+ 0x8000, ' ',0x8000, ' ',0x8000, '|',0x8000,0x8000,
/*
* Cntl codes
*/
- 0x8000,0x001B,0x8000,0x0000,0x8000,0x8000,0x8000,0x001E, /* 00 */
- 0x8000,0x8000,0x8000,0x8000,0x001F,0x8000,0x01DE,0x019F,
+ 0x8000,0x001B,0x8000,0x1022,0x8000,0x8000,0x8000,0x001E, /* 00 */
+ 0x1027,0x8000,0x8000,0x8000,0x8000,0x105E,0x01DE,0x019F,
0x0011,0x0017,0x0005,0x0012,0x0014,0x0019,0x0015,0x0009, /* 10 */
- 0x000F,0x0010,0x001B,0x001D,0x01D0,0x0202,0x0001,0x0013,
+ 0x000F,0x0010,0x0000,0x001B,0x01D0,0x0202,0x0001,0x0013,
0x0004,0x0006,0x0007,0x0008,0x000A,0x000B,0x000C,0x8000, /* 20 */
- 0x1027,0x8000,0x0201,0x001C,0x001A,0x0018,0x0003,0x0016,
+ 0x8000,0x8000,0x0201,0x001D,0x001A,0x0018,0x0003,0x0016,
0x0002,0x000E,0x000D,0x8000,0x8000,0x8000,0x0208,0x01BD, /* 30 */
- 0x0204,0x0020,0x8000,0x0195,0x0196,0x0197,0x0198,0x0199,
+ 0x0204,0x0020,0x0202,0x0195,0x0196,0x0197,0x0198,0x0199,
0x019A,0x019B,0x019C,0x019D,0x019E,0x8000,0x4012,0x01B0, /* 40 */
0x01B1,0x01B2,0x01B3,0x01B4,0x01B5,0x01B6,0x01B7,0x01B8,
0x01B9,0x01BA,0x01BB,0x01BC,0x8000,0x8000,0x8000,0x01BE, /* 50 */
0x01BF,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000, /* 60 */
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000,0x001C,0x8000,0x8000,0x8000,0x8000, /* 70 */
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x001C,0x8000,0x8000,
/*
* Alt codes
*/
@@ -202,26 +232,34 @@
0x01E4,0x01E6,0x01E7,0x01E8,0x01EA,0x01EB,0x01EC,0x8000, /* 20 */
0x8000,0x8000,0x0201,0x8000,0x01FA,0x01F8,0x01E3,0x01F6,
0x01E2,0x01EE,0x01ED,0x8000,0x8000,0x8000,0x0208,0x01CD, /* 30 */
- 0x0204,0x8000,0x8000,0x01D1,0x01D2,0x01D3,0x01D4,0x01D5,
+ 0x0204,0x8000,0x0202,0x01D1,0x01D2,0x01D3,0x01D4,0x01D5,
0x01D6,0x01D7,0x01D8,0x01D9,0x01DA,0x8000,0x8000,0x01C0, /* 40 */
0x01C1,0x01C2,0x01C3,0x01C4,0x01C5,0x01C6,0x01C7,0x01C8,
0x01C9,0x01CA,0x01CB,0x01CC,0x01DD,0x8000,0x8000,0x01CE, /* 50 */
0x01CF,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000, /* 60 */
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000, /* 70 */
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
/*
* Ctl-Alt codes
*/
0x8000,0x4002,0x4005,0x4006,0x4007,0x4008,0x4009,0x400A, /* 00 */
0x400B,0x400C,0x400D,0x400E,0x8000,0x8000,0x4004,0x8000,
0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000, /* 10 */
- 0x8000,0x8000,0x8000,0x8000,0x4003,0x0202,0x8000,0x8000,
+ 0x8000,0x8000,0x1060,0x8000,0x4003,0x0202,0x8000,0x8000,
0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000, /* 20 */
0x8000,0x8000,0x0201,0x8000,0x8000,0x8000,0x8000,0x8000,
0x8000,0x8000,0x8000,0x4010,0x400F,0x4011,0x0208,0x4020, /* 30 */
- 0x0204,0x8000,0x8000,0x4021,0x4022,0x4023,0x4024,0x4025,
+ 0x0204,0x8000,0x0202,0x4021,0x4022,0x4023,0x4024,0x4025,
0x4026,0x4027,0x4028,0x4029,0x402A,0x8000,0x8000,0x8000, /* 40 */
0x8000,0x8000,0x4004,0x8000,0x8000,0x8000,0x4003,0x8000,
0x8000,0x8000,0x8000,0x4001,0x4020,0x8000,0x8000,0x8000, /* 50 */
0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000, /* 60 */
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000, /* 70 */
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
};

static unsigned short *kb_base = &kbtable[0];
@@ -566,13 +604,13 @@
{
if( flag & KB_ALT) {
if( flag & KB_CTL)
- return(&kbtable[4*96]); /* Ctl + Alt */
- return(&kbtable[3*96]); /* Alt */
+ return(&kbtable[4*KBTABSIZE]); /* Ctl + Alt */
+ return(&kbtable[3*KBTABSIZE]); /* Alt */
}
if( flag & KB_CTL)
- return(&kbtable[2*96]); /* Ctl */
+ return(&kbtable[2*KBTABSIZE]); /* Ctl */
if( flag & KB_SHIFT)
- return(&kbtable[1*96]); /* Shift */
+ return(&kbtable[1*KBTABSIZE]); /* Shift */
return(&kbtable[0]); /* Normal */
}

@@ -665,28 +703,34 @@
key = *(kb_base + c);
op = (key >> 8);

- if( c >= 0x60 ) {
+ if( c >= KBTABSIZE ) {
/*
- * Process special codes
+ * Ignore all other codes
+ * (KBTABSIZE==0x80, so no-op here...)
*/
- if( s == 0xFA ) {
- /*
- * A received ACK from keyboard allows us to
- * send another byte from the transmit queue
- */
- rcv_ack();
- goto done;
- }
- if( s == 0xE0 ) {
- /*
- * Extended scan-code follows
- */
- kbflag &= ~KB_EXTENDED;
- kbflag |= KB_EXT_ARM;
- goto done;
- }
+ goto done;
+ }
+
+ if( s == 0xFA ) {
/*
- * Ignore all other codes
+ * A received ACK from keyboard allows us to
+ * send another byte from the transmit queue
+ */
+ rcv_ack();
+ goto done;
+ }
+ if( s == 0xE0 ) {
+ /*
+ * Extended scan-code follows
+ */
+ kbflag &= ~KB_EXTENDED;
+ kbflag |= KB_EXT_ARM;
+ goto done;
+ }
+
+ if( op == 0x80 ) {
+ /*
+ * Ignore invalid key
*/
goto done;
}

Guest

Testing out custom devc-con

Post by Guest » Sat Jan 12, 2002 7:37 pm

Now you've got your devc-con with your favorite fitouts,
it's time to have a test drive....

For standard RTP installation using "diskboot" as startup-script final,
it is easy to test out a custom disk drivers,
as they are read from /proc/boot/; you just include them in the
*.ifs and off you go.

But "devc-con" (and "fs-pkg") are the exception.
As you notice by the "pidin -f n" output, these two are
directly invoked from /pkgs/base repository directory.
(Dumping the *.ifs you will also notice these are NOT included)
So, just including the custom "devc-con" as /proc/boot/devc-con
won't work.

Just replacing /x86/sbin/devc-con also won't work, as replacement here will
only be handled as a /var/pkg/spill. Remember devc-con is
directly invoked from /pkgs/base/ .

These devc-con and fs-pkg are invoked directly by "diskboot".
"diskboot" scans and spawns disk drivers, mounts root, then
invokes devc-con (sbin/devc-con) as

(1) Dig through /etc/system/package/packages for lines looking like
<...>qnx/os/...../x86<...>
ex. "<QPF:subitem>qnx/os/drivers-2.1.2/x86</QPF:subitem>"
(take this as $bindir)

(2) Search in the following paths, and spawn the first one found
/pkgs/repository/$bindir/sbin/devc-con
/pkgs/base/$bindir/sbin/devc-con
/proc/boot/devc-con

(3) repeat (1) until /etc/system/package/packages exhaust

(4) "Unable to start devc-con"; halt


Although there are no provisions built in "diskboot" to use
a custom devc-con, you can hook somewhere in this process
to let it use yours.

Method1:
Place your devc-con as
/pkgs/repository/qnx/os/drivers-2.1.2/x86/sbin/devc-con
(makes first path in step(2) match)

Method2:
Mount the /boot/fs/qnxbase.qfs read-write, then
replace the stock
/pkgs/base/qnx/os/drivers-2.1.2/x86/sbin/devc.con .

Method3:
Mount the /boot/fs/qnxbase.qfs read-write, and
erase the stock
/pkgs/base/qnx/os/drivers-2.1.2/x86/sbin/devc.con .
Then, include your devc-con as /proc/boot/devc-con .
(make step(2) fall to /proc/boot)

Method4:
Insert a fake path somewhere at beginning of
/etc/system/package/packages which points to /proc/boot, like
<QPF:dummy>qnx/os/../../../../proc/boot/x86</QPF:dummy>
(make step(1) look at /proc/boot first)
"qnx/os" and "/x86" is required by the "diskboot" search algorithm.
Then insert your devc-con as /proc/boot/x86/sbin/devc-con .
(W: not /proc/boot/devc-con)

"diskboot" doesn't support devc-con replacement, so nontheless
these are a hack and there's no "right way".

Of course there are pros and cons for each method. Criterion:

* Booting by the stock qnxbase.ifs possible?
* Reverting to stock devc-con easy (in case yours failed)?

* Output of "pidin -f n" neat?
* Portable on RTP upgrade?

Method1 (using /pkgs/repository)
pros: The easiest way.
Bootable by stock *.ifs
cons: Modified devc-con is ALWAYS used; if it fails, you have to
floppy/CD boot to fix.
The pathname looks so "QNX-official" which is confusing.

Method2 (replace /pkgs/base/.../devc-con)
pros: (nothing?)
cons: Modified devc-con is ALWAYS used; if it fails, you have to
floppy/CD boot to fix.
The pathname is so "QNX-official" which is confusing.

Method3 (erase /pkgs/base/..../devc-con, use /proc/boot/devc-con)
pros: Easy to re-install the devc-con, as you'll compile-try-error
numerous times.
pidin output is the neatest.
cons: Cannot boot by stock *.ifs (no devc-con)
(preparing one is easy tho)

Method4 (qnx/os/../../../../proc/boot)
pros: Bootable by stock *.ifs, which uses stock devc-con.
Easy to reinstall new devc-con.
Most configurable; the dummy line doesn't have to point
to /proc/boot, but anywhere within pre-fs-pkg filesystem.
cons: Most vulnerable to "diskboot" logic change.
pidin output is ugly.
Installing something by the pkg-installer regenerates
/etc/system/package/packages, so you have to
add the dummy line again.


What I chose was Method4, which was easy to try-and-error the new driver.

--
kabe

Bill Caroselli

Re: Testing out custom devc-con

Post by Bill Caroselli » Sat Jan 12, 2002 8:49 pm

It is not too difficult to build an ifs that doesn't use distboot. Just
load all of your drivers yourself manually in and from the boot image.

Or am I missing something?

--
Bill Caroselli -- 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net


<kabe@sra-tohoku.co.jp> wrote in message news:a1q39d$a3m$1@inn.qnx.com...
Now you've got your devc-con with your favorite fitouts,
it's time to have a test drive....

For standard RTP installation using "diskboot" as startup-script final,
it is easy to test out a custom disk drivers,
as they are read from /proc/boot/; you just include them in the
*.ifs and off you go.

But "devc-con" (and "fs-pkg") are the exception.
As you notice by the "pidin -f n" output, these two are
directly invoked from /pkgs/base repository directory.
(Dumping the *.ifs you will also notice these are NOT included)
So, just including the custom "devc-con" as /proc/boot/devc-con
won't work.

Just replacing /x86/sbin/devc-con also won't work, as replacement here
will
only be handled as a /var/pkg/spill. Remember devc-con is
directly invoked from /pkgs/base/ .

These devc-con and fs-pkg are invoked directly by "diskboot".
"diskboot" scans and spawns disk drivers, mounts root, then
invokes devc-con (sbin/devc-con) as

(1) Dig through /etc/system/package/packages for lines looking like
...>qnx/os/...../x86<...
ex. "<QPF:subitem>qnx/os/drivers-2.1.2/x86</QPF:subitem>"
(take this as $bindir)

(2) Search in the following paths, and spawn the first one found
/pkgs/repository/$bindir/sbin/devc-con
/pkgs/base/$bindir/sbin/devc-con
/proc/boot/devc-con

(3) repeat (1) until /etc/system/package/packages exhaust

(4) "Unable to start devc-con"; halt


Although there are no provisions built in "diskboot" to use
a custom devc-con, you can hook somewhere in this process
to let it use yours.

Method1:
Place your devc-con as
/pkgs/repository/qnx/os/drivers-2.1.2/x86/sbin/devc-con
(makes first path in step(2) match)

Method2:
Mount the /boot/fs/qnxbase.qfs read-write, then
replace the stock
/pkgs/base/qnx/os/drivers-2.1.2/x86/sbin/devc.con .

Method3:
Mount the /boot/fs/qnxbase.qfs read-write, and
erase the stock
/pkgs/base/qnx/os/drivers-2.1.2/x86/sbin/devc.con .
Then, include your devc-con as /proc/boot/devc-con .
(make step(2) fall to /proc/boot)

Method4:
Insert a fake path somewhere at beginning of
/etc/system/package/packages which points to /proc/boot, like
QPF:dummy>qnx/os/../../../../proc/boot/x86</QPF:dummy
(make step(1) look at /proc/boot first)
"qnx/os" and "/x86" is required by the "diskboot" search algorithm.
Then insert your devc-con as /proc/boot/x86/sbin/devc-con .
(W: not /proc/boot/devc-con)

"diskboot" doesn't support devc-con replacement, so nontheless
these are a hack and there's no "right way".

Of course there are pros and cons for each method. Criterion:

* Booting by the stock qnxbase.ifs possible?
* Reverting to stock devc-con easy (in case yours failed)?

* Output of "pidin -f n" neat?
* Portable on RTP upgrade?

Method1 (using /pkgs/repository)
pros: The easiest way.
Bootable by stock *.ifs
cons: Modified devc-con is ALWAYS used; if it fails, you have to
floppy/CD boot to fix.
The pathname looks so "QNX-official" which is confusing.

Method2 (replace /pkgs/base/.../devc-con)
pros: (nothing?)
cons: Modified devc-con is ALWAYS used; if it fails, you have to
floppy/CD boot to fix.
The pathname is so "QNX-official" which is confusing.

Method3 (erase /pkgs/base/..../devc-con, use /proc/boot/devc-con)
pros: Easy to re-install the devc-con, as you'll compile-try-error
numerous times.
pidin output is the neatest.
cons: Cannot boot by stock *.ifs (no devc-con)
(preparing one is easy tho)

Method4 (qnx/os/../../../../proc/boot)
pros: Bootable by stock *.ifs, which uses stock devc-con.
Easy to reinstall new devc-con.
Most configurable; the dummy line doesn't have to point
to /proc/boot, but anywhere within pre-fs-pkg filesystem.
cons: Most vulnerable to "diskboot" logic change.
pidin output is ugly.
Installing something by the pkg-installer regenerates
/etc/system/package/packages, so you have to
add the dummy line again.


What I chose was Method4, which was easy to try-and-error the new driver.

--
kabe

Guest

Re: Testing out custom devc-con

Post by Guest » Sun Jan 13, 2002 3:37 pm

It is not too difficult to build an ifs that doesn't use distboot. Just
load all of your drivers yourself manually in and from the boot image.

Or am I missing something?
You're throwing out of the window the filesystem automount features.
Everybody knows "diskboot" is overloaded but nobody seems to
look at its good points..

Yes, if you're sure you won't change drivers and disks configs much,
invoking drivers manually isn't much trouble.

I guess startup-script can't do "if" branches--another reason
for custom proggy like "diskboot".

ed1k

Re: Testing out custom devc-con

Post by ed1k » Mon Jan 14, 2002 11:16 am

kabe@sra-tohoku.co.jp wrote in article <a1s9ki$n8h$1@inn.qnx.com>...
It is not too difficult to build an ifs that doesn't use distboot. Just
load all of your drivers yourself manually in and from the boot image.

Or am I missing something?

You're throwing out of the window the filesystem automount features.
Kabe, I wrote the small C program which looks through /dev and mounts my dos filesystems, since I
have removable HDD. You could look at first version of automnt in thread
Subject: Re: New fat bug in diskboot
Date: 6 Dec 2001 09:52:52 GMT
Xref: inn.qnx.com qdn.public.qnxrtp.os:6291

I forgot about fat32 fs at that moment, but you could modify the source for your needs. I include
this program in image after devb-eide with automount options. But now I use /etc/fstab file for
apriory knowen fs (qnx root and cd), and automnt finds only dos partitions.
For fstab file look at
Subject: devb-eide automount option ??
Date: 10 Dec 2001 12:31:19 GMT
Xref: inn.qnx.com qdn.public.qnxrtp.os:6352

I still don't know about how file names formed by diskboot for dos partitions if there is fat16 and
fat32 partitions on disk. So I use my method. Also I lost disk controller detection ;-(, my image
works only with IDE (of course, you can include any driver instead of devb-eide, but you have to
know which one)

Your message above appreciated by me ;) thanks
Best regards,
Eduard.

Everybody knows "diskboot" is overloaded but nobody seems to
look at its good points..

Yes, if you're sure you won't change drivers and disks configs much,
invoking drivers manually isn't much trouble.

I guess startup-script can't do "if" branches--another reason
for custom proggy like "diskboot".

Guest

[PATCH] devc-con for Japanese 106 keyboard (2)

Post by Guest » Mon Dec 23, 2002 11:52 am

The distributed devc-con only provides US-101 keyboard mapping
for consoles, so I've patched it up for Japanese-106 keyboard.

Apply this patch to the 6.1 Character DDK and recompile.
Binary does work for 6.2 too.

Changes from previous post:
Doing "make" in devc/package/ will make a *.qpr.
You can just install this *.qpr and it works under diskboot;
no longer need to muck with *.ifs or /etc/system/package/packages.

It should be cheesy to modify for french, german etc keyboards too.


Note you don't need this if you only use keyboards under Photon.
(I don't think anyone besides me reading qdn.* uses this anyway...)
--
kabe

Index: devc-con-jp/devc/CHANGES
diff -u /dev/null devc-con-jp/devc/CHANGES:1.3
--- /dev/null Mon Dec 23 20:41:43 2002
+++ devc-con-jp/devc/CHANGES Mon Dec 23 20:39:11 2002
@@ -0,0 +1,27 @@
+==== Changes from RELEASE_6_1_0 ===
+
+* Remapped keycodes for Japanese 106 keyboard.
+ As jp keyboards have nearly 128 scancodes, scan code table
+ was expanded to maximum.
+* CapsLock will be Ctrl/CapsLock.
+* Henkan/MaeKouho is mapped to BackSpace/Delete rather than nothing.
+* added package/ directory to make a *.qpr package.
+
+==== TAGS ====
+QNX
+RELEASE_6_1_0
+ original, devc-con subset
+
+JP106_STD
+ standard mappings, muhenkan/henkan mapped to space
+ capslock mapped to ctrl
+
+JP106_KLUDGEPAK
+ Kludgy package/Makefile to generate qnx/os/jp106-1.0 installation
+
+====== TODO ====
+
+====== memo ====
+package should be created as .../x86/sbin/devc-con,
+not /sbin/devc-con-jp106, as diskboot will always scan for /sbin/devc-con
+
Index: devc-con-jp/devc/con/intr.c
diff -u devc-con-jp/devc/con/intr.c:1.1.1.1 devc-con-jp/devc/con/intr.c:1.3
--- devc-con-jp/devc/con/intr.c:1.1.1.1 Thu Dec 19 03:31:41 2002
+++ devc-con-jp/devc/con/intr.c Thu Dec 19 04:10:58 2002
@@ -149,49 +149,79 @@
/*
* Base codes
*/
-static unsigned short kbtable[5*96] ={
+/*
+ * Changed around for Japanese 106 type keyboard
+ */
+#define KBTABSIZE 0x80
+static unsigned short kbtable[5*KBTABSIZE] ={
0x8000,0x001B,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036, /* 00 */
- 0x0037,0x0038,0x0039,0x0030,0x002D,0x003D,0x007F,0x0009,
+ 0x0037,0x0038,0x0039,0x0030,0x002D, '^',0x007F,0x0009,
0x2071,0x2077,0x2065,0x2072,0x2074,0x2079,0x2075,0x2069, /* 10 */
- 0x206F,0x2070,0x005B,0x005D,0x000D,0x0202,0x2061,0x2073,
+ 0x206F,0x2070, '@', '[',0x000D,0x0202,0x2061,0x2073,
0x2064,0x2066,0x2067,0x2068,0x206A,0x206B,0x206C,0x003B, /* 20 */
- 0x0027,0x0060,0x0201,0x005C,0x207A,0x2078,0x2063,0x2076,
+ ':',0x001B,0x0201, ']',0x207A,0x2078,0x2063,0x2076,
0x2062,0x206E,0x206D,0x002C,0x002E,0x002F,0x0208,0x002A, /* 30 */
- 0x0204,0x0020,0x0804,0x0181,0x0182,0x0183,0x0184,0x0185,
+ 0x0204,0x0020,0x0202,0x0181,0x0182,0x0183,0x0184,0x0185,
0x0186,0x0187,0x0188,0x0189,0x018A,0x0802,0x0801,0x05A0, /* 40 */
0x05A1,0x05A2,0x05A3,0x05A4,0x05A5,0x05A6,0x05A7,0x05A8,
0x05A9,0x05AA,0x05AB,0x05AC,0x8000,0x8000,0x8000,0x01AE, /* 50 */
0x01AF,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+/* Japanese-106 additional codes:
+ * 0x29 Hankaku/Zenkaku (map Esc for now)
+ * 0x70 Hiragana/Katakana (map invalid)
+ * 0x73 Backslash/Underbar
+ * 0x79 Henkan/MaeKouho (map Backspace/Del)
+ * 0x7B Muhenkan (map space)
+ * 0x7D Yen/Verticalbar
+ *
+ * Note that this keyboard's scancode generates above 0x60.
+ *
+ * Other maps:
+ * Shift-Capslock mapped to CapsLock
+ * plain Capslock mapped to Ctrl
+ */
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000, /* 60 */
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000, '\\',0x8000,0x8000,0x8000,0x8000, /* 70 */
+ 0x8000,0x007F,0x8000, ' ',0x8000, '\\',0x8000,0x8000,
/*
* Shift codes
*/
- 0x8000,0x001B,0x0021,0x0040,0x0023,0x0024,0x0025,0x005E, /* 00 */
- 0x0026,0x002A,0x0028,0x0029,0x005F,0x002B,0x01FC,0x0180,
+ 0x8000,0x001B,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026, /* 00 */
+ 0x0027,0x0028,0x0029, '~', '=', '~',0x01FC,0x0180,
0x2051,0x2057,0x2045,0x2052,0x2054,0x2059,0x2055,0x2049, /* 10 */
- 0x204F,0x2050,0x007B,0x007D,0x01E0,0x0202,0x2041,0x2053,
- 0x2044,0x2046,0x2047,0x2048,0x204A,0x204B,0x204C,0x003A, /* 20 */
- 0x0022,0x007E,0x0201,0x007C,0x205A,0x2058,0x2043,0x2056,
+ 0x204F,0x2050, '`', '{',0x01E0,0x0202,0x2041,0x2053,
+ 0x2044,0x2046,0x2047,0x2048,0x204A,0x204B,0x204C, '+', /* 20 */
+ '*',0x001B,0x0201, '}',0x205A,0x2058,0x2043,0x2056,
0x2042,0x204E,0x204D,0x003C,0x003E,0x003F,0x0208,0x01AD, /* 30 */
- 0x0204,0x0020,0x8000,0x018B,0x018C,0x018D,0x018E,0x018F,
+ 0x0204,0x0020,0x0804,0x018B,0x018C,0x018D,0x018E,0x018F,
0x0190,0x0191,0x0192,0x0193,0x0194,0x8000,0x8000,0x0437, /* 40 */
0x0438,0x0439,0x042D,0x0434,0x0435,0x0436,0x042B,0x0431,
0x0432,0x0433,0x0430,0x042E,0x8000,0x8000,0x8000,0x01DB, /* 50 */
0x01DC,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000, /* 60 */
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000, '_',0x8000,0x8000,0x8000,0x8000, /* 70 */
+ 0x8000,0x01AC,0x8000, ' ',0x8000, '|',0x8000,0x8000,
/*
* Cntl codes
*/
- 0x8000,0x001B,0x8000,0x0000,0x8000,0x8000,0x8000,0x001E, /* 00 */
- 0x8000,0x8000,0x8000,0x8000,0x001F,0x8000,0x01DE,0x019F,
+ 0x8000,0x001B,0x8000,0x1022,0x8000,0x8000,0x8000,0x001E, /* 00 */
+ 0x1027,0x8000,0x8000,0x8000,0x8000,0x105E,0x01DE,0x019F,
0x0011,0x0017,0x0005,0x0012,0x0014,0x0019,0x0015,0x0009, /* 10 */
- 0x000F,0x0010,0x001B,0x001D,0x01D0,0x0202,0x0001,0x0013,
+ 0x000F,0x0010,0x0000,0x001B,0x01D0,0x0202,0x0001,0x0013,
0x0004,0x0006,0x0007,0x0008,0x000A,0x000B,0x000C,0x8000, /* 20 */
- 0x1027,0x8000,0x0201,0x001C,0x001A,0x0018,0x0003,0x0016,
+ 0x8000,0x8000,0x0201,0x001D,0x001A,0x0018,0x0003,0x0016,
0x0002,0x000E,0x000D,0x8000,0x8000,0x8000,0x0208,0x01BD, /* 30 */
- 0x0204,0x0020,0x8000,0x0195,0x0196,0x0197,0x0198,0x0199,
+ 0x0204,0x0020,0x0202,0x0195,0x0196,0x0197,0x0198,0x0199,
0x019A,0x019B,0x019C,0x019D,0x019E,0x8000,0x4012,0x01B0, /* 40 */
0x01B1,0x01B2,0x01B3,0x01B4,0x01B5,0x01B6,0x01B7,0x01B8,
0x01B9,0x01BA,0x01BB,0x01BC,0x8000,0x8000,0x8000,0x01BE, /* 50 */
0x01BF,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000, /* 60 */
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000,0x001C,0x8000,0x8000,0x8000,0x8000, /* 70 */
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x001C,0x8000,0x8000,
/*
* Alt codes
*/
@@ -202,26 +232,34 @@
0x01E4,0x01E6,0x01E7,0x01E8,0x01EA,0x01EB,0x01EC,0x8000, /* 20 */
0x8000,0x8000,0x0201,0x8000,0x01FA,0x01F8,0x01E3,0x01F6,
0x01E2,0x01EE,0x01ED,0x8000,0x8000,0x8000,0x0208,0x01CD, /* 30 */
- 0x0204,0x8000,0x8000,0x01D1,0x01D2,0x01D3,0x01D4,0x01D5,
+ 0x0204,0x8000,0x0202,0x01D1,0x01D2,0x01D3,0x01D4,0x01D5,
0x01D6,0x01D7,0x01D8,0x01D9,0x01DA,0x8000,0x8000,0x01C0, /* 40 */
0x01C1,0x01C2,0x01C3,0x01C4,0x01C5,0x01C6,0x01C7,0x01C8,
0x01C9,0x01CA,0x01CB,0x01CC,0x01DD,0x8000,0x8000,0x01CE, /* 50 */
0x01CF,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000, /* 60 */
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000, /* 70 */
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
/*
* Ctl-Alt codes
*/
0x8000,0x4002,0x4005,0x4006,0x4007,0x4008,0x4009,0x400A, /* 00 */
0x400B,0x400C,0x400D,0x400E,0x8000,0x8000,0x4004,0x8000,
0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000, /* 10 */
- 0x8000,0x8000,0x8000,0x8000,0x4003,0x0202,0x8000,0x8000,
+ 0x8000,0x8000,0x1060,0x8000,0x4003,0x0202,0x8000,0x8000,
0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000, /* 20 */
0x8000,0x8000,0x0201,0x8000,0x8000,0x8000,0x8000,0x8000,
0x8000,0x8000,0x8000,0x4010,0x400F,0x4011,0x0208,0x4020, /* 30 */
- 0x0204,0x8000,0x8000,0x4021,0x4022,0x4023,0x4024,0x4025,
+ 0x0204,0x8000,0x0202,0x4021,0x4022,0x4023,0x4024,0x4025,
0x4026,0x4027,0x4028,0x4029,0x402A,0x8000,0x8000,0x8000, /* 40 */
0x8000,0x8000,0x4004,0x8000,0x8000,0x8000,0x4003,0x8000,
0x8000,0x8000,0x8000,0x4001,0x4020,0x8000,0x8000,0x8000, /* 50 */
0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000, /* 60 */
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000, /* 70 */
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
};

static unsigned short *kb_base = &kbtable[0];
@@ -566,13 +604,13 @@
{
if( flag & KB_ALT) {
if( flag & KB_CTL)
- return(&kbtable[4*96]); /* Ctl + Alt */
- return(&kbtable[3*96]); /* Alt */
+ return(&kbtable[4*KBTABSIZE]); /* Ctl + Alt */
+ return(&kbtable[3*KBTABSIZE]); /* Alt */
}
if( flag & KB_CTL)
- return(&kbtable[2*96]); /* Ctl */
+ return(&kbtable[2*KBTABSIZE]); /* Ctl */
if( flag & KB_SHIFT)
- return(&kbtable[1*96]); /* Shift */
+ return(&kbtable[1*KBTABSIZE]); /* Shift */
return(&kbtable[0]); /* Normal */
}

@@ -665,28 +703,34 @@
key = *(kb_base + c);
op = (key >> 8);

- if( c >= 0x60 ) {
+ if( c >= KBTABSIZE ) {
/*
- * Process special codes
+ * Ignore all other codes
+ * (KBTABSIZE==0x80, so no-op here...)
*/
- if( s == 0xFA ) {
- /*
- * A received ACK from keyboard allows us to
- * send another byte from the transmit queue
- */
- rcv_ack();
- goto done;
- }
- if( s == 0xE0 ) {
- /*
- * Extended scan-code follows
- */
- kbflag &= ~KB_EXTENDED;
- kbflag |= KB_EXT_ARM;
- goto done;
- }
+ goto done;
+ }
+
+ if( s == 0xFA ) {
/*
- * Ignore all other codes
+ * A received ACK from keyboard allows us to
+ * send another byte from the transmit queue
+ */
+ rcv_ack();
+ goto done;
+ }
+ if( s == 0xE0 ) {
+ /*
+ * Extended scan-code follows
+ */
+ kbflag &= ~KB_EXTENDED;
+ kbflag |= KB_EXT_ARM;
+ goto done;
+ }
+
+ if( op == 0x80 ) {
+ /*
+ * Ignore invalid key
*/
goto done;
}
Index: devc-con-jp/devc/con/options.c
diff -u devc-con-jp/devc/con/options.c:1.1.1.1 devc-con-jp/devc/con/options.c:1.2
--- devc-con-jp/devc/con/options.c:1.1.1.1 Thu Dec 19 03:31:41 2002
+++ devc-con-jp/devc/con/options.c Thu Dec 19 03:47:03 2002
@@ -11,7 +11,7 @@
*/
/*
#ifdef __USAGE
-%C - Console driver for PC keyboard/VGA display
+%C - Console driver for PC keyboard/VGA display (jp106 key mapping)

%C [options] &
Options:
Index: devc-con-jp/devc/package/Makefile
diff -u /dev/null devc-con-jp/devc/package/Makefile:1.8
--- /dev/null Mon Dec 23 20:41:43 2002
+++ devc-con-jp/devc/package/Makefile Mon Dec 23 20:28:06 2002
@@ -0,0 +1,23 @@
+all: repack
+
+# NEVER make VEND "public"; it'll wipe out ./public!!
+VEND=qnx
+CMPN=kbd-jp106
+PVERS=1.0
+#PNAME=os / PNAME=os-jp106
+
+../con/x86/o/devc-con:
+ cd ../con; make
+
+os-$(PVERS)-x86-$(VEND).qpr: ../con/x86/o/devc-con
+ D=`pwd`; D=`basename $$D`; cd ..; packager $$D/package.qpg
+ mv ../$@ .
+
+repack: os-$(PVERS)-x86-$(VEND).qpr
+ cp -p os-$(PVERS)-x86-$(VEND).qpr devc-con-jp106-$(PVERS)-x86.qpr
+
+clean::
+ rm -fr *.qpm *.qpk os-*.qp? $(VEND)
+
+veryclean: clean
+ rm -f *.qpr
Index: devc-con-jp/devc/package/package.qpg
diff -u /dev/null devc-con-jp/devc/package/package.qpg:1.6
--- /dev/null Mon Dec 23 20:41:43 2002
+++ devc-con-jp/devc/package/package.qpg Mon Dec 23 20:28:06 2002
@@ -0,0 +1,93 @@
+<QPG:Generation>
+ <QPG:Owner file="owner.qpg"/>
+ <QPG:Values>
+ <QPG:Files>
+ <QPG:Add file="*/*/*/*.map" handling="exclude"/>
+ <QPG:Add file="*/*/*/*.pinfo" handling="exclude"/>
+ <QPG:Add file="*/*/*/devc-con" pinfo="$" install="/sbin/devc-con" component="kbd-jp106"/>
+ </QPG:Files>
+
+ <QPG:PackageFilter>
+ <QPM:PackageManifest>
+ <QPM:PackageDescription>
+ <QPM:PackageName>kbd-jp106-1.0</QPM:PackageName>
+ <QPM:PackageType>Application</QPM:PackageType>
+ <QPM:PackageReleaseNumber>1</QPM:PackageReleaseNumber>
+ <QPM:PackageRepository/>
+ <QPM:FileVersion>1.01</QPM:FileVersion>
+ </QPM:PackageDescription>
+
+ <QPM:ProductDescription>
+ <QPM:ProductName>devc-con for Japanese 106 keyboard</QPM:ProductName>
+ <QPM:VendorInstallName>qnx</QPM:VendorInstallName>
+ <QPM:ProductIdentifier>os</QPM:ProductIdentifier>
+ <QPM:ProductEmail/>
+ <QPM:VendorName>kabe</QPM:VendorName>
+ <QPM:VendorURL/>
+ <QPM:VendorEmbedURL/>
+ <QPM:VendorEmail>kabe@sra-tohoku.co.jp</QPM:VendorEmail>
+ <QPM:AuthorName>Taketo Kabe</QPM:AuthorName>
+ <QPM:ProductIconSmall/>
+ <QPM:ProductIconLarge/>
+ <QPM:ProductDescriptionShort>devc-con for jp106</QPM:ProductDescriptionShort>
+ <QPM:ProductDescriptionLong>Modified devc-con with Japanese 106 keyboard mapping,
+ for use in the raw console. You don't need this if you only use jp106 keyboard in Photon.
+ </QPM:ProductDescriptionLong>
+ <QPM:ProductDescriptionURL/>
+ <QPM:ProductDescriptionEmbedURL/>
+ </QPM:ProductDescription>
+
+ <QPM:ReleaseDescription>
+ <QPM:ReleaseVersion>1.0</QPM:ReleaseVersion>
+ <QPM:ReleaseUrgency>Medium</QPM:ReleaseUrgency>
+ <QPM:ReleaseStability>Stable</QPM:ReleaseStability>
+ <QPM:ReleaseNoteMinor/>
+ <QPM:ReleaseNoteMajor/>
+ <QPM:ReleaseBuild>1</QPM:ReleaseBuild>
+ <QPM:CountryExclude/>
+ <QPM:ReleaseCopyright>QNX Community License</QPM:ReleaseCopyright>
+ </QPM:ReleaseDescription>
+
+ <QPM:LicenseUrl/>
+
+ <QPM:ContentDescription>
+ <QPM:ContentTopic>System/Device Specific/Input Device/Keyboard and Keypad</QPM:ContentTopic>
+ <QPM:ContentKeyword>devc-con,japanese,jp106,keyboard</QPM:ContentKeyword>
+ <QPM:DisplayEnvironment>Console</QPM:DisplayEnvironment>
+ <QPM:TargetAudience>Administrator</QPM:TargetAudience>
+ <QPM:RequiresLibrary>libc.so.2</QPM:RequiresLibrary>
+ </QPM:ContentDescription>
+
+ <QPM:ProductInstallationProcedure>
+ <QPM:OrderDependency>
+ <QPM:Order>InstallOver</QPM:Order>
+ <QPM:Product>os-drivers</QPM:Product>
+ </QPM:OrderDependency>
+ </QPM:ProductInstallationProcedure>
+
+ <QPM:QNXLicenseDescription/>
+ </QPM:PackageManifest>
+ </QPG:PackageFilter>
+
+
+ <QPG:PackageFilter proc="x86">
+ <QPM:PackageManifest>
+ <QPM:PackageDescription>
+ <QPM:PackageName>kbd-jp106-1.0-x86</QPM:PackageName>
+ </QPM:PackageDescription>
+
+ <QPM:ProductDescription>
+ <QPM:ProductName>devc-con for Japanese 106 keyboard</QPM:ProductName>
+ </QPM:ProductDescription>
+
+ <QPM:ProductInstallationProcedure>
+ <QPM:OrderDependency>
+ <QPM:Order>InstallOver</QPM:Order>
+ <QPM:Product>os-drivers-host_x86</QPM:Product>
+ </QPM:OrderDependency>
+ </QPM:ProductInstallationProcedure>
+
+ </QPM:PackageManifest>
+ </QPG:PackageFilter>
+ </QPG:Values>
+</QPG:Generation>

Post Reply

Return to “qdn.public.qnxrtp.x86”