diff -u -4 -r grub-0.5.95.orig/stage2/asm.S grub-0.5.95/stage2/asm.S --- grub-0.5.95.orig/stage2/asm.S Sat Jun 3 15:08:05 2000 +++ grub-0.5.95/stage2/asm.S Fri Jul 7 21:06:30 2000 @@ -489,8 +489,19 @@ andb $0x7f, %dl /* save the highest bit in %bl */ movb %al, %bl xorb %dl, %bl + /* Hi.Yamamor added. # Thu Apr 27 2000 # JPKEY ---> */ + xorw %ax, %ax + movw %ax, %ds + movw $ABS(EXT_C(jp_key_code)), %si +5: lodsw + testw %ax, %ax + jz 6f + cmpb %al, %dl + jne 5b + movb %ah, %dl +6: /* <--- JPKEY */ /* set %ds to 0 */ xorw %ax, %ax movw %ax, %ds /* set %si to the key map */ @@ -518,9 +529,10 @@ popw %ds popw %dx popw %bx popw %bp - iret + jmp 1f /* added for JPKEY */ + /* iret removed (BUG?) */ 4: /* tricky: jmp (0x74) <-> je (0xeb) */ xorb $(0x74 ^ 0xeb), ABS(int15_skip_flag) @@ -533,8 +545,17 @@ .code32 .align 4 +/* Hi.Yamamor added. # Thu Apr 27 2000 # JPKEY ---> */ +ENTRY(jp_key_code) + .byte 0x29,0x7D + .byte 0x1A,0x29 + .byte 0x1B,0x1A + .byte 0x2B,0x1B + .byte 0x7D,0x2B + .byte 0, 0 +/* <--- JPKEY */ ENTRY(bios_key_map) .space (KEY_MAP_SIZE + 1) * 2 @@ -1970,8 +1991,59 @@ popl %ebp ret +/* + * Hi.Yamamor added. # Thu Apr 27 2000 # JPKEY ---> + * remaps char-codes. + */ + .code16 + +remap_jpkey_char: + pushw %si + + cmpb $0x37, %bh /* TenKey * */ + je 2f + cmpb $0x4E, %bh /* TenKey + */ + je 2f + movw $ABS(EXT_C(jp_key_map)), %si +1: + lodsw + /* check if this is the end */ + testw %ax, %ax + jz 2f + /* check if this matches the ascii code */ + cmpb %al, %bl + jne 1b + /* if so, perform the mapping */ + movb %ah, %bl +2: + /* restore %si */ + popw %si + + ret + + .code32 + + .align 4 +ENTRY(jp_key_map) + .byte 0x40,0x22 /* @ -> " */ + .byte 0x5E,0x26 /* ^ -> & */ + .byte 0x26,0x27 /* & -> ' */ + .byte 0x2A,0x28 /* * -> ( */ + .byte 0x28,0x29 /* ( -> ) */ + .byte 0x29,0x7E /* ) -> ~ */ + .byte 0x5F,0x3D /* _ -> = */ + .byte 0x3D,0x5E /* = -> ^ */ + .byte 0x2B,0x5F /* + -> _ */ + .byte 0x60,0x40 /* ` -> @ */ + .byte 0x7E,0x60 /* ~ -> ` */ + .byte 0x3A,0x2B /* : -> + */ + .byte 0x27,0x3A /* ' -> : */ + .byte 0x22,0x2A /* " -> * */ + .byte 0, 0 +/* <--- JPKEY */ + /* * remap_ascii_char remaps the ascii code %bl to another if the code is * contained in ASCII_KEY_MAP. */ @@ -2021,8 +2093,9 @@ int $0x16 movw %ax, %bx /* real_to_prot uses %eax */ + call remap_jpkey_char /* added for JPKEY */ call remap_ascii_char DATA32 call EXT_C(real_to_prot) .code32 diff -u -4 -r grub-0.5.95.orig/stage2/stage2.c grub-0.5.95/stage2/stage2.c --- grub-0.5.95.orig/stage2/stage2.c Mon Jun 12 23:01:28 2000 +++ grub-0.5.95/stage2/stage2.c Fri Jul 7 21:06:30 2000 @@ -615,8 +615,12 @@ /* Initialize the kill buffer. */ *kill = 0; +#ifndef GRUB_UTIL + set_int15_handler (); /* Hi.Yamamor added for JPKEY. # Thu Apr 26 2000 */ +#endif + /* Never return. */ for (;;) { config_len = 0;