[syslinux] Comboot Menu

H. Peter Anvin hpa at zytor.com
Fri Jan 23 11:28:05 PST 2004


ganapathy murali krishnan wrote:
> 
> I compile my code into a .obj file, the linker takes this file
> adds some startup code and creates a .COM file. So what we need here is
> some simple assembly code which just jumps to the location of main!
> and sets the origin at 100h.
>
> All my googling only resulted in very high level answers or to
> commercial products. And I have not yet found the reference to ROMable
> applications in Watcom manual.

At least for OpenWatcom 1.1, it's in the "Open Watcom C/C++ User's
Guide", seach for "ROM" and you should find it quite quickly.  The
fourth page in that chapter is called "Modifying the Startup Code".
It's not very useful in itself, but it has a link to a page that
describes where the source code to all the startup files are.  Pretty
much I guess the idea is then take that structure and remove anything
you don't need.

The files are, in particular:

\watcom\src\startup\dos\cstrt086.asm
\watcom\src\startup\dos\cmain086.c
\watcom\src\startup\dos\mdef.inc

> BTW, can gcc generate files in COM format. Then I will have to rewrite
> all the assembly code in a way GCC understands :-( which inturn will
> mean I have to learn the AT&T syntax...., and then hopefully gcc and ld
> together can do the job (generating a 16bit real mode application).

It sort of can, but it sucks eggs.  The way to do it is to compile to
assembly, then put ".code16gcc" at the top of each assembly file.

Note that it doesn't do far pointers in any way.

Early versions of MEMDISK (before I added compression support) were
actually compiled this way, so if you want to hunt for a demo that would
be it.

> Now I am slowly starting to think that all the 1200+ lines of code is
> going to the proverbial bit bucket.:-(

Don't worry, we'll figure this out.  If you hit a wall I can poke around
at it.

	-hpa




More information about the Syslinux mailing list