Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly x86 > Re: require enc...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 18 Topic 4631 of 4729
Post > Topic >>

Re: require encoding

by "Alexei A. Frounze" <spamtrap@[EMAIL PROTECTED] > Apr 26, 2008 at 01:01 PM

On Apr 26, 7:25 am, "Helge Kruse"  <spamt...@[EMAIL PROTECTED]
> wrote:
> Hello,
>
> I wrote a x86 boot loader a long time ago. One step is to jump form 16
bit to 32 bit segment before entering protected mode.

That's not possible, unless you mean "completing the pmode setup" by
"entering". Flipping CR0.PE does the mode switch, but it's not
complete.

> I found
> that I need the opcode
>
> _BOOT SEGMENT PARA USE16 PUBLIC 'ZZZZ_LINK_REALLY_LAST'
>
>  00000076  66         db 66h   ;----- jmpf cs:pInitCpuFlush -----
>  00000077  2E         db 2Eh   ; CS:
>  00000078  FF 2E      db 0FFh, 2Eh ; JMPF
>  0000007A  0000001E R dd OFFSET pInitCpuFlush
>
> _INIT SEGMENT PARA USE32 PUBLIC 'ZZZ_LINK_AT_LAST'
>
>  0000001E   pInitCpuFlush LABEL FWORD
>  0000001E  000000FC R    dd EnterProtMode
>  00000022  0010     dw GdtCode - GdtNull
>
> That works. When I try to encode this with normal instructions I get
different opcodes:
>
> jmp cs:pInitCpuFlush
>
> 0000007E  67& 66| 2E: FF  jmp cs:pInitCpuFlush
>        2D 0000001E R
>  00000087  67& 66| FF 2D  jmp pInitCpuFlush
>        0000001E R
>  0000008F  67& 66| 2E: FF  jmp fword ptr cs:pInitCpuFlush
>        2D 0000001E R
>  00000098   _BOOT ENDS
>
> Is there any way to write a clean jump to 32 bit segment?
>
> /Helge

I don't know what you mean by clean jump. Are you asking how to write
this jump w/o using db or something else?

I usually use one of the following:
- JMP Ap: opcode 0xEA followed by immediate far pointer
- PUSH selector, PUSH offset, RETF

Alex
 




 18 Posts in Topic:
require encoding
"Helge Kruse"   2008-04-26 16:25:42 
Re: require encoding
"Alexei A. Frounze&q  2008-04-26 13:01:43 
Re: require encoding
"Helge Kruse"   2008-04-27 08:53:22 
Re: require encoding
Mike Gonta <spamtrap@  2008-04-26 15:57:45 
Re: require encoding
Frank Kotler <spamtra  2008-04-27 07:12:10 
Re: require encoding
ArarghMail804NOSPAM <s  2008-04-27 04:16:02 
Re: require encoding
"Helge Kruse"   2008-04-27 08:51:27 
Re: require encoding
"Wolfgang Kern"  2008-04-27 11:21:40 
Re: require encoding
"H. Peter Anvin"  2008-05-13 09:10:22 
Re: require encoding
ArarghMail804NOSPAM <s  2008-04-27 04:15:01 
Re: require encoding
"Alexei A. Frounze&q  2008-04-27 02:58:54 
Re: require encoding
Mike Gonta <spamtrap@  2008-04-27 04:26:48 
Re: require encoding
"Alexei A. Frounze&q  2008-04-27 04:03:20 
Re: require encoding
ArarghMail804NOSPAM <s  2008-04-28 00:49:27 
Re: require encoding
Mike Gonta <spamtrap@  2008-04-27 10:36:53 
Re: require encoding
Mike Gonta <spamtrap@  2008-04-27 10:46:45 
Re: require encoding
Brendan <spamtrap@[EM  2008-04-27 20:11:40 
Re: require encoding
"Alexei A. Frounze&q  2008-04-28 01:52:36 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 15:21:51 CDT 2008.