On Monday, March 1, Giuseppe Magnotta wrote:
>
> +/*
> + * Author: Giuseppe Magnotta <[email protected]>
While I applaud your efforts to send in patches, I do have a
small niggle. Why do you feel the need to splatter your
authorship all over the code in comments? Why not just add
your name to the copyright statement and be done with it?
> + * Enable the gate A20 by using the INT 15/AX=2401h if the
> + * BIOS supports it.
> + *
> + * Returns 0 if ok or the error code fetched from AH register.
I did consider (and try) to use this BIOS function way back when
I wrote a good chunk of this code. Turns out that most BIOSen do
not implement this function. Also, I've yet to meet a BIOS/system
that needs this function (IE: has A20 off, and does not use one of
the two methods we have to turn it on).
> +static __inline int
> +enableA20Gate(void)
> +{
> + char status;
> + short r;
> +
> + __asm __volatile(DOINT(0x15) "\n\t"
> + "setc %1\n\t"
> + : "=a" (r), "=r" (status)
> + : "0" (0x2401)
> + : "cc");
> +
> + if (status)
> + return (r >> 8);
> + else
> + return 0;
> +}
>
> /*
> * "Probe"-style routine (no parameters) to turn A20 on
> @@ -58,7 +83,9 @@
> void
> gateA20(int on)
> {
> - if (ps2model == 0xf82 ||
> + if (enableA20Gate() == 0) {
> + /* gate A20 enabled! */
> + } else if (ps2model == 0xf82 ||
> (inb(IO_KBD + KBSTATP) == 0xff && inb(IO_KBD + KBDATAP) == 0xff))
> {
> int data;
Do you know of a system that benefits from this? In other words, does
this fix a system currently not working?
--Toby.