simplify track_int13 and some related code, and fix a few bugs in VBE support code.

This commit is contained in:
okuji 2000-11-21 16:36:21 +00:00
parent 455795862c
commit 65d6a086d0
4 changed files with 45 additions and 54 deletions

View file

@ -1,3 +1,21 @@
2000-11-22 OKUJI Yoshinori <okuji@gnu.org>
From Vesa Jaaskelainen <jaaskela@tietomyrsky.fi>:
* stage2/builtins.c (testvbe_func): Don't set the bit 14 of a
VBE mode number explicitly when calling get_vbe_mode_info.
(vbeprobe_func): Likewise.
2000-11-22 OKUJI Yoshinori <okuji@gnu.org>
The code for the "INT 13H tracking technique" is somewhat
simplified.
* stage2/asm.S [!STAGE1_5] (track_int13): Don't replace an int13
handler with set_tf_int13_handler. Instead, track_int13 itself
emulates an int13 interrupt.
[!STAGE1_5] (set_tf_int13_handler): Removed.
[!STAGE1_5] (int1_handler): Use movzbw instead of xorb and movb.
2000-11-15 OKUJI Yoshinori <okuji@gnu.org> 2000-11-15 OKUJI Yoshinori <okuji@gnu.org>
* acconfig.h (PRESET_MENU_STRING): New entry. * acconfig.h (PRESET_MENU_STRING): New entry.

1
THANKS
View file

@ -57,3 +57,4 @@ Thierry DELHAISE <thierry.delhaise@delhaise.com>
Thomas Schweikle <tschweikle@fiducia.de> Thomas Schweikle <tschweikle@fiducia.de>
Torsten Duwe <duwe@caldera.de> Torsten Duwe <duwe@caldera.de>
VaX#n8 <vax@linkdead.paranoia.com> VaX#n8 <vax@linkdead.paranoia.com>
Vesa Jaaskelainen <jaaskela@tietomyrsky.fi>

View file

@ -288,16 +288,10 @@ ENTRY(track_int13)
pushl %ebx pushl %ebx
pushl %edi pushl %edi
/* save the original int13 handler */ /* copy the original int13 handler segment:offset */
movl $0x4c, %edi movl $0x4c, %edi
movw (%edi), %ax movl (%edi), %eax
movw %ax, ABS(set_tf_int13_offset) movl %eax, track_int13_addr
movw 2(%edi), %ax
movw %ax, ABS(set_tf_int13_segment)
/* save the new int13 handler */
movl $ABS(set_tf_int13_handler), %eax
movl %eax, (%edi)
/* replace the int1 handler */ /* replace the int1 handler */
movl $0x4, %edi movl $0x4, %edi
@ -317,8 +311,25 @@ ENTRY(track_int13)
movw $1, %cx movw $1, %cx
xorb %dh, %dh xorb %dh, %dh
movw $0x201, %ax /* save FLAGS on the stack to emulate int13 */
int $0x13 pushfw
/* set the TF flag */
/* FIXME: this can be simplified not to use AX */
pushfw
popw %ax
orw $0x100, %ax
pushw %ax
popfw
movw $0x0201, %ax
.byte 0x9a /* lcall */
track_int13_addr:
.word 0 /* offset */
.word 0 /* segment */
/* TF is cleared here automatically */
DATA32 call EXT_C(real_to_prot) DATA32 call EXT_C(real_to_prot)
.code32 .code32
@ -327,13 +338,6 @@ ENTRY(track_int13)
movl $0x4, %edi movl $0x4, %edi
popl (%edi) popl (%edi)
/* restore the int13 handler */
movl $0x4c, %edi
movw ABS(set_tf_int13_offset), %ax
movw %ax, (%edi)
movw ABS(set_tf_int13_segment), %ax
movw %ax, 2(%edi)
popl %edi popl %edi
popl %ebx popl %ebx
popl %ebp popl %ebp
@ -407,9 +411,8 @@ int1_handler:
jg 8f jg 8f
7: /* immediate has a port */ 7: /* immediate has a port */
xorb %ah, %ah
lodsb (%si), %al lodsb (%si), %al
movw %ax, %dx movzbw %al, %dx
5: /* %dx has a port */ 5: /* %dx has a port */
@ -447,37 +450,6 @@ int1_handler:
iret iret
/*
* Just set the TF flag. This handler is necessary because any interrupt
* call clears the flag automatically.
*
* Note: we need not to clear this flag after the tracking explicitly,
* because iret restores the original FLAGS.
*/
set_tf_int13_handler:
/* save %ax int the stack */
pushw %ax
/* set the TF flag */
pushf
popw %ax
orw $0x100, %ax
pushw %ax
popf
/* restore %ax */
popw %ax
/* simulate the interrupt call */
pushf
/* lcall */
.byte 0x9a
set_tf_int13_offset: .word 0
set_tf_int13_segment: .word 0
iret
.code32 .code32
ENTRY(io_map) ENTRY(io_map)

View file

@ -4061,7 +4061,7 @@ testvbe_func (char *arg, int flags)
return 0; return 0;
} }
if (get_vbe_mode_info (mode_number | (1 << 14), &mode) != 0x004F if (get_vbe_mode_info (mode_number, &mode) != 0x004F
|| (mode.mode_attributes & 0x0091) != 0x0091) || (mode.mode_attributes & 0x0091) != 0x0091)
{ {
grub_printf (" Mode 0x%x is not supported.\n", mode_number); grub_printf (" Mode 0x%x is not supported.\n", mode_number);
@ -4303,7 +4303,7 @@ vbeprobe_func (char *arg, int flags)
{ {
struct vbe_mode mode; struct vbe_mode mode;
if (get_vbe_mode_info (*mode_list | (1 << 14), &mode) != 0x004F) if (get_vbe_mode_info (*mode_list, &mode) != 0x004F)
continue; continue;
/* Skip this, if this is not supported or linear frame buffer /* Skip this, if this is not supported or linear frame buffer