From: Mike Gonta on
On May 8, 4:13 am, James Harris <james.harri...(a)googlemail.com> wrote:

> IIRC port 0x92 (fast a20) is not safe to use on all machines.

Hi James,

Those are probably old hard to find machines.

> Does the code carry out some sort of check before it tries the port?

I've seen no examples of checking first and am not aware of the
method.
I've seen examples of checking first if the A20 is enabled, but I'm
assuming it is not enabled in the boot sector. Also many of the A20
examples only write to port 92h, while port_92_A20 in rm2pm.asm
first reads the port value, modifies bit 1 and then writes it back,
there
shouldn't be any issues setting or clearing port bits that are already
set or cleared.

> Port 0x60 is slower but, IIRC, it is easier to verify its existence.

Even with a timeout value of 64K loops on a slow machine it's not
noticeable on boot up. I think the slowness concern is that it was
being used on all mode switches whereas pdBIOS32 only enables
the A20 and leaves it enabled when switching to real mode as
that aspect of compatibility is not required by the BIOS.

In the latest release (pdBIOS32 20100508.02.img) I have re-ordered
the A20 methods so that port_60_A20 is executed first, which
leaves port_92_A20 as a backup for PC's with no KB controller.


Mike Gonta
look and see - many look but few see

http://mikegonta.com/pdBIOS32

From: James Harris on
On 8 May, 19:58, Mike Gonta <mikego...(a)gmail.com> wrote:
> On May 8, 4:13 am, James Harris <james.harri...(a)googlemail.com> wrote:
>
> > IIRC port 0x92 (fast a20) is not safe to use on all machines.
>
> Hi James,
>
> Those are probably old hard to find machines.
>
> > Does the code carry out some sort of check before it tries the port?
>
> I've seen no examples of checking first and am not aware of the
> method.
> I've seen examples of checking first if the A20 is enabled, but I'm
> assuming it is not enabled in the boot sector. Also many of the A20
> examples only write to port 92h, while port_92_A20 in rm2pm.asm
> first reads the port value, modifies bit 1 and then writes it back,
> there
> shouldn't be any issues setting or clearing port bits that are already
> set or cleared.
>
> > Port 0x60 is slower but, IIRC, it is easier to verify its existence.
>
> Even with a timeout value of 64K loops on a slow machine it's not
> noticeable on boot up. I think the slowness concern is that it was
> being used on all mode switches whereas pdBIOS32 only enables
> the A20 and leaves it enabled when switching to real mode as
> that aspect of compatibility is not required by the BIOS.
>
> In the latest release (pdBIOS32 20100508.02.img) I have re-ordered
> the A20 methods so that port_60_A20 is executed first, which
> leaves port_92_A20 as a backup for PC's with no KB controller.

A20 is an old chestnut, isn't it. A while ago I collected notes on a
number of the above issues. I'll look them out and if they seem worth
sharing I'll post to alt.os.development.

James