All of lore.kernel.org
 help / color / mirror / Atom feed
* gate A20 and i386-qemu port
@ 2009-11-14 10:59 Robert Millan
  2009-11-14 12:48 ` Vladimir 'phcoder' Serbinenko
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Millan @ 2009-11-14 10:59 UTC (permalink / raw)
  To: grub-devel


I'm wondering how come the i386-qemu port works if none of its
initialization code takes into account gate A20.  Does this
mean it's supposed to be already disabled in initial CPU state,
and only enabled by BIOS?

Or maybe the code only works by chance and would break unexpectedly
in specific situations?

-- 
Robert Millan



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gate A20 and i386-qemu port
  2009-11-14 10:59 gate A20 and i386-qemu port Robert Millan
@ 2009-11-14 12:48 ` Vladimir 'phcoder' Serbinenko
  2009-11-14 15:38   ` Robert Millan
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-11-14 12:48 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 718 bytes --]

Robert Millan wrote:
> I'm wondering how come the i386-qemu port works if none of its
> initialization code takes into account gate A20.  Does this
> mean it's supposed to be already disabled in initial CPU state,
> and only enabled by BIOS?
>
> Or maybe the code only works by chance and would break unexpectedly
> in specific situations?
>
>   
Without disabling A20 even and odd mibibytes will be squashed together.
Following code can check A20:
*((volatile grub_uint8_t *) 0x200000) = 0;
*((volatile grub_uint8_t *) 0x300000) = 1;
if (*((volatile grub_uint8_t *) 0x200000))
  grub_printf ("Expect bugs\n");
else
  grub_printf ("You're safe\n");

-- 
Regards
Vladimir 'phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 293 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gate A20 and i386-qemu port
  2009-11-14 12:48 ` Vladimir 'phcoder' Serbinenko
@ 2009-11-14 15:38   ` Robert Millan
  2009-11-14 17:26     ` Robert Millan
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Millan @ 2009-11-14 15:38 UTC (permalink / raw)
  To: The development of GNU GRUB

On Sat, Nov 14, 2009 at 01:48:00PM +0100, Vladimir 'phcoder' Serbinenko wrote:
> Robert Millan wrote:
> > I'm wondering how come the i386-qemu port works if none of its
> > initialization code takes into account gate A20.  Does this
> > mean it's supposed to be already disabled in initial CPU state,
> > and only enabled by BIOS?
> >
> > Or maybe the code only works by chance and would break unexpectedly
> > in specific situations?
> >
> >   
> Without disabling A20 even and odd mibibytes will be squashed together.
> Following code can check A20:
> *((volatile grub_uint8_t *) 0x200000) = 0;
> *((volatile grub_uint8_t *) 0x300000) = 1;
> if (*((volatile grub_uint8_t *) 0x200000))
>   grub_printf ("Expect bugs\n");
> else
>   grub_printf ("You're safe\n");

Yeah, in fact we have gate_a20_check_state() to check for this, but only
in i386-pc.

I find it surprising that i386-qemu works at all without it.  I guess it
only works because the high mem area that would overlap with our code in
0x8200 is never used.

I'll look into this...

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gate A20 and i386-qemu port
  2009-11-14 15:38   ` Robert Millan
@ 2009-11-14 17:26     ` Robert Millan
  0 siblings, 0 replies; 4+ messages in thread
From: Robert Millan @ 2009-11-14 17:26 UTC (permalink / raw)
  To: The development of GNU GRUB

On Sat, Nov 14, 2009 at 04:38:22PM +0100, Robert Millan wrote:
> > Following code can check A20:
> > *((volatile grub_uint8_t *) 0x200000) = 0;
> > *((volatile grub_uint8_t *) 0x300000) = 1;
> > if (*((volatile grub_uint8_t *) 0x200000))
> >   grub_printf ("Expect bugs\n");
> > else
> >   grub_printf ("You're safe\n");
> 
> Yeah, in fact we have gate_a20_check_state() to check for this, but only
> in i386-pc.
> 
> I find it surprising that i386-qemu works at all without it.  I guess it
> only works because the high mem area that would overlap with our code in
> 0x8200 is never used.
> 
> I'll look into this...

It appears that QEMU hardware already starts with A20 enabled.  I suppose it's
bochsbios who disables it.  In any case, I made my vbe-on-coreboot branch
enable it.

Unfortunately, this wasn't the cause that prevented vbetest/vbeinfo from
working :-/

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-11-14 17:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-14 10:59 gate A20 and i386-qemu port Robert Millan
2009-11-14 12:48 ` Vladimir 'phcoder' Serbinenko
2009-11-14 15:38   ` Robert Millan
2009-11-14 17:26     ` Robert Millan

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.