Skip to content
Permalink
Browse files

. 改进 setkey 命令及帮助,完全支持匈牙利键盘(由 steve 提供)。(issues #193)

. 改进 displaymem 及 bootlace 命令。
  • Loading branch information...
yaya
yaya committed May 7, 2019
1 parent 1069d58 commit 11a3079d7ea324ce47e8e290e68163cfaddd6419
Showing with 144 additions and 23 deletions.
  1. +4 −0 ChangeLog_chenall.txt
  2. +54 −9 stage2/asm.S
  3. +7 −4 stage2/bootlace.inc
  4. +79 −10 stage2/builtins.c
@@ -1,4 +1,8 @@
更新说明:
2019-05-07(yaya)
改进 setkey 命令及帮助,完全支持匈牙利键盘(由 steve 提供)。
改进 displaymem 及 bootlace 命令。

2019-03-25(yaya)
修正动态 VHD 不再能够支持的问题。
条件菜单项目(iftitle )支持图形菜单。
@@ -5593,6 +5593,11 @@ minimum_mem_lo_in_map:
.long 0 /* min ram drive base below 16M */
ENTRY(minimum_mem_hi_in_map)
.long 0 /* min ram drive base above 16M */

ENTRY(prime_end)
.long 0,0
ENTRY(new_end)
.long 0,0

#if 0
int15_e820_saved_ebx:
@@ -5722,7 +5727,7 @@ int15_e820_handler:
movl %es:16(%di), %eax /* Type: 1 = usable memory. */
decl %eax /* is it usable? */
jz 5f /* yes, modify usable mem range */

#if 0
/* it is reserved memory. only modify low mem range at this moment. */
cmpl %edx, %cs:(EXT_C(int15nolow) - int13_handler) /* EDX=0 */
jnz 4f /* int15 will not handle low mem */
@@ -5743,7 +5748,26 @@ int15_e820_handler:
movl $0xA0000, %es:8(%di)
subl %eax, %es:8(%di)
jmp 4f /* done modifying reserved low mem range */
#endif

andb $0xfe, (prime_end - int13_handler)
movl %es:4(%di), %edx
cmpl %edx, (prime_end + 4 - int13_handler) //0
jne 4f
movl %es:(%di), %eax
cmpl %eax, (prime_end - int13_handler)
jne 4f

subl (new_end - int13_handler), %eax
sbbl (new_end + 4 - int13_handler), %edx
addl %eax, %es:8(%di)
adcl %edx, %es:12(%di)

movl (new_end - int13_handler), %eax
movl (new_end + 4 - int13_handler), %edx
movl %eax, %es:(%di)
movl %edx, %es:4(%di)
jmp 4f
5:
/* it is usable memory. */

@@ -5754,12 +5778,13 @@ int15_e820_handler:
#else
movw $(EXT_C(hooked_drive_map)-int13_handler-DRIVE_MAP_SLOT_SIZE), %si
#endif
movw $(DRIVE_MAP_SIZE + 1), %cx
movw $(DRIVE_MAP_SIZE + 1), %bp

popl %eax /* available low mem size in bytes */
pushl %eax /* available low mem size in bytes */

cmpl %edx, %cs:(EXT_C(int15nolow) - int13_handler) /* EDX=0 */
// cmpl %edx, %cs:(EXT_C(int15nolow) - int13_handler) /* EDX=0 */
cmpl $0, %cs:(EXT_C(int15nolow) - int13_handler)
jz 7f /* int15 will handle low mem */
jmp 5f /* this "jmp" instruction can be omitted. */
6:
@@ -5795,12 +5820,32 @@ int15_e820_handler:
subl %es:8(%di), %eax
sbbl %es:12(%di), %edx /* EDX:EAX=difference */
jnb 5f /* new length is too big */
addl %eax, %es:8(%di)
adcl %edx, %es:12(%di) /* apply new length */
// addl %eax, %es:8(%di)
// adcl %edx, %es:12(%di) /* apply new length */
movl %es:8(%di), %ebx
movl %es:12(%di), %ecx
addl %ebx, %eax
adcl %ecx, %edx
movl %eax, %es:8(%di)
movl %edx, %es:12(%di)
addl %es:(%di), %eax
adcl %es:4(%di), %edx
movl %eax, (new_end - int13_handler)
movl %edx, (new_end + 4 - int13_handler)

testb $1, (prime_end - int13_handler)
jne 5f
addl %es:(%di), %ebx
adcl %es:4(%di), %ecx
movl %ebx, (prime_end - int13_handler)
movl %ecx, (prime_end + 4 - int13_handler)
orb $1, (prime_end - int13_handler)
5:
/* try next slot */
addw $DRIVE_MAP_SLOT_SIZE, %si
loop 6b
// loop 6b
dec %bp
jne 6b
/* done modifying usable mem range */
4:
popl %eax /* available low mem size in bytes */
@@ -13172,9 +13217,9 @@ ENTRY(get_mmap_entry)
movw %di, %si

movl $0xe820, %eax
//int $0x15
pushfw
lcall %cs:*ABS(EXT_C(ROM_int15))
int $0x15
// pushfw
// lcall %cs:*ABS(EXT_C(ROM_int15))

jnc 1f
movl $0, %ebx /* set end indicator */
@@ -1768,26 +1768,29 @@ sb:
movl 0x20(iSI), %eax
subl $16, %eax
cmpl %edx, %eax
ja 210f
jae 210f
movl $ABS(msg_cannot_install_gpt_partition), %ecx
movl $0x7f, %edi
3:
cmpl $0, 0x2c(iSI)
jne 4f
cmpl $0, 0xa4(iSI)
jne 4f
movl 0xa0(iSI), %eax
orl %eax, %eax
je 4f
movl 0x28(iSI), %edx
addl $1, %edx
subl $16, %eax
cmpl %edx, %eax
ja 210f
jae 210f
addl $0x80, %esi
cmpl $0, 0x20(iSI)
subl $1, %edi
jne 3b
jmp 4f
210:
addl $1, %edx
movl $ABS(msg_cannot_install_gpt_partition), %ecx
cmpl $0x800000, %edx
jae 4f
@@ -4620,6 +4620,7 @@ displaymem_func (char *arg, int flags)
"Upper memory (to first chipset hole): %uK\n",
(unsigned long)saved_mem_lower, (unsigned long)saved_mem_upper);
}
#if 0
if (mbi.flags & MB_INFO_MEM_MAP)
{
struct AddrRangeDesc *map = (struct AddrRangeDesc *) saved_mmap_addr;
@@ -4654,7 +4655,34 @@ displaymem_func (char *arg, int flags)
map = ((struct AddrRangeDesc *) (((int) map) + 4 + map->size));
}
}
#else
grub_printf (" [Address Range Descriptor entries "
"immediately follow (values are 64-bit)]\n");

