Commit Graph

739 Commits

Author SHA1 Message Date
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
Kenneth J Davis
d6552eab77 add convenience options to build.bat for setting various defines
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1455 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-22 20:39:34 +00:00
Kenneth J Davis
6ffc037046 clear some additional env variables
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1454 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-22 20:37:36 +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
5c0be166ee Use tmp.exe instead of tmp$$$$$.exe -- the Linux cross compilation really
has trouble without quotes because $$ can be expanded as a shell variable
when passed to system().


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1443 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-13 04:17:19 +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
Bart Oldeman
f7a9177b64 The invalid pathname character detection is moved from ParseDosName (dosnames.c)
to truename (newstuff.c), because TRUENAME should check these characters
before passing paths on to fatfs.c & fatdir.c.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1440 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-12 22:58:24 +00:00
Bart Oldeman
c812a96e85 Corrected the if-statement && logic for attributes in the findnext loop.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1439 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-12 20:57:39 +00:00
Bart Oldeman
07d2b24149 Make findfirst/findnext more MSDOS compatible:
* ignore 0x40 (D_DEVICE) in search attribute.
* if you specify D_VOLID + one or more of D_HIDDEN, D_SYSTEM, and D_DIR you
  will get files *and* volume labels in the specified directory, not forced
  to the root directory.
