[syslinux] MEMDISK location in memory

Jeffrey Hutzelman jhutz at cmu.edu
Wed May 15 13:54:53 PDT 2013


On Wed, 2013-05-15 at 20:31 +0000, Martin Osterloh wrote:
> What I am trying to do is booting my OS (incl. custom bootloader) via
> MEMDISK and have the harddisk image in memory (a diskless system so to
> say).
> 
> I found a way to identify the MEMDISK image in memory. I set the size
> of the harddisk image to my liking. While going through my memory map,
> I just look for an unusable chunk of that exact size. Chances are
> pretty low that there is a 2nd chunk of memory with exactly the same
> (odd) size. 
> 
> Probably not the perfect way but it works for me.


MEMDISK supports an interface (actually, three interfaces) that allow
you to reliably obtain this information.  There is an INT 13h
installation check API; you can scan the INT 13h "safe hook" chain for
entries associated with MEMDISK, and you can scan low memory for
MEMDISK's signature.  These interfaces are documented in
doc/memdisk.txt, in the "Additional technical information" section, and
there is example code for all three in dosutil/mdiskchk.c

Using one of these documented interfaces will be much more reliable than
hoping that there turns out to be a memory map entry that exactly
corresponds to your disk image, and less likely to change as the
software evolves in the future.  These are the methods used by the
Windows drivers mentioned in the wiki.

-- Jeff



More information about the Syslinux mailing list