[OpenBIOS] Re: [fb-d] Mixing 16 and 32 bits code

Johan Rydberg johan.rydberg at netinsight.se
Wed May 17 15:29:07 CEST 2000


Ollie Lho wrote:
> 
> Ronald,
>         It seems that you made some mistake in mixing 16
> and 32 bits code in the intel_start32.S:
> 
> _realstart:
>         cli
>         movw    %cs, %eax
>         movw    %eax, %es
> 
>         xor  %eax, %eax
>         mov  %eax, %cr3    /* Invalidate TLB*/
> 
>         .byte 0x66 /* prefix */
>         .byte 0x26
>         .byte 0x0f, 0x01, 0x16 /* lgdt [es:offset]*/
>         .word 0x02      /* offset in segment */
> 
>         movl    %cr0, %eax
>         andl    $0x7FFAFFD1, %eax    /* PG,AM,WP,NE,TS,EM,MP = 0*/
>         orl     $1, %eax
>         movl    %eax, %cr0
>         data32
>         ljmp    $0x10, $.Lprotected
> 
> Before _realstart there was a .code16 directive, so it should be in 16
> bits mode, so how could those 32 bits (long) operation works ??

The compiler (assembler) adds 32-bit prefix to the insn.

-- 
Johan Rydberg			johan.rydberg at netinsight.net
Net Insight AB, Sweden		direct: +46-8-685 04 17
http://www.netinsight.net	phone:  +46-8-685 04 00
				fax:    +46-8-685 04 20
-
To unsubscribe: send mail to majordomo at freiburg.linux.de
with 'unsubscribe openbios' in the body of the message



More information about the openbios mailing list