VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

Anyone knows the untranslated scancodes sent by the PS/2 keyboard when CTRL-BREAK, CTRL-SYSRQ or ALT-SYSRQ is pressed and/or released on the PS/2 keyboard?

What are their adjusting effects in each scancode set on the bytestream received by the PS/2 keyboard(untranslated by the 8042)?

Edit: So far, I've gotten this:

KEYBOARDENTRY_EXTENDED CTRLSYSRQ[3] = {
{ { { 0xE0,0x37,0x00,0x00,0x00,0x00 },2,{ 0x00,0x00,0x00,0x00,0x00,0x00 } },1 },
{ { { 0x00,0x00,0x00,0x00,0x00,0x00 },0,{ 0x00,0x00,0x00,0x00,0x00,0x00 } },0 },
{ { { 0x00,0x00,0x00,0x00,0x00,0x00 },0,{ 0x00,0x00,0x00,0x00,0x00,0x00 } },0 }
};


KEYBOARDENTRY_EXTENDED ALTSYSRQ[3] = {
{{{0x54,0x00,0x00,0x00,0x00,0x00},1,{0x00,0x00,0x00,0x00,0x00,0x00}},1},
{{{ 0x84,0x00,0x00,0x00,0x00,0x00 },1,{0x00,0x00,0x00,0x00,0x00,0x00 }},1},
{{{ 0x00,0x00,0x00,0x00,0x00,0x00 },0,{0x00,0x00,0x00,0x00,0x00,0x00 }},0}
};

KEYBOARDENTRY_EXTENDED CTRLBREAK[3] = {
{{ { 0x46,0x00,0x00,0x00,0x00,0x00 },1,{ 0x00,0x00,0x00,0x00,0x00,0x00 },0 },1},
{{ { 0xE0,0x46,0x00,0x00,0x00,0x00 },2,{ 0x00,0x00,0x00,0x00,0x00,0x00 },0 },1},
{{ { 0x00,0x00,0x00,0x00,0x00,0x00 },0,{ 0x00,0x00,0x00,0x00,0x00,0x00 },0 },0}
};

The entry types being:

typedef struct
{
byte keypress[8];
byte keypress_size; //1-8
byte keyrelease[8];
byte keyrelease_size; //0-8: 0 for none!
} KEYBOARDENTRY; //Entry containing keyboard character data (press/hold and release data)!

typedef struct
{
KEYBOARDENTRY entry;
byte used; //Are we used instead of a normal one?
} KEYBOARDENTRY_EXTENDED;

Set 1 defaults(no ctrl/alt applied):

	{{0xE0,0x2A,0xE0,0x37,0x00,0x00,0x00,0x00},4,{0xE0,0xB7,0xE0,0xAA,0x00,0x00,0x00,0x00},4}, //PRNT SCRN
{{0xE1,0x1D,0x45,0x00,0x00,0x00,0x00,0x00},3,{0xE1,0x9D,0xC5,0x00,0x00,0x00,0x00,0x00},3}, //PAUSE

Set 2 defaults(no ctrl/alt applied):

	{{0xE0,0x12,0xE0,0x7C,0x00,0x00,0x00,0x00},4,{0xE0,0xF0,0x7C,0xE0,0xF0,0x12,0x00,0x00},6}, //PRNT SCRN
{{0xE1,0x14,0x77,0xE1,0x00,0x00,0x00,0x00},4,{0xF0,0x14,0xF0,0x77,0x00,0x00,0x00,0x00},4}, //PAUSE

Set 3 defaults(no ctrl/alt applied):

	{{0x57,0x00,0x00,0x00,0x00,0x00,0x00,0x00},1,{0xF0,0x57,0x00,0x00,0x00,0x00,0x00,0x00},2}, //PRNT SCRN
{{0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x00},1,{0xF0,0x62,0x00,0x00,0x00,0x00,0x00,0x00},2}, //PAUSE

How far is this correct? Are there any errors left to address there?

So, what are the none/CtrlBreak/CtrlSysRq/AltSysRQ combinations to result in proper scancodes in sets 1,2 and 3?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 1 of 4, by superfury

User metadata
Rank l33t++
Rank
l33t++

I've tried arriving at my own conclusion for custom ctrl/alt modifiers:

