Mail Archives: djgpp/1998/08/15/06:30:29
I wrote:
>To help with debugging, I would like to link the kernel as
>"coff-go32", use 'nm' to dump all the symbols, _then_ convert it to a
>.COM file.
GEEZ, you people. Must I do everything myself ??? :)
/----- begin makefile -------------
CFLAGS=-c -O2
OBJECTS=krnla.o krnlc.o
krnl.com: $(OBJECTS) link.scr
ld -o krnl.cof -Tlink.scr $(OBJECTS)
echo CAUTION: inaccurate disassembly until _start32 >krnl.lst
objdump --disassemble krnl.cof >>krnl.lst
nm --line-numbers krnl.cof | sort >krnl.sym
objcopy --input-format coff-go32 --output-format binary krnl.cof
krnl.com
krnla.o: makefile krnla.asm
nasm -f aout -o krnla.o krnla.asm
krnlc.o: krnlc.c
gcc $(CFLAGS) krnlc.c
clean:
del *.o
del krnl.com
del krnl.cof
del krnl.lst
del krnl.sym
\----- end makefile -------------
/----- begin link.scr -------------
/* Adapted from /djgpp/lib/djgpp.djl */
OUTPUT_FORMAT("coff-go32")
ENTRY(_start16)
SECTIONS
{ .text 0x100 : /* 0x100 for .COM file */
{ *(.text)
etext = .; _etext = .; }
.data . :
{ *(.data)
edata = .; _edata = .; }
.bss SIZEOF(.data) + ADDR(.data) :
{ *(.bss)
*(COMMON)
end = .; _end = .; }}
\----- end link.scr -------------
Disassembly in krnl.lst, line numbers in krnl.sym. objdump claims
to have a "--source" option but it did nothing.
--
geezer@ | Sales rushes in where
netwurx.net | Engineering fears to tread.
- Raw text -