[syslinux] Re: [Freedos-devel] Problem with FreeDOS + himem64 + PXELINUX + memdisk

H. Peter Anvin hpa at zytor.com
Tue Jan 27 14:48:20 PST 2004


Patrick J. LoPresti wrote:
> I believe I have solved my own problem.
> 
> (I am CC'ing syslinux at zytor.com for complete archives, but please
> direct additional followups to freedos-devel since this is definitely
> not a SYSLINUX problem.)
> 
> 
> This patch uses the BIOS (INT15/AX=2400 and 2401) interface to
> enable/disable A20.  With this additional patch, everything works
> flawlessly on my T20.
> 
> ...but it breaks on my Optiplex GX200, presumably because its BIOS
> does not support INT15/AX=2400.
> 
> The ultimate solution, in my opinion, is to steal all of the logic
> from memdisk (init32.asm) for doing A20 switching.  The logic goes:
> 
>   1) See if there is no A20 gate; if so, use NOOP to disable/enable
>      A20
> 
>   2) See if the BIOS interface works (INT15/AX=2401); if so, use that.
> 
>   3) See if the keyboard controller mechanism works (this is the
>      mechanism himem64.exe currently uses always); if so, use that.
> 
>   4) See if the "fast A20 gate" mechanism works; if so, use that.
> 
>   5) Retry steps 1-4 255 times...
> 
>   6) ...if that does not work, bomb out.
> 
> I believe himem64.exe would support the widest variety of systems if
> it incorporated all of this logic.  But steps (2) and (3) are
> mandatory for me.  I believe the BIOS interface is superior to using
> PS/2 switching, since according to Ralf Brown's Interrupt List later
> PS/2s support the BIOS interface anyway.
> 

PS/2s, yes, but there are a fair number of machines which have the 92h
gate but no BIOS support.  Pathetic, isn't it?  But yes, the BIOS
interface should always be the first choice, for the simple reason that
it's customized for each platform.  In fact, I would recommend that if
INT 15h doesn't work that HIMEM[64] installs its own service routine for
these interrupts, so that everyone is "on the same page" with how to
frob A20 should it be necessary.

What's worse, though, is that there are machines which use port 92h for
completely unrelated purposes - on at least one machine it actually
turned off the video card.

Anyway, from the above and other posts it's trivial to see what the
problem is: running with DOS in HMA, MEMDISK gets invoked with A20
enabled.  HIMEM64 disables it, and then the machine crashes when MEMDISK
returns to the FreeDOS kernel.  This is clearly suboptimal :)

Since MEMDISK might be invoked in V86 mode, for example if EMM386.EXE is
loaded, MEMDISK cannot control the A20 gate itself.  This is the reason
MEMDISK uses INT 15h when SYSLINUX doesn't.

	-hpa




More information about the Syslinux mailing list