unsigned long cont, addr;
addr = SCRATCHADDR;
cont = 0;
do
{
cont = get_mmap_entry ((void *) addr, cont); /* int15/e820 ------ will write memory! */
struct AddrRangeDesc *map = (struct AddrRangeDesc *) addr;
if (!sector)
{
grub_printf (" %s: Base: 0x%8lX, Length: 0x%8lX\n",
(map->Type == MB_ARD_MEMORY)?"Usable RAM":"Reserved ",
map->BaseAddr,
map->Length);
}
else if (map->Type == MB_ARD_MEMORY)
{
grub_printf (" Usable (Hex sectors): Base: %8lX, Length: %8lX, End: %8lX\n",
map->BaseAddr / 0x200,
map->Length / 0x200,
map->BaseAddr + map->Length / 0x200);
}
}
while (cont);
#endif
return 1;
}

@@ -13984,6 +14012,47 @@ static struct keysym keysym_table[] =
{"ctrlF8", 0x6500},
{"ctrlF9", 0x6600},
{"ctrlF10", 0x6700},

{"Aq", 0x1000}, // A=Alt or AltGr. Provided by steve.
{"Aw", 0x1100},
{"Ae", 0x1200},
{"Ar", 0x1300},
{"At", 0x1400},
{"Ay", 0x1500},
{"Au", 0x1600},
{"Ai", 0x1700},
{"Ao", 0x1800},
{"Ap", 0x1900},
{"Aa", 0x1e00},
{"As", 0x1f00},
{"Ad", 0x2000},
{"Af", 0x2100},
{"Ag", 0x2200},
{"Ah", 0x2300},
{"Aj", 0x2400},
{"Ak", 0x2500},
{"Al", 0x2600},
{"Az", 0x2c00},
{"Ax", 0x2d00},
{"Ac", 0x2e00},
{"Av", 0x2f00},
{"Ab", 0x3000},
{"An", 0x3100},
{"Am", 0x3200},
{"A1", 0x7800},
{"A2", 0x7900},
{"A3", 0x7A00},
{"A4", 0x7B00},
{"A5", 0x7C00},
{"A6", 0x7D00},
{"A7", 0x7E00},
{"A8", 0x7F00},
{"A9", 0x8000},
{"A0", 0x8100},
{"oem102", 0x565c},
{"shiftoem102", 0x567c},


};

//static int find_key_code (char *key);
@@ -14103,16 +14172,16 @@ static struct builtin builtin_setkey =
"setkey",
setkey_func,
BUILTIN_CMDLINE | BUILTIN_SCRIPT | BUILTIN_MENU | BUILTIN_HELP_LIST,
"setkey [TO_KEY FROM_KEY]",
"Change the keyboard map. The key FROM_KEY is mapped to the key TO_KEY."
" A key must be an alphabet, a digit, or one of these: escape, exclam,"
" at, numbersign, dollar, percent, caret, ampersand, asterisk, parenleft,"
" parenright, minus, underscore, equal, plus, backspace, tab, bracketleft,"
" braceleft, bracketright, braceright, enter, control, semicolon, colon,"
" quote, doublequote, backquote, tilde, shift, backslash, bar, comma,"
" less, period, greater, slash, question, alt, space, capslock, FX (X"
" is a digit), and delete. If no argument is specified, reset key"
" mappings."
"setkey [NEW_KEY FROM_KEY]",
"Map default USA key FROM_KEY to NEW_KEY."
" Key names: 0-9, A-Z, a-z or escape, exclam, at, numbersign, dollar," //Provided by steve.
" percent, caret, ampersand, asterisk, parenleft, parenright, minus,"
" underscore, equal, plus, backspace, tab, bracketleft, braceleft,"
" bracketright, braceright, enter, semicolon, colon, quote, doublequote,"
" backquote, tilde, shift, backslash, bar, comma, less, period,"
" greater, slash, question, alt, space, delete, oem102, shiftoem102"
" [ctrl|shift]F1-10. Use A for Alt+(a-z)(0-9), e.g. 'setkey at Av'."
" Reset: 'setkey at at' to reset one key, 'setkey' to reset all. "
};


0 comments on commit 11a3079

Please sign in to comment.
You can’t perform that action at this time.