linking turbo C and nasm object files

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
iota

linking turbo C and nasm object files

Post 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
iota

RE:linking turbo C and nasm object files

Post 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.
agafaed

RE:linking turbo C and nasm object files

Post 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
iota

RE:linking turbo C and nasm object files

Post 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
sree

RE:linking turbo C and nasm object files

Post 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
geezer

RE:linking turbo C and nasm object files

Post 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.
Post Reply