Fixed restoring segment descriptors in prot_to_real(). The descriptors
must have limit 0xffff and attribute G = 0 (byte granularity) as well as other properties that they already had (see e.g., the Intel i486 manual section 22.5). Not restoring them broke Ctrl-Alt-Del in the bootstrap for my ASUS P55TP4XE system, probably because the Award BIOS does anti-tracing stuff involving inaccessible %esp's. asm.S: Don't use lret in prot_to_real(). This reduces the risk of using an incompletely intialized stack segment and saves space. Submitted by: "K.Higashino" <a00303@cc.hc.keio.ac.jp> (on 13 Jan 1995!) reworked by me
This commit is contained in:
parent
e522d8a28f
commit
c50f3ecf5a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=14412
@ -24,7 +24,7 @@
|
||||
* the rights to redistribute these changes.
|
||||
*
|
||||
* from: Mach, Revision 2.2 92/04/04 11:34:13 rpd
|
||||
* $Id: asm.S,v 1.5 1994/10/06 09:41:01 rgrimes Exp $
|
||||
* $Id: asm.S,v 1.6 1995/01/25 21:37:36 bde Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -116,16 +116,17 @@ xprot:
|
||||
|
||||
ENTRY(prot_to_real)
|
||||
|
||||
/* set up a dummy stack frame for the second seg change. */
|
||||
movw $BOOTSEG, %ax
|
||||
pushw %ax
|
||||
movw $xreal, %ax /* gas botches pushw $xreal, extra bytes 0, 0 */
|
||||
pushw %ax /* decode to add %al, (%eax) (%al usually 0) */
|
||||
/* Prepare %ax while we're still in a mode that gas understands. */
|
||||
movw $0x30, %ax
|
||||
|
||||
/* Change to use16 mode. */
|
||||
ljmp $0x28, $x16
|
||||
|
||||
x16:
|
||||
|
||||
mov %ax, %ds
|
||||
mov %ax, %ss
|
||||
mov %ax, %es
|
||||
|
||||
/* clear the PE bit of CR0 */
|
||||
mov %cr0, %eax
|
||||
data32
|
||||
@ -134,12 +135,12 @@ x16:
|
||||
|
||||
/*
|
||||
* make intersegment jmp to flush the processor pipeline
|
||||
* using the fake stack frame set up earlier
|
||||
* and reload CS register
|
||||
*/
|
||||
lret
|
||||
|
||||
data32
|
||||
ljmp $BOOTSEG, $xreal
|
||||
xreal:
|
||||
|
||||
/*
|
||||
* we are in real mode now
|
||||
* set up the real mode segment registers : DS, SS, ES
|
||||
|
@ -24,7 +24,7 @@
|
||||
* the rights to redistribute these changes.
|
||||
*
|
||||
* from: Mach, Revision 2.2 92/04/04 11:36:43 rpd
|
||||
* $Id: table.c,v 1.7 1995/05/30 07:58:36 rgrimes Exp $
|
||||
* $Id: table.c,v 1.8 1995/06/25 14:02:57 joerg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -86,9 +86,9 @@ struct seg_desc Gdt[] = {
|
||||
{0xFFFF, RUN, RUN, 0x9E, 0x40, 0x0}, /* 0x18 : boot code */
|
||||
{0xFFFF, RUN, RUN, 0x92, 0x40, 0x0}, /* 0x20 : boot data */
|
||||
{0xFFFF, RUN, RUN, 0x9E, 0x0, 0x0}, /* 0x28 : boot code, 16 bits */
|
||||
{0xFFFF, 0x0, 0x0, 0x92, 0x0, 0x0}, /* 0x30 : boot data, 16 bits */
|
||||
#ifdef BDE_DEBUGGER
|
||||
/* More for bdb. */
|
||||
{}, /* BIOS_CS_INDEX = 6 : null */
|
||||
{}, /* BIOS_TMP_INDEX = 7 : null */
|
||||
{}, /* TSS_INDEX = 8 : null */
|
||||
{0xFFFF, 0x0, 0x0, 0xB2, 0x40, 0x0}, /* DS_286_INDEX = 9 */
|
||||
|
Loading…
Reference in New Issue
Block a user