simplify track_int13 and some related code, and fix a few bugs in VBE support code.
This commit is contained in:
parent
455795862c
commit
65d6a086d0
4 changed files with 45 additions and 54 deletions
18
ChangeLog
18
ChangeLog
|
@ -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>
|
||||
|
||||
* acconfig.h (PRESET_MENU_STRING): New entry.
|
||||
|
|
1
THANKS
1
THANKS
|
@ -57,3 +57,4 @@ Thierry DELHAISE <thierry.delhaise@delhaise.com>
|
|||
Thomas Schweikle <tschweikle@fiducia.de>
|
||||
Torsten Duwe <duwe@caldera.de>
|
||||
VaX#n8 <vax@linkdead.paranoia.com>
|
||||
Vesa Jaaskelainen <jaaskela@tietomyrsky.fi>
|
||||
|
|
76
stage2/asm.S
76
stage2/asm.S
|
@ -288,16 +288,10 @@ ENTRY(track_int13)
|
|||
pushl %ebx
|
||||
pushl %edi
|
||||
|
||||
/* save the original int13 handler */
|
||||
/* copy the original int13 handler segment:offset */
|
||||
movl $0x4c, %edi
|
||||
movw (%edi), %ax
|
||||
movw %ax, ABS(set_tf_int13_offset)
|
||||
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)
|
||||
movl (%edi), %eax
|
||||
movl %eax, track_int13_addr
|
||||
|
||||
/* replace the int1 handler */
|
||||
movl $0x4, %edi
|
||||
|
@ -310,16 +304,33 @@ ENTRY(track_int13)
|
|||
|
||||
call EXT_C(prot_to_real)
|
||||
.code16
|
||||
|
||||
|
||||
movw $SCRATCHSEG, %ax
|
||||
movw %ax, %es
|
||||
xorw %bx, %bx
|
||||
movw $1, %cx
|
||||
xorb %dh, %dh
|
||||
|
||||
movw $0x201, %ax
|
||||
int $0x13
|
||||
/* save FLAGS on the stack to emulate int13 */
|
||||
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)
|
||||
.code32
|
||||
|
||||
|
@ -327,13 +338,6 @@ ENTRY(track_int13)
|
|||
movl $0x4, %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 %ebx
|
||||
popl %ebp
|
||||
|
@ -407,9 +411,8 @@ int1_handler:
|
|||
jg 8f
|
||||
|
||||
7: /* immediate has a port */
|
||||
xorb %ah, %ah
|
||||
lodsb (%si), %al
|
||||
movw %ax, %dx
|
||||
movzbw %al, %dx
|
||||
|
||||
5: /* %dx has a port */
|
||||
|
||||
|
@ -447,37 +450,6 @@ int1_handler:
|
|||
|
||||
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
|
||||
|
||||
ENTRY(io_map)
|
||||
|
|
|
@ -4061,7 +4061,7 @@ testvbe_func (char *arg, int flags)
|
|||
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)
|
||||
{
|
||||
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;
|
||||
|
||||
if (get_vbe_mode_info (*mode_list | (1 << 14), &mode) != 0x004F)
|
||||
if (get_vbe_mode_info (*mode_list, &mode) != 0x004F)
|
||||
continue;
|
||||
|
||||
/* Skip this, if this is not supported or linear frame buffer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue