Page 1 of 1
linking turbo C and nasm object files
Posted: Wed Nov 13, 2002 12:00 am
by iota
hi all can any one segest a free linker that i can link turbo C and nasm Objects into a flat binary format for use as a kernel
thanks in advanced
Leon Pegg
RE:linking turbo C and nasm object files
Posted: Wed Nov 13, 2002 12:00 am
by agafaed
RE:linking turbo C and nasm object files
Posted: Thu Nov 14, 2002 12:00 am
by iota
ok well i have jloc but have no idea how to link the two objecs together into a flat binary do you have a demo at all.
RE:linking turbo C and nasm object files
Posted: Thu Nov 14, 2002 12:00 am
by agafaed
Hi,
command : jloc jlinker.txt kernel.bin
and here is 'jlinker.txt' :
ALL:
kernel.o
gui.o
int86.o
strings.o
stdio.o
START: 0,000000000
,,,START
CODE: 0
,,code
DATA: 0,#10
,,data
BSS: 0,#10
,,bss
All the .o files are tcc or nasm .o files :
tcc -c -ogui.o gui.c
nasm -f obj -oint86.o int86.asm
and so on
RE:linking turbo C and nasm object files
Posted: Thu Nov 14, 2002 12:00 am
by iota
thank you very much for your help.
that has helped me link the grfx os.
a bit about the os.
the os is a real-mode os with grfx interface.
done.
keyboard.
grfx.
text printing.
ToDo.
mouse.
sound cards suport.
ect...
all of this will be in real-mode and we will have suport for loading flat binarys 32 bit and 16 bit binarys.
regards Leon Pegg.
the os site is at
www.danoos.net
RE:linking turbo C and nasm object files
Posted: Sun Nov 17, 2002 12:00 am
by sree
how do u link nasm obj with turbo compiled c code with out above stated jloc preferably using tlink
we tried tlink /c /t /v turbocompiledobj nasmobj
but with out success
RE:linking turbo C and nasm object files
Posted: Mon Nov 18, 2002 12:00 am
by geezer
Assemble to .OBJ format (you already knew that
Any symbol accessed from C must have a leading underscore and must be GLOBAL.
Define all the segments used in the GROUP statement:
SEGMENT _TEXT PUBLIC CLASS=CODE
SEGMENT _DATA PUBLIC CLASS=DATA
SEGMENT _BSS PUBLIC CLASS=BSS
SEGMENT _BSSEND PUBLIC CLASS=BSSEND
Use a GROUP statement:
GROUP DGROUP _TEXT _DATA _BSS _BSSEND ; TINY model
GROUP DGROUP _DATA _BSS _BSSEND ; SMALL model
If you're using the free Turbo C++ 1.0, don't declare any local variables "static const" (to avoid compiler bug).
BTW, you can probably use ALINK if you don't have TLINK.