[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Failed to build grub2

From: Robert Millan
Subject: Re: Failed to build grub2
Date: Thu, 27 Dec 2007 12:00:29 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

On Thu, Dec 27, 2007 at 06:43:22PM +0800, Bean wrote:
> On Dec 27, 2007 5:57 PM, Robert Millan <address@hidden> wrote:
> > Why not force it with .code32 / .code16 ?
> No, you can't use .code32/.code16, it will not cause compile error,
> but the machine code is wrong. However, you can write it like this:
> .byte 0x66, 0x67
> .code32
> leal  0x200 + data_start - data_next(%ebx,%eax), %eax
> .code16
> 0x66 and 0x67 is the DATA32 and ADDR32 prefix, it tell the cpu that
> the next instruction use different registry and address mode. (16-bit
> %ax -> 32-bit %eax, 16-bit address mode to 32-bit address mode).

Uhm I recall seeing macros for that already:

  kern/i386/pc/startup.S:       DATA32  ADDR32  lgdt    gdtdesc

I guess those are telling GAS to generate 0x66 and 0x67?

Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]