* VOLID searches must look at the search pattern name too, or do not match.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1438 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-12 20:38:40 +00:00
Bart Oldeman
f5696a4a7e For read/write don't update sft_posit in dosfns.c anymore so fatfs.c takes
care of it.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1437 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-11 13:25:32 +00:00
Bart Oldeman
76c967d581 Remove usage of the fnode f_flags field where it is not relevant anymore.
Because of the explicit dir_write() calls we only need them in situations
where SFTs where used, that is for open files but not for directories.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1436 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-11 12:33:30 +00:00
Bart Oldeman
3a16a4c755 Eliminate fcbname[] on the stack: we can use dm_name_pat in the dirmatch
structures instead.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1435 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-10 21:08:16 +00:00
Bart Oldeman
479e6fb0eb %if 0 unused asm functions and fix a stack return problem with fstrcmp.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1434 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-10 21:02:52 +00:00
Bart Oldeman
a21bcd8a85 Split 8.3 FCB-style filename extraction from ParseDosName into a new
ConvertNameSZToName83 function, also used by dir_open().


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1433 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-10 19:02:24 +00:00
Bart Oldeman
8e2b96a70b Move the fnode fields f_diroff and f_dirstart into a referenced directory
match structure with fields dm_entry and dm_dircluster.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1432 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-10 16:10:54 +00:00
Kenneth J Davis
3239b3d4b0 More verbose output of UPX method (sys or exe) used and fix case without UPX so kernel boots.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1431 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-10 02:09:08 +00:00
Bart Oldeman
054631c300 Ported COUNTRY.SYS support from the unstable branch.
Simple country support is kept: COUNTRY=31 will look for country.sys but
if it does not exist, not complain and load the built-in info.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1430 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-09 23:41:50 +00:00
Bart Oldeman
e0ca8d76e2 Seek changes:
* merge unstable kernel optimizations
* enable seek for int2f/AX=1228
* -1 is a valid offset, so we need to process the return code seperately


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1429 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-09 18:50:03 +00:00
Bart Oldeman
288a2f396b Merge pop_dmp optimization from the unstable kernel.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1428 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-09 18:09:05 +00:00
Bart Oldeman
d519f3db40 This change was missed, as the changelog mentioned it was in 2035a already:
r_si/r_di contents added as documented in PC-DOS Technical Update.
I also moved the CharReqHdr filling in to just before execrh, and
made the command table a static const so it is outside the SDA (OW places
it in CONST2).


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1427 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-09 12:23:14 +00:00
Bart Oldeman
598ca4276a Optimization: move the attribute checks down and localize some variables.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1426 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-09 11:49:53 +00:00
Bart Oldeman
0231b7efd0 Streamline ioctl.c code so OW saves 2 more words of stack.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1425 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-08 19:40:41 +00:00
Bart Oldeman
b8cabddd8e r1115 set the dpb_subunit but that was wrong for get_cds() called from AX=4409.
Use a local variable unit to avoid that, and simplify the AX=4409 logic like
in the unstable kernel.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1424 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-08 18:04:36 +00:00
Bart Oldeman
ab6b4ffdf4 Inline ioctl helper routine back again. We can save stack by using the
dev variable that points to the device smartly.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1423 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-08 13:19:58 +00:00
Bart Oldeman
17bd0113b2 Split DosDevIoctl into two calls so execrh can be called with minimal
stack usage. Always return DE_ACCESS when the device fails instead
of DE_DEVICE, as DE_DEVICE is only used for renames between devices that
are not the same.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1422 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-07 15:47:45 +00:00
Bart Oldeman
f57099220b Introduce clear_dir() to clear a directory, this was code shared between
dos_mkdir() and extend_dir(). Now dos_mkdir() calls this function to clear
the new directory, and then creates the . and .. entries using higher level
functions instead of dealing with the blocks directly.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1421 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-05 14:53:05 +00:00
Bart Oldeman
ec30074f48 Make the fnode f_flags completely equal to the SFT sft_flags.
Rename SFT_FDIRTY to SFT_FCLEAN to avoid confusion.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1420 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-05 00:06:05 +00:00
Bart Oldeman
fedf951beb Eliminate the fnode F_DDIR flag which has no SFT equivalent:
f_sft_idx==0xff can do the same. rwblock() is never called for directories
so the checks could be removed.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1419 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-04 23:40:17 +00:00
Bart Oldeman
60e8c56f91 Flip target and source checks to avoid calling ParseDosName for in-directory
renames. Do not allow to rename directories between different directories.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1418 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-03 12:24:16 +00:00
Bart Oldeman
063c57e237 RENAME: if the source and target directories are the same, rename the directory
entry in-place instead of creating a new one and deleting the old one.
Fixes archived bugzilla bug:
http://www.freedos.org/bugzilla/cgi-bin/show_bug.cgi?id=1908


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1417 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-03 03:11:23 +00:00
Bart Oldeman
4a6e5677ad Change dos_rmdir to only use 1 fnode. It now first checks if the directory
is empty and then opens the parent and deletes the real directory.
No longer returns DE_FILENOTFND(2), but return DE_PATHNOTFND(3) instead.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1416 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-03 01:01:47 +00:00
Bart Oldeman
1569b6b920 Cleanup dirmatch.h: make attributes and size unsigned, and make the unused
dm_flags field reserved.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1415 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-02 13:18:24 +00:00
Bart Oldeman
b10d86bcaa Introduce get_cds1 to merge common code that checks for 0=default_drive,1=A,etc.
Make load_transfer() static.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1414 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-01 14:55:11 +00:00
Bart Oldeman
eb318177c1 Inline cooked_write_char() into cooked_write().
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1413 6ac86273-5f31-0410-b378-82cca8765d1b
2009-06-01 13:41:03 +00:00
Eric Auer
c14e9df8bb Describe SVN revision r1365-r1384 in history.txt, add some URLs
for FreeDOS SF pages to readme.txt, update email in contrib.txt


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1412 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-31 15:43:49 +00:00
Bart Oldeman
2fb8715bdc Fix compilation with Turbo C.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1411 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-29 00:50:28 +00:00
Bart Oldeman
5b46738372 Eliminate dir_close().
Its only purpose left was to flush buffers, which isn't necessary after
just open/read, so we can move that to dir_write().


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1410 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-29 00:25:38 +00:00
Bart Oldeman
1cc33a1a5e Move the open/creat access checks to more efficient places.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1409 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-29 00:03:27 +00:00
Bart Oldeman
7b89e44274 Make merge_file_changes more direct dealing with SFTs and merge the
"close open files setfattr wants to change" functionality there.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1408 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-28 18:33:22 +00:00