DIR: don't display invalid data with devices
When doing `DIR NUL` findfirst will actually return success
with an attribute indicating a device exists with that name.
MS-DOS shows 'File not found' in this case, but FreeCOM
(and also Comcom64) can display invalid data, so let's
correct that. Since the required constant FA_DEVICE isn't
always present in `dos.h`, let's define it when necessary.
[https://github.com/FDOS/freecom/issues/181]
Before (C: is MFS, D: is FAT16):
~~~
C:\>dir nul
Volume in drive C is IR DXXXXS C
Directory of C:\
NUL 0 10-30-25 6:55p
1 file(s) 0 bytes
0 dir(s) 49,839 Mega bytes free
C:\>d:
D:\>dir nul
Volume in drive D has no label
Volume Serial Number is 4A09-DBB4
Directory of D:\
NUL 0 10-30-25 6:55p
1 file(s) 0 bytes
0 dir(s) 42,698,752 bytes free
~~~
With patch (C: is MFS, D: is FAT16):
~~~
C:\>dir nul
Volume in drive C is IR DXXXXS C
Directory of C:\
File not found.
C:\>d:
D:\>dir nul
Volume in drive D has no label
Volume Serial Number is 4A09-DBB4
Directory of D:\
File not found.
~~~
Recent Commits to freecom:master
-
DIR: don't display invalid data with devices
-
support up to LASTDRIVE=32 (lDOS or patched MS-DOS v7)
support up to LASTDRIVE=32 (lDOS or patched MS-DOS v7) Changing to a drive or running DIR with only a drive letter and colon didn't work. (DIR with drive letter, colon, backslash did work already.) Without this patch applied: C:\>]: Bad command or filename - "]:". C:\>dir ]: File not found. - ']:' C:\>dir ]:\ Volume in drive ] is SRDXMS 2.10 Directory of ]:\ LDEBUG COM 94,208 09-19-25 6:35p 1 file(s) 94,208 bytes 0 dir(s) 948,224 bytes free With this patch applied: C:\>]: ]:\>dir ]: Volume in drive ] is SRDXMS 2.10 Directory of ]:\ LDEBUG COM 94,208 09-19-25 6:35p 1 file(s) 94,208 bytes 0 dir(s) 948,224 bytes free -
CI: Update Linux runner to 24.04
CI: Update Linux runner to 24.04
-
termhook.asm: help debugging by running an int3 in I_AM_DEAD_loop
termhook.asm: help debugging by running an int3 in I_AM_DEAD_loop
-
CI: Force lower case when unzipping (#176)
CI: Force lower case when unzipping (#176) Sometimes DOS packages can have upper or mixed case filenames that Linux unzip doesn't recognise as needing downcasing.
-
Import textual fixes from fd-nls [closes #174] (#175)
Import textual fixes from fd-nls [closes #174] (#175) Part of patch ~~~ commit 01c4ad0a496797e74fccee2e5ae61244f8e4e641 Author: Sebastian Rasmussen <sebras@gmail.com> Date: Thu Apr 10 00:21:02 2025 +0200 Fix typos in the original English files for many projects. ~~~ -
add /D option to FOR command to look for directories instead of files…
add /D option to FOR command to look for directories instead of files matching the "set" file specifiers e.g. to list all directories: FOR /D %a in (*.*) DO ECHO %a
-
use head instead of stack for recursive delete, avoid stack corruptio…
use head instead of stack for recursive delete, avoid stack corruption on really nested directory structure
-
increase size of heap from 6KB to 8KB for build.sh also
increase size of heap from 6KB to 8KB for build.sh also
-
DBCS: handle DBCS for "mkdir /p" and "rmdir /s"
DBCS: handle DBCS for "mkdir /p" and "rmdir /s" (cherry picked from commit b231e93802276bf67357a05a1a191a5696b8df6b)
-
patchsize should attempt to patch FreeCom build regardless of compile…
patchsize should attempt to patch FreeCom build regardless of compiler that builds tool which may not match compiler that built exe being patched.
-
dir.c: allow 21.7303 to return NC, ax=0 to mean supported (EDR-DOS)
dir.c: allow 21.7303 to return NC, ax=0 to mean supported (EDR-DOS) EDR-DOS returns NC, AX = 0000h from 21.7303. This was incorrectly detected as "not supported" here. CF unchanged and AL = 00h is the typical error return, albeit CF unchanged AX unchanged has also been observed (on dosemu2 + lDOS + SRDISK). Reference on the correct "unsupported" return: https://sourceforge.net/p/freedos/mailman/message/59128382/ Incorrect interrupt list entry: https://fd.lod.bz/rbil/interrup/dos_kernel/217303.html
-
set CY before calling 21.71 or 21.73 DOS functions (LFN, FAT32)
set CY before calling 21.71 or 21.73 DOS functions (LFN, FAT32) Between the current lDOS kernel (which doesn't support 21.73), SRDISK, and dosemu2 revision 6a2f4f527 the return from 21.7303 somehow is with both Carry Flag and AX preserved. This makes the DIR command think that the call is supported when it isn't. The proper check is to call with CY set before the call.
-
increase size of heap from 6KB to 8KB
increase size of heap from 6KB to 8KB (size based on discussions on FreeDOS mailing list, TODO validate actual size used and see if can be semi-automated to ensure adjusted up or down as actually required)
-
loadhigh.c: put maximum array sizes in defines and check for overflow
loadhigh.c: put maximum array sizes in defines and check for overflow
-
loadhigh.c: no record UMB region if excluded UMCB is Z and empty
loadhigh.c: no record UMB region if excluded UMCB is Z and empty
-
loadhigh_prepare: support lDOS S MCB of type 30h (excluded UMA)
loadhigh_prepare: support lDOS S MCB of type 30h (excluded UMA)
-
loadhigh_prepare: accept empty MCBs (memory block size zero)
loadhigh_prepare: accept empty MCBs (memory block size zero) Broke LH on lDOS, reference: https://github.com/FDOS/freecom/issues/166
-
loadhigh_prepare: on MCB allocation error do not leak memory
loadhigh_prepare: on MCB allocation error do not leak memory
-
fix recursive remove dir
fix recursive remove dir
-
mcb_walk.c: try querying UMB link state even if not on DOS 5+
mcb_walk.c: try querying UMB link state even if not on DOS 5+ Current lMS-DOS still reports its version as v4.00 but does fully support a DOS-managed UMA. As of today lMS-DOS also supports the SHELLHIGH= directive. Like FreeDOS's this is implemented using the 21.4B80 extension. Although the internals differ, the outside observable behaviour is the DOS executable loader allocates both the environment and the process memory block into the UMA, if there are free UMBs. However, unlike LH the UMB link state is not enabled once the control flow is passed to the application. That means an environment block in a UMB isn't reachable when walking the MCBs without regard to proceeding past the first UMCB. The MCB walker is used in FreeCOM's init to validate the environment block passed to it upon its startup. Reference: https://github.com/FDOS/freecom/blob/cede733377c454cb93e9038d476582f0d1fcbf0a/shell/init.c#L238 If this check fails, then the shell will prompt for the position of its executable as follows. This patch makes the MCB walker enable the UMB link even if the reported DOS version is below 5, allowing it to find the environment block's UMCB and avoiding the prompt. Failed to load the strings resource into memory, the location pointed to in %COMSPEC% seems to be invalid. Please specify another location of FreeCOM to try to load the strings from, e.g.: C:\COMMAND.COM or just hit enter to cancel to load the strings.
-
ico files are binary, don't convert linefeeds
ico files are binary, don't convert linefeeds
-
ver.c: try 21.3306 true version call, if zero then use 21.3000 version
ver.c: try 21.3306 true version call, if zero then use 21.3000 version
-
ver.c: strip 21.33FF trailing blanks, append linebreak
ver.c: strip 21.33FF trailing blanks, append linebreak Some kernels such as RxDOS, EDR-DOS, and lMS-DOS do not include a linebreak at the end of the string, while FreeDOS does (an LF).
-
ver.c: detect support of 21.33FF using dx=0, instead of OEM id
ver.c: detect support of 21.33FF using dx=0, instead of OEM id
-
fixes #159 - display DOS minor version with 2 digits
fixes #159 - display DOS minor version with 2 digits
-
NLS update Turkish
NLS update Turkish
-
build: correct file dependencies in make files
build: correct file dependencies in make files
-
CI-build: extend test OW cross-compile to 1.9 and 2.0 versions
CI-build: extend test OW cross-compile to 1.9 and 2.0 versions
-
cleanup code to be more transparent
cleanup code to be more transparent doesn't use static symbol name in prototype or parameter name, it is confusing
-
fix cross-compilation build of fixstrs.exe
fix cross-compilation build of fixstrs.exe the format of the response file depends on the compiler used, which is not generally correct for cross-compilation the program has been modified to define the file format via a command line option, making the file creation transparent and defined to be correct for currently used tool
-
build: minor corrections in make file
build: minor corrections in make file
-
reformat make files for consistency
reformat make files for consistency
-
CI-build: add upx build option
CI-build: add upx build option
-
next fix string --> strings
next fix string --> strings
-
CI-build: add Open Watcom test cross-compile on Windows/Linux/Mac OSX
CI-build: add Open Watcom test cross-compile on Windows/Linux/Mac OSX
-
fix string --> strings
fix string --> strings
-
build: fix OW support for cross-compile on Mac OSX
build: fix OW support for cross-compile on Mac OSX
-
build: fix clean scripts
build: fix clean scripts
-
watcom: fix backward compatibility with OW 1.9
watcom: fix backward compatibility with OW 1.9
-
build: fix cross-compile setup for gcc and Open Watcom
build: fix cross-compile setup for gcc and Open Watcom gcc doesn't support compact memory model, configuration handle this special case by generating appropriate message, now it happens only for fixstrs.exe (in strings) Open Watcom can be run from Windows or Linux or DOS, only necessary is define WATCOM env.variable and add host OW binaries on the PATH, all other is handled by make files
-
git: update .gitignore file to exclude more file extensions
git: update .gitignore file to exclude more file extensions
-
build: rename response file to consistent name with .rsp extension
build: rename response file to consistent name with .rsp extension
-
watcom: fix source code for Open Watcom Linux build
watcom: fix source code for Open Watcom Linux build
-
update version in git, 0.87 - unreleased next version
update version in git, 0.87 - unreleased next version
-
build: separate fixstrs.exe and critstrs.exe host(native) build
build: separate fixstrs.exe and critstrs.exe host(native) build rename macro FIXSTRS_BUILD to COMPACT_MODEL add new macro UTILS_BUILD for host(native) build DOS build is not changed toolchain configuration should be control by UTILS_BUILD macro to switch between host(native) and cross compilation 16-bit DOS memory model is control by COMPACT_MODEL macro
-
update release 0.86 docs
update release 0.86 docs
-
enable recursive make directory (md /p dir\subdir\...)
enable recursive make directory (md /p dir\subdir\...)
-
delete echoto.bat in strings when running clean.bat
delete echoto.bat in strings when running clean.bat
-
avoid leaking findfirst handle if path too long
avoid leaking findfirst handle if path too long
-
enable recursive remove dir (rd /s)
enable recursive remove dir (rd /s)
-
build: add ptchsize as native build for cross-compilation
build: add ptchsize as native build for cross-compilation ptchsize is build tool (used by FREECOM build) and also DOS target tool now in tools (DOS tools included in distribution) is DOS version in utils (host native tools used by FREECOM build) is host OS version
-
build: remove redundant rules
build: remove redundant rules handle echo...bat batch file more transparent way
-
correct header files references
correct header files references
-
build: rename macros to be more transparent
build: rename macros to be more transparent
-
build: fix build by tlib and response file (Borland tlib)
build: fix build by tlib and response file (Borland tlib) fix special handling of (&) character for Windows cmd.exe shell fix (+)add character handling remove useless second list for librarian, now handled in echolib.bat
-
asm: remove some MASM residual directives
asm: remove some MASM residual directives
-
build: add message for echoto.bat arguments overflow (#132)
build: add message for echoto.bat arguments overflow (#132)
-
fix if exist path command checking for "path command" instead of path
fix if exist path command checking for "path command" instead of path
-
Build: Add missing prefix
Build: Add missing prefix