Re: i386 boot & mm gurus' advice needed (int 0x15/0xE820 support)

H. Peter Anvin (hpa@transmeta.com)
16 Nov 1998 22:25:01 GMT


Followup to: <Pine.GSO.4.05.9811161515370.12065-100000@aaricia>
By author: Cyrille Chepelov <chepelov@rip.ens-cachan.fr>
In newsgroup: linux.dev.kernel
>
> On Mon, 16 Nov 1998, Martin Mares wrote:
>
> > >
> > > I actually tried the place at 0x400 -- it did froze at boot (wonder why
> > > :-))
> >
> > I meant using it as a final destination -- first fetch it to some
> > temporary buffer and then move it there -- see do_move in setup.S.
>
> Huh, ah, yes, now I understand better.
> Now I just got to find a kilobyte somewhere in lowmem which wouldn't break
> bzImage or simple zImage (how about end_low_memory - 1k ?), query
> in15/E820, and after do_move in setup.S, copy that buffer down to
> (PARAM + 0x400). Right ?
>
> -- Cyrille
>

Basically. The memory from 0x600 to 0xfff should be safe to use; the
kernel doesn't trash the zero-page because emulators need the
BIOS-info, but the BIOS-info ends at 0x5ff. Other than that, most of
the communication between setup and the kernel is done by overwriting
the boot sector at 0x90000, there may be enough space there after the
command line buffer.

Note that there are no less than four (4) BIOS interfaces to query
memory: INT 15h, AH=88h (this is the infamous 64MB limit, but is all
that is available on some old machines); INT 15h AX=E801h (currently
used on newer kernels), INT 15h AX=E802h (not widely used), and INT
15h AX=E820h (the latest whiz-bang call.) Since the latter is a
proper superset of the others, the right thing to do is probably to
make setup.S try the different BIOS queries, but pass the data to the
kernel in a single format (compatible with INT 15h AX=E820h).

-hpa

-- 
    PGP: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD  1E DF FE 69 EE 35 BD 74
    See http://www.zytor.com/~hpa/ for web page and full PGP public key
        I am Bahá'í -- ask me about it or see http://www.bahai.org/
   "To love another person is to see the face of God." -- Les Misérables

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/