Windows command size

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
artrecks
Posts: 23
Joined: Wed Jul 11, 2007 8:24 pm

Windows command size

Post by artrecks »

Does cmd.exe has a command size limit?
( I can't execute a command with more than 123 bytes )
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Windows command size

Post by Brendan »

Hi,
artrecks wrote:Does cmd.exe has a command size limit?
( I can't execute a command with more than 123 bytes )
DOS executables expect to find a 256 byte data structure called the PSP before their code, which is constructed by the OS. The command line arguments are stored in this structure as an ASCII string, and the ASCII string is limited to 125 bytes or something.

Stop using DOS... ;)


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
artrecks
Posts: 23
Joined: Wed Jul 11, 2007 8:24 pm

Post by artrecks »

I using DJGPP compiler for Windows and a bat file to compile my files, what could I use???
hanumant
Posts: 21
Joined: Mon Jul 23, 2007 10:16 pm

Post by hanumant »

Switch to cygwin , and make the cross compiler as per the instructions specified in the wiki page, I started with DJGPP but it gave me a lot of grief, so better switch to cygwin . Actually , if you are using a floppy image , then it might be better to switch to linux, you can use mtools to put your kernel image there, mtools is not available for cygwin i think
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Post by jnc100 »

hanumant wrote:mtools is not available for cygwin i think
You could always compile it...

Regards,
John.
artrecks
Posts: 23
Joined: Wed Jul 11, 2007 8:24 pm

Post by artrecks »

ok, i'll try cygwin
thank you very much!
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post by AJ »

Alternatively, you can get quite a long way with filename wildcards (just ensure you link the entry-point file first if you are using flat binaries). You can also use DJGPP's make too...

Cheers,
Adam
artrecks
Posts: 23
Joined: Wed Jul 11, 2007 8:24 pm

Post by artrecks »

I got some problems using Cygwin, I want to know what is the default file format for GCC in Cygwin, since files get bigger than using DJGPPs GCC compiler. =//
hanumant
Posts: 21
Joined: Mon Jul 23, 2007 10:16 pm

Post by hanumant »

I am really not the expert on this. but i think by default it is ELF. Anyways there is a nice page on the wiki, with all linkers and the input and output file formats they support
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post by AJ »

You could try using objdump to find out :)

cheers,
Adam
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Post by jnc100 »

artrecks wrote:I got some problems using Cygwin, I want to know what is the default file format for GCC in Cygwin, since files get bigger than using DJGPPs GCC compiler. =//
By default, gcc in cygwin produces pe-i386 object files, and ld produces pei-i386 executables, PE being the file format used in modern Windows. If you want to target ELF, I suggest you look into building a GCC Cross-Compiler.

Any increase in size you see could be due to any number of reasons, e.g. more complex library functions, more debugging information, different alignment of sections etc.

Regards,
John.
artrecks
Posts: 23
Joined: Wed Jul 11, 2007 8:24 pm

Post by artrecks »

yeah
was that ( the output is PE-i386 )
I'll try using a cross-compiler as you said
Thanks for the reply
bye
Post Reply