Linking Turbo C and NASM

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
zxmaster

Linking Turbo C and NASM

Post by zxmaster »

I am writing a 16-bit OS (yeah you can laugh all you want ;)) ... To cut to the chase:
I want to link my Turbo C files with assembr files and produce com files. When I try to do it I get a: "Fixup owerflow error" from the linker. I am using Turbo C 2.01. Appereantly everything is fine if I try to produce a DOS exe file, but not when I try to make a com file. I assembled the asm file into OBJ before trying to link it.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Linking Turbo C and NASM

Post by Pype.Clicker »

are you using the proper memory model (tiny, iirc) ?

There are also tools like "exe2com" (or is it exe2bin ? can't tell) which you can find helpful since i cannot remember whether TLINK can create .COM files ...
zxmaster

Re:Linking Turbo C and NASM

Post by zxmaster »

Yes I used the tiny memory model. I have also tried exe2bin to no avail. But if I do not find out how to do it I might as well write an exe-loader. Oh, and Tlink claims to be able to produce .com files.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Linking Turbo C and NASM

Post by Pype.Clicker »

that 'fixup overflow' might come from addresses going over 16 bits ... not 100% sure, though.

if you're looking for .EXE bootloader, make sure you don't miss bootprog: it sounds to be _the_ reference here.

You may also try to write your own tool to modify .EXE into something more suitable to bootloading (you know: it's always easier to process complex fileformat from a complete OS than from bootsectors :) ), in which case, clicker freedosexe2bin sources might be handy.

<oops>
clicker's tool is mzexe ... not 'exe2bin'[/url]
</oops>
zxmaster

Re:Linking Turbo C and NASM

Post by zxmaster »

Thanks a lot for the help.
I am not going to write an exe-bootloader though as most of the OS I have written until now is 100% assembly(yeah I know it's not that cool, just makes things harder) . I was just going to use it for loading programs, but it seems like it would be a good idea to write an exe-loader.
zxmaster

Re:Linking Turbo C and NASM

Post by zxmaster »

On second thought I think I am going to re-write my OS to EXE-format because it makes it possible to write parts i C. And thx for the link to bootprog it looks really useful.
Post Reply