diff options
| author | Richard Qin <richard.qin.x@gmail.com> | 2026-11-09 01:57:05 +0800 |
|---|---|---|
| committer | Richard Qin <richard.qin.x@gmail.com> | 2026-11-09 01:57:05 +0800 |
| commit | 9b380041e6ad178f96942fd3b2521c1aba21a068 (patch) | |
| tree | 87d682c1940341b4968fb1452a474795f2b96525 /mubios/services/int16.c | |
| parent | 3ef6001ab0e719c18cfd369ecd0df108a9520991 (diff) | |
| download | rcc-project-9b380041e6ad178f96942fd3b2521c1aba21a068.tar.gz rcc-project-9b380041e6ad178f96942fd3b2521c1aba21a068.tar.xz | |
[mubios] Add EDD parameters and normalize PS/2 input
Diffstat (limited to 'mubios/services/int16.c')
| -rw-r--r-- | mubios/services/int16.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/mubios/services/int16.c b/mubios/services/int16.c index 4a04828..5872fb1 100644 --- a/mubios/services/int16.c +++ b/mubios/services/int16.c @@ -27,6 +27,18 @@ #define BDA_KBD_BUFFER_END 0x003Eu static u8 +normalize_scancode (u8 scancode) +{ + switch (scancode) + { + case 0x5Au: + return 0x1Cu; + default: + return scancode; + } +} + +static u8 scancode_to_ascii (u8 scancode) { switch (scancode) @@ -126,7 +138,7 @@ int16_service (struct bios_regs *regs) position = *head; value = buffer[(position - BDA_KBD_BUFFER_START) >> 1]; - scancode = (u8)(value >> 8); + scancode = normalize_scancode ((u8)(value >> 8)); ascii = scancode_to_ascii (scancode); regs->eax = ((u32)scancode << 8) | ascii; |
