Commit Graph

592 Commits

Author SHA1 Message Date
Bart Oldeman
aab06b8a4d Do not use FSINFO structure if it is not present.
Do some range checks on FSINFO values to make sure they are valid. Fixes
issue reported by dos386 on the mailing list.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1631 6ac86273-5f31-0410-b378-82cca8765d1b
2011-06-13 16:27:34 +00:00
Bart Oldeman
aec735eecd Truncating a 0-byte file should not fail!
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1609 6ac86273-5f31-0410-b378-82cca8765d1b
2011-05-09 01:54:48 +00:00
Bart Oldeman
cd79fe5f31 Fix 386 register save/restore (FS & GS destroyed across EXEC - SF bug: 3090610)
Involves:
* before calling INT24 restore 386 registers. Protect again when
  re-entering DOS for "(A)bort"
* INT21/AH=4C and variations restore 386 registers from the user stack
* INT23 (ctrl-break) restores 386 registers
* INT2F/AH=14 protects 386 registers.
* EXECRH is marked to potentially modify FS/GS for OW.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1591 6ac86273-5f31-0410-b378-82cca8765d1b
2011-05-06 01:46:55 +00:00
Bart Oldeman
ed61be3ca3 Allocate bigger chunk of memory for INSTALL for __WATCOMC__ because the
memory layout is different from other compilers.
Fixes issues mentioned by Bret Johnson and Christian Masloch
in freedos-user/freedos-kernel.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1569 6ac86273-5f31-0410-b378-82cca8765d1b
2011-04-09 04:08:20 +00:00
Bart Oldeman
0b5098042e Make sure the DOS native and Linux cross-builds produce identical binaries.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1568 6ac86273-5f31-0410-b378-82cca8765d1b
2011-04-09 02:42:51 +00:00
Bart Oldeman
3df307b933 Remove useless END from nls_hc.asm, add explicit byte overrides for older
versions of NASM for more compact code, and adjust silent relocation segments.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1567 6ac86273-5f31-0410-b378-82cca8765d1b
2011-04-09 02:03:20 +00:00
Bart Oldeman
feaf5beb88 Update copyright, version and changelog.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1566 6ac86273-5f31-0410-b378-82cca8765d1b
2011-04-08 19:07:22 +00:00
Bart Oldeman
0760d51339 If handle valid, close file in PSP table before the low-level close +
(perhaps) critical error.
Avoids closing the file twice (and hitting the critical error twice) on
abort/program termination.
Also, close can only return error 6 (DE_INVLDHNDL), not 5 (DE_ACCESS), see RBIL.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1564 6ac86273-5f31-0410-b378-82cca8765d1b
2011-04-08 18:27:48 +00:00
Bart Oldeman
225237e915 From Christian Masloch:
set flags to 0x200 (IF set) when transferring to int22 termination address.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1563 6ac86273-5f31-0410-b378-82cca8765d1b
2011-04-08 16:04:24 +00:00
Bart Oldeman
d7be66c5ed Check errors for callers of dir_write and shrink_file.
Fixes: Bug: File creation does not check whether buffers are written correctly
(http://www.bttr-software.de/forum/forum_entry.php?id=9783)


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1562 6ac86273-5f31-0410-b378-82cca8765d1b
2011-04-08 15:54:03 +00:00
Bart Oldeman
77d0f502c0 No longer force flush1() and dir_write_update() to return TRUE if there
were disk write errors. Part 1 for fixing
http://www.bttr-software.de/forum/forum_entry.php?id=9783
Bug: File creation does not check whether buffers are written correctly


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1561 6ac86273-5f31-0410-b378-82cca8765d1b
2011-04-08 15:35:23 +00:00
Bart Oldeman
6bf9271256 Enlarge clock and block driver stacks. Thanks to Damien Guibouret
<damien.guibouret@partition-saving.com>.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1560 6ac86273-5f31-0410-b378-82cca8765d1b
2011-03-24 00:25:26 +00:00
Bart Oldeman
d9df755e78 Fix value that is used before being initialised.
This lead to a drive to not be considered as FAT32 despite it is
(or vice-versa).
Thanks to Damien Guibouret <damien.guibouret@partition-saving.com>.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1559 6ac86273-5f31-0410-b378-82cca8765d1b
2011-03-24 00:21:53 +00:00
Bart Oldeman
0d4c23ffac With the stack changes the DOS segment has moved to 0x79.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1499 6ac86273-5f31-0410-b378-82cca8765d1b
2009-08-22 19:07:18 +00:00
Bart Oldeman
3ae2e90e08 New irqstack.asm: irq 2, 3, 4, 5, 6, 10, 11, 12, 14, 15 now use the IBM
interrupt sharing protocol for STACKS. Affect int 2 too, but not IRQ 7
(INT 0fh) and IRQ 9 (INT 71h)


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1498 6ac86273-5f31-0410-b378-82cca8765d1b
2009-08-22 14:43:09 +00:00
Bart Oldeman
a46d6637fa Use near pointers for printf()s where possible. Problematic is only the
case where SS!=DS (which happens sometimes in resident code), in which
case va_list/va_arg need to use FAR pointers.
DS!=DGROUP never works, so I corrected that for NLS_DEBUG, by setting DS
in int2f.asm.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1491 6ac86273-5f31-0410-b378-82cca8765d1b
2009-07-18 20:48:44 +00:00
Bart Oldeman
8b07bb8c23 Check the BPB instead of the DPB for FAT32 after a BUILDBPB device
call, as the DPB may still be uninitialized at this point.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1490 6ac86273-5f31-0410-b378-82cca8765d1b
2009-07-18 14:05:26 +00:00
Kenneth J Davis
2e9792fae5 update copyright year, add some comments
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1489 6ac86273-5f31-0410-b378-82cca8765d1b
2009-07-13 03:21:32 +00:00
Kenneth J Davis
82d77a19e1 mark unused space in kernel for unused win compatibility structs
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1488 6ac86273-5f31-0410-b378-82cca8765d1b
2009-07-13 03:19:32 +00:00
Kenneth J Davis
dbf9e09dfc update sys to current version, adjust printf to support percent modifier, consistent prototype, and handle text not in current segment (FAR *) better, merge part of simplified debug (via prints) support
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1482 6ac86273-5f31-0410-b378-82cca8765d1b
2009-07-11 16:59:43 +00:00
Bart Oldeman
d6b54e78d0 Corrected DEBUG #if to #ifdef for Turbo C and corrected debug printfs in
truename().


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1479 6ac86273-5f31-0410-b378-82cca8765d1b
2009-07-07 13:33:24 +00:00
Bart Oldeman
d8537c13ef Simplified truename(): eliminated the addSep state by adding a backslash in
every new segment, including a trailing backslash. Simplified . and .. logic.
Converted switch to if because there were few cases left.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1478 6ac86273-5f31-0410-b378-82cca8765d1b
2009-07-07 13:04:53 +00:00
Bart Oldeman
f26372a241 DosChangeDir can only return DE_PATHNOTFND in case of error, so force that
error code.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1477 6ac86273-5f31-0410-b378-82cca8765d1b
2009-07-07 13:00:09 +00:00
Bart Oldeman
1f17a5e5da Remove the wildcard check for DosChangeDir() because truename() already does
that.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1476 6ac86273-5f31-0410-b378-82cca8765d1b
2009-07-06 20:26:27 +00:00
Bart Oldeman
5ad1fd51e1 Use simpler code for copying the current directory constructing the "truename":
instead of fmemcpy followed by strcpy, just use strcpy. Also use the near
TempCDS more.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1475 6ac86273-5f31-0410-b378-82cca8765d1b
2009-07-06 02:22:06 +00:00
Bart Oldeman
de81ab4e46 Unify parse_name_ext for name and extension and inline this function into
truename(). This is an optimization (200 bytes).


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1474 6ac86273-5f31-0410-b378-82cca8765d1b
2009-07-05 22:13:01 +00:00
Bart Oldeman
9e1e01e9e6 If the current directory is no longer valid, call dos_cd() for the root to
update the CDS cluster. Call media_check explicitly in truename() as a central
first and only place in directory-using DOS calls (except DosFindNext)
to call it.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1473 6ac86273-5f31-0410-b378-82cca8765d1b
2009-07-05 21:21:14 +00:00
Bart Oldeman
95653072d3 The original DosGetCuDir is now inlined in truename(). DosGetCuDir now
does truename("D:", CDS_MODE_SKIP_PHYSICAL), and this mode was changed
to no longer call QRemote_Fn (int2f/ax=1123).


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1472 6ac86273-5f31-0410-b378-82cca8765d1b
2009-07-05 21:09:34 +00:00
Bart Oldeman
39a9574824 Fix truename("C:") where the current directory is different from the root:
then it should not append a backslash.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1471 6ac86273-5f31-0410-b378-82cca8765d1b
2009-07-05 19:46:12 +00:00
Bart Oldeman
8cce4e7d84 Turbo C 2.01 and Linux cross-compilation compatibility fixes.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1470 6ac86273-5f31-0410-b378-82cca8765d1b
2009-07-02 02:39:17 +00:00
Bart Oldeman
fb847baa95 For self-owning PSPs do everything that a normal exit does except for closing
files and releasing memory (see RBIL).


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1469 6ac86273-5f31-0410-b378-82cca8765d1b
2009-07-02 02:24:44 +00:00
Bart Oldeman
2017b41dbb Fix problem with cd\ reported by ibid_ag@lavabit.com on the mailing list.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1468 6ac86273-5f31-0410-b378-82cca8765d1b
2009-07-01 02:43:21 +00:00
Kenneth J Davis
70851fff0a update build process to include country.sys
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1467 6ac86273-5f31-0410-b378-82cca8765d1b
2009-07-01 02:26:07 +00:00
Kenneth J Davis
3482128410 sync country source with latest from eduardocasino.es site
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1466 6ac86273-5f31-0410-b378-82cca8765d1b
2009-07-01 01:50:15 +00:00
Kenneth J Davis
60886a8424 add source for country.sys from dev branch
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1465 6ac86273-5f31-0410-b378-82cca8765d1b
2009-07-01 00:47:29 +00:00
Bart Oldeman
924f6d1bfd In case of "not sure" if the removable media has changed, the
IBM PCDOS technical reference says to call BLDBPB if there are no used
buffers, so we only do it then, instead of flushing the buffers.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1458 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-26 20:12:33 +00:00
Bart Oldeman
e597bb20d4 Merged int21/ax=7304, subfunctions 3 and 4, which work very similarly.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1457 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-26 20:00:41 +00:00
Kenneth J Davis
84fcfc5f11 simplify how version specified, enable SVN builds with revision#
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1456 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-23 01:26:30 +00:00
Bart Oldeman
6aa1e45bd8 Set the clean bit also on created/replaced files, not just opened files, so
the directory entry is only updated after they are written too.
Fixes SF bug #2380531.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1453 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-18 16:42:03 +00:00
Bart Oldeman
4d3e2e2fad Use a better formula for calculating FAT12 clusters, by multiplying nominator
and denominator by 3.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1452 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-17 22:04:49 +00:00
Bart Oldeman
e3f90446b3 initdisk: further optimizations in CalculateFATData(): merging the FAT16 & FAT32
loops.
fatfs: #if DEBUG fix.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1451 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-17 20:37:26 +00:00
Bart Oldeman
9e0b5e5bf6 Optimized initdisk.c by using constants instead of variables where possible.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1450 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-17 17:57:36 +00:00
Bart Oldeman
a93b71a18b Removed unused config variables and don't detect 'y' and 'n' if we're using
toupper anyway.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1449 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-17 14:09:57 +00:00
Bart Oldeman
132b1fe579 Cluster optimizations, mainly for FAT32: eliminated checkdstart,
replaced (cl == FREE || cl == 1) by (cl <= 1), UWORD cluster cast for FAT12/16,
and merge if branches for link_fat().


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1448 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-16 21:45:17 +00:00
Bart Oldeman
d854929efb Merged if status==S_OPENED logic in dos_open, cache dir_attrib, and remove
unnecessary init to 0.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1447 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-16 20:13:41 +00:00
Bart Oldeman
4d0e2c4b47 Make the built-in COUNTRY table more compact and allow to merge duplicate
strings for error message.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1446 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-16 19:47:44 +00:00
Bart Oldeman
5252faa425 Optimization: changed find_fname() to call split_path() because find_fname
was always preceeded by split_path(). The return code is now an error code,
DE_FILENOTFND, DE_PATHNOTFND, or SUCCESS, depending on the failure.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1445 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-16 15:22:16 +00:00
Bart Oldeman
d20b59ebe0 Added a split boolean argument to dir_open so the trick with setting the
dir/filename separator to 0 can be avoided, and we don't need to calculate
its location in split_path(). Without the trick many more char * path
arguments in the kernel can become "const char *".


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1444 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-13 04:31:55 +00:00
Bart Oldeman
78fc7a1e6d Remove dosnames.c and inline ParseDosName, because there is only one user left
(split_path()) which only uses it to find out if the path ends in a backslash
and the length of the directory part.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1442 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-13 04:01:01 +00:00
Bart Oldeman
60915d3cd0 dos_findfirst() now uses split_path(). The only thing that needed to be
added was the need to check for "d:\" paths which return DE_NFILES.
Also, findfirst("d:\nonexist\*.*",D_VOLID) should fail even if it actually
searches in d:\.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1441 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-13 03:44:50 +00:00