Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Apr 1996 01:58:51 +0930 (CST)
From:      Michael Smith <msmith@atrad.adelaide.edu.au>
To:        hackers@freebsd.org
Subject:   DOS emulator; seek linker guru 8)
Message-ID:  <199604101628.BAA24172@genesis.atrad.adelaide.edu.au>

next in thread | raw e-mail | index | archive | help

Hot on the heels of Jordan's little announcement, I'm looking for a 
linker guru (John P?) to resolve the "put the pieces together" part for
the user code.

The scenario is this :  most of the emulator code goes into a module
called "doscmd.kernel".  This has a private crt0.o module, and its
own main() function.  It's linked as :

doscmd.kernel: crt0.o ${OBJS}
	ld -N -T 110000 -o doscmd.kernel ${LDFLAGS} crt0.o ${OBJS} ${LDADD}

This is then loaded by a bootstrapper, "doscmd", that reads the OMAGIC
format kernel in at its load address, and jumps to said start address.
Its built as :

doscmd: doscmd.kernel doscmd_loader.o
	ld -N -o doscmd ${LDFLAGS} /usr/lib/crt0.o doscmd_loader.o ${LDADD}

In both cases:
LDFLAGS+=-L/usr/X11R6/lib
LDADD+=	-lX11 -lc

The former builds (after some work 8) but linking dies thus:
ld -N -T 110000 -o doscmd.kernel  -L/usr/X11R6/lib crt0.o AsyncIO.o ParseBuffer.o bios.o cmos.o config.o cwd.o device.o disktab.o doscmd.o exe.o i386-pinsn.o inout.o int10.o int11.o int12.o int13.o int14.o int15.o int16.o int17.o int1a.o int20.o int21.o int2f.o int33.o intff.o mem.o port.o setver.o signal.o trace.o trap.o tty.o -lX11 -lc
ld: No reference to __DYNAMIC

The second fails with :
cc -O -I/sys -I/usr/X11R6/include -I. -DDISASSEMBLER   -c doscmd_loader.c
ld -N -o doscmd  -L/usr/X11R6/lib /usr/lib/crt0.o doscmd_loader.o -lX11 -lc
doscmd_loader.o: Undefined symbol `___main' referenced from text segment

I'm aware I probably haven't covered enough here for a full answer, but if
anyone can offer any suggestions, I'm keen.  Alternatively, I'll put what
diffs I have somewhere that said enthusiast can get at to alleviate the 
tedium of getting the rest to compile.

-- 
]] Mike Smith, Software Engineer        msmith@atrad.adelaide.edu.au    [[
]] Genesis Software                     genesis@atrad.adelaide.edu.au   [[
]] High-speed data acquisition and      (GSM mobile) 0411-222-496       [[
]] realtime instrument control          (ph/fax)  +61-8-267-3039        [[
]] Collector of old Unix hardware.      "Where are your PEZ?" The Tick  [[



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199604101628.BAA24172>