LD and DOS Error

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
Tolga

LD and DOS Error

Post by Tolga »

Hi. I have more libraries for kernel.

ld setupasm.o setup.o video.o system.o fdc.o dma.o dtables.o pit.o maths.o -o SETUP.BIN -Ttext 0x8000 -e _main --oformat binary -N

But when i want to run this command, dos is showing an error:

"System can not run this program".

Future, i will have more libraries. How can solve this problem?
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:LD and DOS Error

Post by Solar »

I am not sure what the problem is, here. Assert that ld is in your command path (by calling 'ld -v'), and that it isn't because you placed the files first and the options last (by reordering your command line).

If DOS is really that brain-damaged that it cannot handle a command line as short as this one, you might want to use 'ar' to create a link library. (See ar documentation, it's part of binutils.)
Every good solution is obvious once you've found it.
JAAman

Re:LD and DOS Error

Post by JAAman »

If DOS is really that brain-damaged that it cannot handle a command line as short as this one
DOS should not be the problem, i dont know what your running, but real DOS supports 180 character commandline (this limit is required by CP/M style applications -- aka ".com" files, which allocate 180 bytes for passing the commandline to the application) later versions of DOS, and DOS emulators in win95+ support an even longer commandline -- i have, however, heard that DJGPP has an artificial limit on the commandline -- im not sure what it is though
blip

Re:LD and DOS Error

Post by blip »

I though the limit on command line length was 128 bytes including the length byte, string, and terminator. At least this must be the case for .COM files since running past offset 100h would cause headaches.
Tolga

Re:LD and DOS Error

Post by Tolga »

So, I will write keyboard header file and add it to "ld" command. What can i do? (Im using WinXP, LD is last version.)
jgmorford

Re:LD and DOS Error

Post by jgmorford »

If parameter length is your problem, why not use a response file to specify your input libraries?
Tolga

Re:LD and DOS Error

Post by Tolga »

But how? I didn't use it. Is there any example?
jgmorford

Re:LD and DOS Error

Post by jgmorford »

If your linker script is named Linker.txt:

->LD -T Linker.txt


Here's one for an OS I was messing around with a couple years back:

Code: Select all

INPUT(Lib\crt0.o)
INPUT(Lib\EnvPhMem.o Lib\x86-32\envInit.o)
INPUT(Lib\x86-32\EnvVtMem.o)
INPUT(Lib\x86int.o Lib\x86mem.o Lib\x86gdt.o)
INPUT(Lib\x86-32\kstdlib.o)
INPUT(Lib\EnvMem.o Lib\EnvCore.o Lib\EnvLib.o)
INPUT(Lib\sysbase.o Lib\KernelASM.o)
INPUT(Lib\stdio.o Lib\stdlib.o Lib\string.o)
INPUT(Lib\KeyBoard.o Lib\Video_Text.o)
INPUT(Lib\Diskette.o Lib\Timer.o)
INPUT(Lib\FAT.o)



ENTRY(_crt0)
OUTPUT(Bin\EnvCore.sys)
OUTPUT_FORMAT(binary)

SECTIONS
{
    . = 0x00100000;
    .text : { *(.text) }
    .data : { *(.data) }
    .bss  : { *(.bss)  }
    _Env_EndImage = .;
}
JAAman

Re:LD and DOS Error

Post by JAAman »

blip wrote: I though the limit on command line length was 128 bytes including the length byte, string, and terminator. At least this must be the case for .COM files since running past offset 100h would cause headaches.
oops -- your right, the CP/M limit is less than 128 (112 seems right, but i cannot remember for sure, and i cannot find my books...), not 180 (DOS files have no problem with much longer commandlines, and i believe 180 was the limit within real DOS -- at least version 4+)
Post Reply