All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Millan <rmh@aybabtu.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: Failed to build grub2
Date: Thu, 27 Dec 2007 12:00:29 +0100	[thread overview]
Message-ID: <20071227110029.GA32072@thorin> (raw)
In-Reply-To: <ca0f59980712270243o7a7381cdl7ec9e27256e7a9fc@mail.gmail.com>

On Thu, Dec 27, 2007 at 06:43:22PM +0800, Bean wrote:
> On Dec 27, 2007 5:57 PM, Robert Millan <rmh@aybabtu.com> 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	other threads:[~2007-12-27 11:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-25  9:41 Failed to build grub2 Francis Gendreau
2007-12-25 11:07 ` Robert Millan
2007-12-25 11:23   ` Francis Gendreau
2007-12-25 11:37     ` Bean
2007-12-26  7:17       ` Robert Millan
2007-12-26 11:13         ` Bean
2007-12-27  9:57           ` Robert Millan
2007-12-27 10:43             ` Bean
2007-12-27 11:00               ` Robert Millan [this message]
2007-12-27 11:07                 ` Bean
2007-12-26  7:15     ` Robert Millan
2007-12-27  6:40       ` Francis Gendreau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071227110029.GA32072@thorin \
    --to=rmh@aybabtu.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.