[syslinux] Comboot Menu

H. Peter Anvin hpa at zytor.com
Mon Jan 19 14:46:34 PST 2004


ganapathy murali krishnan wrote:
> 
> Some comboot questions:
> 
> How does one allocate memory? Is there a BIOS interrupt to allocate memory?
> 

You don't.  You already have all the memory you're going to get.

For COM (as opposed to COM32) the amount of memory you have to play with
is given by the WORD at offset DS:0002h; this gives the paragraph
("segment") address beyond your memory.  For example, assume:

DS 	 == 5000h
DS:0002h == 7000h

... this means that all the memory between 0x50000 and 0x6ffff inclusive
is for you to play with.  It's your responsibility to set up a
malloc-like system to manage this memory if you need it.

Note that SS:SP will start out as DS:FFFEh (5000:FFFE in this case), so
the stack is smack in the middle of this memory range.

DOS behaves the same way with respect to .COM files.

> Can the comboot api also include an interrupt to allocate some memory?

No.  (In fact, under DOS you have to first *deallocate* the memory you
have already been allocated in order to use any of the allocation APIs.)

> I presume a .COM file can still access memory outside its 64K segment,
> using ES and FS?

Yes; within limits above.

> The simple menu system is working fine as a .COM file and hard coded
> menu entries. Need some memory allocation scheme if I read this stuff
> from a file and if I have to suport submenu's and so forth.

Great!  Hope this helps...

	-hpa




More information about the Syslinux mailing list