462 Commits

Author SHA1 Message Date
E. C. Masloch
86db573347 sys.c: in _dos_findfirst set DTA rather than copying from PSP:80h
Running prior to this commit, a /K switch with a name at a certain
position will write all-blanks into the boot sector loader. If that
happens, lDOS instsect will not detect a valid load file name:

C:\>sys a: /bootonly /k ldos.com
System transferred.

C:\>instsect /bo a:
Detected FAT12 FS.
Keeping original sector loader.
Sector valid, FS ID match and proper jump.
Type heuristic: "FreeDOS (FreeDOS)"
No name detected.
Unit selection code not found in sector. Keeping as is.
Part info code not found in sector. Keeping as is.
Query geometry code not found in sector. Keeping as is.
Auto LBA detection (HDD only) found in sector. Keeping as is.
Previous geometry: 2 CHS Heads, 18 CHS Sectors, 0 Hidden
Writing boot sector to sector.
C:\>

Running after this commit sets the name as desired:

C:\>sys a: /bootonly /k ldos.com
System transferred.

C:\>instsect /bo a:
Detected FAT12 FS.
Keeping original sector loader.
Sector valid, FS ID match and proper jump.
Type heuristic: "FreeDOS (FreeDOS)"
1st name: "LDOS.COM"
Unit selection code not found in sector. Keeping as is.
Part info code not found in sector. Keeping as is.
Query geometry code not found in sector. Keeping as is.
Auto LBA detection (HDD only) found in sector. Keeping as is.
Previous geometry: 2 CHS Heads, 18 CHS Sectors, 0 Hidden
Writing boot sector to sector.
C:\>

For reference, the libi86 implementation of _dos_findfirst also
sets the DTA to the user buffer rather than copying around the
resulting search record. So it is likely that Turbo C or Watcom
do it similarly to this:

3ecc416499/host-gcc/dos/dos-findfirst.c (L43)
2025-11-11 12:37:19 -05:00
Andrew Bird
383c05a3fd CI: Temporarily override country MAKE for TC2
Unfortunately the make supplied with Turbo C 2.01 doesn't like variables
being passed in on the command line, so use GNU make instead.
Note:
  As 'country' is a submodule it can't do `!include "../mkfiles/generic.mak"`
