lkml.org 
[lkml]   [2003]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Use correct x86 reboot vector
From
Date
[following up to myself]

Christer Weinigel <christer@weinigel.se> writes:

> Well, it should be possible to use a trick similar to the BIG REAL or
> UNREAL mode. Just load CS with a segment that has a base of
> 0xffff0000 in protected mode and then jump back to real mode.
> Something like this, completely untested of course, should do it:
>
> .align 4
> reset_gdt:
> .word reset_gdt_end - reset_gdt -1
> .long reset_gdt
> .word 0
>
> /* 16 bit code segment starting at 0xffff0000 */
> .word 0xffff, 0x0000
> .byte 0xff, 0x9b, 0x00, 0xff

better add the following too:

move.l %cr0, %eax
and.l $~1, %eax
move.l %eax, %cr0

> reset_gdt_end:
>
> lgdt %cs:reset_gdt
> ljmp $ROM_CODE_SEG, 0xfff0

BTW, what does Windows do here? Whatever Windows is using should work
with Linux too.

/Christer

--
"Just how much can I get away with and still go to heaven?"

Freelance consultant specializing in device driver programming for Linux
Christer Weinigel <christer@weinigel.se> http://www.weinigel.se
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:35    [W:1.586 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site