News for hackers. Stuff that matters.
Re:What's the difference between the com and exe extensions?... by Waterluvian on Saturday May 27, 2017 @10:40AM (#14430239)
So why not do something like make a shim COMMAND.COM that handles compatibility and calls the new COMMAND.EXE?

From my novice view, it seems like it would be generally simpler to reason about.

Re:What's the difference between the com and exe extensions?... by dfox on Saturday May 27, 2017 @10:58AM (#14430324)
Efficiency.

On the platforms DOS was meant for the hundred or so bytes of memory wasted by creating another process (PSP + few bytes for the actual code) was significant so the simple approach of writing trivial .COM that does EXEC(COMMAND.EXE), EXIT is wasteful. DOS does not have exact equivalent of unix-style exec() so replacing the process in memory would involve either adding that to DOS or implementing it in the .COM stub, both approaches have the slight problem that there is no way to guarantee that the block of free memory that was selected by DOS for the .COM stub (and thus starts with the PSP of our process and its starting paragraph is our PID) is large enough so the EXE would fit there.

Also such .COM stub will have to be stored on the disk as separate file which on FAT16 would probably waste most of the used cluster given the expectation that it would be few bytes long stub.

Re:What's the difference between the com and exe extensions?... by imron on Saturday May 27, 2017 @10:46AM (#14430270)
Because then you also need a shim format.com and a shim this.com and that.com and so on.

Much easier just to make the loader check the header.

Re:What's the difference between the com and exe extensions?... by Waterluvian on Saturday May 27, 2017 @10:50AM (#14430290)
Ahh yes. I misunderstood. The loader was modified, not COMMAND.COM, etc.
Re:What's the difference between the com and exe extensions?... by rocky1138 on Saturday May 27, 2017 @03:05PM (#14431427)
I was thinking a symlink would be even easier.
Re:What's the difference between the com and exe extensions?... by ygra on Sunday May 28, 2017 @03:09AM (#14433421)
NTFS gained symlink support in 2007. FAT never had it. If presented with this problem, I'd say changing the executable loader is a better solution to the problem than adding symlink support to the file system.