as that would be outside its repository and would break the standalone build,
hence the reason its DIRSEP and CP vars are set on the outside. As its
'production' target is used by the main makefile, there's no opportunity to
hardcode those values to DOS specific ones there either.
2025-10-31 08:39:17 -04:00
Andrew Bird
319bd342a8 CI: Turbo C doesn't like C++ comments 2025-10-31 08:39:17 -04:00
Andrew Bird
6ce6591150 CI: Dont use LFNAPI 2025-10-31 08:39:17 -04:00
Andrew Bird
12273ebf3f CI: Turbo C 2.01 doesn't do 386 instructions 2025-10-31 08:39:17 -04:00
Andrew Bird
977e218437 CI: Build with Turbo C 2.01 if available 2025-10-31 08:39:17 -04:00
Andrew Bird
6412ab9b4d CI: Update to use 1.4 repos 2025-10-31 08:39:17 -04:00
Andrew Bird
9483805241 CI: Setup NASM in consistent manner for DOS 2025-10-31 08:39:17 -04:00
E. C. Masloch
9b9b5b1f88 initdisk.c: work around Xi8088 ROM-BIOS bug for int 13.41 [fixes #156]
Setting ds = 40h for int 13h function 41h is to work around a
Xi8088 ROM-BIOS bug. All LBA extensions functions are affected,
but only the detection call will reach the bug code because that
BIOS reports that it doesn't support the LBA extensions.

Refer to https://github.com/FDOS/kernel/issues/156
and https://www.bttr-software.de/forum/forum_entry.php?id=21275
2025-10-10 06:09:05 -04:00
E. C. Masloch
e3bfd6a6f0 boot32.asm: fix, reset full ax after int 10h function 0Eh
We discovered [1] that some ROM-BIOS implementations apparently
corrupt the ah register contents upon running int 10h function
0Eh so that writing only al afterwards isn't certain to set up
the registers for another function 0Eh call.

In the talk about this I referenced an earlier problem [2] in
which it was the al register, not ah, which got corrupted. So
all in all the int 10h function 0Eh call should be expected to
clobber the entirety of ax, alongside bp. (The bp corruption is
stated in the Interrupt List [3].)

[1]: https://github.com/SvarDOS/bugz/issues/174#issuecomment-3368497819
[2]: 977023f85c
[3]: https://fd.lod.bz/rbil/interrup/video/100e.html
2025-10-09 12:29:13 -04:00
Andrew Bird
56a86d2ad4 CI: Update to use Ubuntu 24.04 runner 2025-09-21 08:29:44 -04:00
E. C. Masloch
80d140984b set byte [SDA + 39h] during process termination, turn abort to fail
This is compatible to lMS-DOS which sets the flag before running
int 2Fh function 1122h [1] and clears it after closing handles and
freeing memory [2], before branching to the Parent Return Address.

The flag turns any int 24h abort response into a fail instead, to
avoid iterating infinitely during file handle closing.

[1]: https://hg.pushbx.org/ecm/msdos4/file/c057c6a1c9ad/src/DOS/ctrlc.nas#l752
[2]: https://hg.pushbx.org/ecm/msdos4/file/c057c6a1c9ad/src/DOS/ctrlc.nas#l829
2025-08-22 23:08:23 -04:00
E. C. Masloch
3c751e2e28 rename byte [SDA + 25Ch] from _tsr to _term_type, fix int 24h rc
This fixes int 24h abort to set the return code to 200h.
The ErrorMode misuse is apparently necessary, but was not
sufficient to set the return code.
2025-08-22 23:08:23 -04:00
E. C. Masloch
2b54761e28 entry.asm: allow critical error Abort on self-parented process
Fixes #213
2025-08-22 23:08:23 -04:00
E. C. Masloch
017e083275 entry.asm: fix int 24h stack changes to ensure interrupt lockout (#213) 2025-08-22 23:08:23 -04:00
E. C. Masloch
6094067574 entry.asm: fix Critical Error caller 386 registers
Fixes #210, fixes #212
2025-08-22 23:08:23 -04:00
Andrew Bird
032523a2bb
Merge pull request #208 from andrewbird/ci-fix
CI: Force lower case when unzipping
2025-06-24 16:36:48 +01:00
Andrew Bird
d383546589 CI: Force lower case when unzipping
Sometimes DOS packages can have upper or mixed case filenames that Linux
unzip doesn't recognise as needing downcasing.
2025-06-24 16:13:20 +01:00
Bernd Boeckmann
b8ef68fb86 add missing test for write before invalidating buffer in INT25,26 handler 2025-06-02 11:35:38 +02:00
Bernd Boeckmann
8d29d66148 test for uninitialized dpb on INT25,26 and always allow rw block zero
The problem is that ISFAT32 macro only tests for dpb->fatsize = 0, and
not also for xfatsize != 0. So the ISFAT32 macro returns a
"false positive" on uninitialized dpbs, where both fatsize and xfatsize
are zero.

This fixes https://github.com/FDOS/kernel/issues/200. However, the dpb
is not properly initialized via a media check by an INT25,26 yet.

This commit makes sure that written sectors are removed from the
block cache.
2025-06-02 11:21:36 +02:00
Kenneth J Davis
654e7b7a6c
debug macro adjustments to separate what is printed in DEBUG mode 2025-03-28 19:57:59 -04:00
Kenneth J Davis
7fd6a6b71b
add alternative path (compile time determined) if attempt to write >4GB should fail whole write or succeed but only up to 4GB (based on email from Tom) 2025-03-28 17:04:59 -04:00
Kenneth J Davis
767cafa737
initialize pChildEnvSeg to 0 as if failed, callers would potentially free random memory address 2025-03-28 17:03:58 -04:00
Kenneth J Davis
868ae24d3c
correct env size allocated, should be 0x80+3 not 80+3 as filename is 128 bytes 2025-03-28 17:02:58 -04:00
Kenneth J Davis
bb8b581915
add some comments and debug prints 2025-03-28 17:01:49 -04:00
Kenneth J Davis
93add63a3b
add assert macro 2025-03-28 16:59:13 -04:00
Kenneth J Davis
fa0959cb82
keep history.txt updated for pending release 2025-03-28 14:21:09 -04:00
Kenneth J Davis
9967d2d662
add some debug prints and update some to use debug print facility 2025-03-28 14:20:26 -04:00
Kenneth J Davis
de08998969
From Tom Ehlert, gracefully error when attempting to write past 4GB instead of wrapping and causing corruption. 2025-03-28 14:14:44 -04:00
Kenneth J Davis
42a006b964
add some comments regarding share 2025-03-28 10:24:19 -04:00
Kenneth J Davis
634257b913
add convenience switch to redirect debug output to COM port when building, update some debug prints to use our debug interface so print to COM port when enabled. 2025-03-28 10:24:19 -04:00
E. C. Masloch
192cccc68f in 2F.4A02 advance firstAvailableBuf past the alignment as well (neater) 2025-03-16 20:56:22 -04:00
E. C. Masloch
85be764a50 fix 2F.4A MS-DOS v5 style HMA access services
* Reject allocation call with too large requested size,
rather than allocating the remaining HMA.
* Align returned offset to paragraph boundary.
* Allow to allocate up to the very last byte of the HMA,
rather than 1 byte less.
* Pass last allocated byte to AllocateHMASpace instead
of the byte past it, which would carry for a full allocation.
2025-03-16 20:56:22 -04:00
Kenneth J Davis
5de2eb1aa0
avoid some useless messages when building release 2024-12-31 18:08:11 -05:00
Kenneth J Davis
dffdc492bf
linker arguments passed via response file, doesn't interact well with explicit options 2024-12-31 16:55:23 -05:00
Kenneth J Davis
6f5a136a60
ensure cloning submodules 2024-12-31 16:23:20 -05:00
Kenneth J Davis
44dd357f86
update readme for v2.44 2024-12-31 15:44:14 -05:00
Andrew Bird
6cd67917a8
Merge pull request #192 from jmalak/fix-2
CI-build: do download and setup Open Watcom more transparent
2024-12-23 22:52:27 +00:00
Andrew Bird
abeda02ee1
Merge pull request #191 from jmalak/fix-1
build: modify echoto.bat to check arguments overflow
2024-12-23 22:47:26 +00:00
Jiri Malak
86ea0f75aa CI-build: do download and setup Open Watcom more transparent 2024-12-23 23:37:16 +01:00
Jiri Malak
ced1587aa4 build: modify echoto.bat to check arguments overflow 2024-12-23 23:28:49 +01:00
Kenneth J Davis
7cd0e19681
build 2044 - update release documentation 2024-12-21 13:09:09 -05:00
Kenneth J Davis
1cc00e194d
avoid race condition that could corrupt user stack if DOS re-entered too soon
apply suggested fix from SF bug 215 (https://sourceforge.net/p/freedos/bugs/215/), InDOS cleared but small chance DOS re-entered before user stack restored thus corrupting user stack
2024-08-19 16:31:22 -04:00
Kenneth J Davis
dabfaf7d54
enable installation check for driver.sys
For now we still only support subfunction 3 (return drive table) and subfunction 0 (check if installed) which we say yes.  This allows DOS Internals DRVINFO.EXE to correctly use internal drive table (it checks if installed and doesn't bother if not) and return corresponding information.  Note: subfunction 3 is still handled in int2f.asm for now, but may be moved to cleaner (but bigger and slower) implementation in inthndlr.c
2024-08-19 15:05:12 -04:00
Kenneth J Davis
1c6d1e8434
add reminder comment 2024-08-18 16:25:18 -04:00
Kenneth J Davis
f25e959e0a
response file is generated during build, update gitignore 2024-08-18 16:24:21 -04:00
Kenneth J Davis
2ce6dc00de
exeflat failed to advance str so didn't actually skip whitespace at beginning of string, additional comments 2024-08-18 16:22:15 -04:00
Andrew Bird
8f056cce6d
Merge pull request #187 from andrewbird/pr180
exeflat: Update usage text for indirect file
2024-08-18 13:55:22 +01:00
Andrew Bird
c6b227b783
Merge pull request #186 from andrewbird/pr177a
Resurrected Pr177
2024-08-18 10:43:00 +01:00
Andrew Bird
fb9704f62e sys: Correct bin2c usage text 2024-08-18 10:40:52 +01:00