Asking for suggestions

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
xiaofeng

Asking for suggestions

Post by xiaofeng »

I develope my mini os using DJGPP on windows.
When i input command line"ld -T link.ld -o kernel.bin start.o main.o .....(16 .o files in total)",it tells me "System can't execute the specific program".I also try on Cygwin,which tells
me "Invalid argument".
Please give me some suggestions to make me continue my work.
AR

Re:Asking for suggestions

Post by AR »

You may have exceeded the maximum commandline length, to get around it you'll need to use the archive tool (ar) to combine the packages or use a 32bit compiler which will have a longer commandline.
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:Asking for suggestions

Post by Pype.Clicker »

do you call cygwin's linker from DOS command line ? or from cygwin's shell ?

Either you actually have one of your .o files that has wrong format, or your command line is too long -- for the shell, not for LD which could happily handle dozens more of files. You can indeed use AR to pack .o files together, or you can just use "ld ... *.o", then making explicit reference to "start.ko" in your linker script to make sure it bypasses the completion's ordering ...
AR

Re:Asking for suggestions

Post by AR »

DOS Program's commandline (ie. DJGPP) have a 127 character limit whereas a 32bit build (Cygwin, MinGW, cross-compiler, etc) has a limit of about 32767 characters.
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:Asking for suggestions

Post by Pype.Clicker »

AR wrote: DOS Program's commandline (ie. DJGPP) have a 127 character limit whereas a 32bit build (Cygwin, MinGW, cross-compiler, etc) has a limit of about 32767 characters.
Yeah, true, yet he mentions "invalid argument" reported by cygwin ...
xiaofeng

Re:Asking for suggestions

Post by xiaofeng »

Thanks very much!
I also resolved it several hours ago.I write a Makefile,and use the make tool of Djgpp.This method can bypass the length limit of Dos command line.
Post Reply