• Please review our updated Terms and Rules here

DOS LFN Support - I still don't get it

Shadow Lord

Veteran Member
Joined
Jun 16, 2010
Messages
3,217
Location
California
O.K. I know this has been discussed before but I still don't get it: What does it take for pure DOS to support LFNs? Note that I am not asking about how to make a LFN work on a particular installation of DOS but the general requirements for it? I.E. does it have to be built into the Kernel? The Command Processor (i.e. command.com)? The underlying file system? Something else?

I am guessing it is not the files system because you can create long filenames on FAT12/FAT16 drives (e.g. floppies) with NT. I am also pretty sure the command processor is out because the same command processor will do LFNs sometimes and not other times (e.g. booting to DOS under Win95 has no LFN support but opening a DOS command prompt does).

So what are the prerequisites? Does it have to be built into the Kernel? If so why can't a "modern" DOS (i.e. FreeDOS) just do LFN out of the box w/o loading a TSR?

I am sure I am just overthinking it and it is real simple but... TIA! :eh:
 
Last edited:
Yes, LFN support must be built in to the DOS kernel or added to it via a TSR. On top of that the dos applications you wish to use with long file names must use the LFN APIs. Although the few DOS applications that support long filenames are usually designed to run from within a Windows 9x DOS box. I think the Windows 9x command.com already has the support built in.

If FreeDOS uses a TSR, it is probably to mirror how MS-DOS/Windows 9x does it in order to provide the best compatibility, as well as to save memory since this LFNs are usually not used in real-mode DOS.
 
Thanks for the info. The memory footprint can't be that huge. I don't recall DOS 7.0 (on Win95) booting as a clean floppy having that much less memory available then DOS 6.22. A lot of programs were capable of using LFNs. I am assuming freecom.com (command.com replacement for FreeDOS) supports it as well as command.com, 4DOS, EDIT, Volkov Commander, Norton Utilities to name a few. I think even the MCDEX replacement in FreeDOS will support LFNs... It may not be as important of a feature but would be nice to have in a modern DOS (I know ROM-DOS supposedly does but I have never successfully booted that up) along with an updated network redirector.
 
The memory footprint will be increased. Directories will have many more entries, four times as many if the average file name is 30-39 characters. Internal file name fields have to be increased to 256 bytes. A couple of extra K is all that is needed prevent some programs from launching.

FreeCOM will display a directory with long file names but, when I last checked, would error if trying to use the long file name as a specification. Copy and the other tools only worked when the short file name was used.
 
Thanks for the info. The memory footprint can't be that huge. I don't recall DOS 7.0 (on Win95) booting as a clean floppy having that much less memory available then DOS 6.22. A lot of programs were capable of using LFNs. I am assuming freecom.com (command.com replacement for FreeDOS) supports it as well as command.com, 4DOS, EDIT, Volkov Commander, Norton Utilities to name a few. I think even the MCDEX replacement in FreeDOS will support LFNs... It may not be as important of a feature but would be nice to have in a modern DOS (I know ROM-DOS supposedly does but I have never successfully booted that up) along with an updated network redirector.

a clean boot of DOS 7.0 doesn't provide LFN - the TSR is still required in that case
 
The memory footprint will be increased. Directories will have many more entries, four times as many if the average file name is 30-39 characters. Internal file name fields have to be increased to 256 bytes. A couple of extra K is all that is needed prevent some programs from launching.

FreeCOM will display a directory with long file names but, when I last checked, would error if trying to use the long file name as a specification. Copy and the other tools only worked when the short file name was used.

The LFNDOS TSR (0.42c) uses ~12KB of memory according to the author. Definitely significant for DOS. Although I wonder if it was built into the kernel if the code could be tighter?
 
Back
Top