KEYBOARDENTRY_EXTENDED CTRLSYSRQ[3] = {
{ { { 0x37,0x00,0x00,0x00,0x00,0x00 },1,{ 0x00,0x00,0x00,0x00,0x00,0x00 },0 },1 },
{ { { 0xE0,0x37,0xD4,0x00,0x00,0x00 },3,{ 0x00,0x00,0x00,0x00,0x00,0x00 },0 },1 },
{ { { 0xE0,0x37,0xD4,0x00,0x00,0x00 },3,{ 0x00,0x00,0x00,0x00,0x00,0x00 },0 },0 }
};


KEYBOARDENTRY_EXTENDED ALTSYSRQ[3] = {
{{{0x54,0x00,0x00,0x00,0x00,0x00},1,{0x00,0x00,0x00,0x00,0x00,0x00},0},1},
{{{ 0xE0,0x54,0xD4,0x00,0x00,0x00 },3,{0x00,0x00,0x00,0x00,0x00,0x00 },0},1},
{{{ 0xE0,0x54,0xD4,0x00,0x00,0x00 },3,{0x00,0x00,0x00,0x00,0x00,0x00 },0},0}
};

KEYBOARDENTRY_EXTENDED CTRLBREAK[3] = {
{{ { 0x46,0x00,0x00,0x00,0x00,0x00 },1,{ 0xC6,0x00,0x00,0x00,0x00,0x00 },1 },1},
{{ { 0xE0,0x46,0x00,0x00,0x00,0x00 },2,{ 0xE0,0xF0,0x46,0x00,0x00,0x00 },2 },1},
{{ { 0x62,0x00,0x00,0x00,0x00,0x00 },1,{ 0x77,0x00,0x00,0x00,0x00,0x00 },1 },0}
};

Anyone can tell me if this is correct?

Edit: Slight reinterpretation, based on https://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html and https://www.win.tue.nl/~aeb/linux/kbd/scancodes-5.html#mtek :

KEYBOARDENTRY_EXTENDED CTRLSYSRQ[3] = {
{{{0x37,0x00,0x00,0x00,0x00,0x00},1,{0x00,0x00,0x00,0x00,0x00,0x00},0},1},
{{{0xE0,0x37,0x00,0x00,0x00,0x00},2,{0x00,0x00,0x00,0x00,0x00,0x00},0},1},
{{{0xE0,0x37,0xD4,0x00,0x00,0x00},3,{0x00,0x00,0x00,0x00,0x00,0x00},0},0}
};

KEYBOARDENTRY_EXTENDED ALTSYSRQ[3] = {
{{{0x54,0x00,0x00,0x00,0x00,0x00},1,{0x00,0x00,0x00,0x00,0x00,0x00},0},1},
{{{0x54,0x00,0x00,0x00,0x00,0x00},1,{0x00,0x00,0x00,0x00,0x00,0x00},0},1},
{{{0xE0,0x54,0xD4,0x00,0x00,0x00},3,{0x00,0x00,0x00,0x00,0x00,0x00},0},0}
};

KEYBOARDENTRY_EXTENDED CTRLBREAK[3] = {
{{{0x46,0x00,0x00,0x00,0x00,0x00},1,{0xC6,0x00,0x00,0x00,0x00,0x00},1},1},
{{{0xE0,0x46,0x00,0x00,0x00,0x00},2,{0xE0,0xC6,0x00,0x00,0x00,0x00},2},1},
{{{0x62,0x00,0x00,0x00,0x00,0x00},1,{0x77,0x00,0x00,0x00,0x00,0x00},1},0}
};

Anyone????

Edit: Btw, the indexes into the tables themselves are the scancode sets. So each row is a different scancode set(with the final number for an entry being a simple used flag(1=Used, 0=Not used(apply normal key table)).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 3 of 4, by superfury

User metadata
Rank l33t++
Rank
l33t++

Just implemented and changed the tables to implement that document.

One strange thing that's mentioned in the table, though: apparently shift affects Insert/Delete/Home/End/PageUp/PageDown and normal Arrows on the keyboard, instead of the NUMPAD versions of them?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 4 of 4, by superfury

User metadata
Rank l33t++
Rank
l33t++

Using the AT Diagnostics SETUP disk (1), after configuring the BIOS using GSETUP and booting said disk, I've managed to check the keyboard input for errors. The SysRq and Break keys work as expected: pressing them without the Ctrl/Alt keys makes them show up as a blinking P, but combining them with ALT and/or CTRL(CTRL only for CTRL-BREAK) makes them change from a blinking P to a blinking S(SysRq) and blinking P(Pause) 😁

So it might just be an issue with Minix not listening for said key combinations(even though LInux(not running in UniPCemu) does)?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io