Commit Graph

523 Commits

Author SHA1 Message Date
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
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
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
Bart Oldeman
896908d6f7 Eliminate DosGetFile -- it is no longer necessary because the filename
is already copied from the fnode.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1407 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-26 21:09:56 +00:00
Bart Oldeman
9a415b14b2 Fix a regression with sft_flags overwriting what dos_open wrote so file
dates/times would always be updated, even for reads!


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1406 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-26 20:57:55 +00:00
Bart Oldeman
a0382d32e4 Eliminate dos_setfsize, dos_setftime, and dos_lseek, by just using the SFT.
dos_setfsize still needed to merge changes for SHARE so the call was replaced
by a new dos_merge_file_changes() call.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1405 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-26 20:44:44 +00:00
Bart Oldeman
76f1c10a4e Eliminate xlt_fd(), save_far_f_node(), and the redundant fnode f_mode field.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1404 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-26 18:34:05 +00:00
Bart Oldeman
4a81e6e9a2 Let merge_file_changes operate directly on the other SFTs.
dos_setfattr with SHARE now closes open SFTs referring to that file
in compat mode.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1403 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-26 18:23:35 +00:00
Bart Oldeman
386fc961e3 Fix SFT/fnode fields so the SHARE related functions is_same_file() and
merge_file_changes() work.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1402 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-26 16:49:57 +00:00
Bart Oldeman
c179284147 Remove redundant checks for fnodes==0 since the checks are done in dosfns.c.
Replace global f_nodes[] array by f_sft_idx fields in the fnodes.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1401 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-26 14:44:44 +00:00
Bart Oldeman
a69b4ba011 Eliminate the sft_status field as it is now equal to the SFT index.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1400 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-26 14:11:50 +00:00
Bart Oldeman
f9f2fe447d Eliminate dos_getftime, dos_getfsize, and dos_getfattr_fd, because we can
now get these properties directly from the SFT.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1399 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-26 13:59:44 +00:00
Bart Oldeman
e63e5dd125 Eliminate f_count field in fnodes and some no-op functions.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1398 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-26 13:47:52 +00:00
Bart Oldeman
d7d201a53b This is the main change to eliminate far fnodes.
SFT info is copied from and to the two near fnodes.
Some cleanups still follow.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1397 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-26 13:24:14 +00:00
Bart Oldeman
0ad01cd768 Handle sft_count before calling dos_open and after calling dos_close so
the SFT is open for longer, during fatfs.c operations.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1395 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-25 22:55:06 +00:00
Bart Oldeman
cb4ab16a22 Fix compilation with -DDOSEMU set.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1394 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-25 00:04:03 +00:00
Bart Oldeman
affddaaf64 Handle dos_getfattr and dos_setfattr directly at the directory level, instead
of opening the file, to avoid needing to claim SFTs in later changes.
Clarify and implement parts of the correct SHARE behaviour.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1393 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-23 02:04:03 +00:00
Bart Oldeman
7083b0a4fa On close or commit, only update those directory entry fields that have an
SFT equivalent. The rest stays unmodified on disk.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1392 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-22 00:25:11 +00:00
Bart Oldeman
ba75006b67 Use explicit dir_write() instead of letting dir_close() do the writing.
This is to prepare for an updating version to deal with SFTs.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1391 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-22 00:01:27 +00:00
Bart Oldeman
d39420dc11 Add f_dirsector (sector containing dentry) and f_diridx (index within
sector) fields to the fnode, to make fnodes more compatible with SFTs.
Use them to simplify dir_read() and dir_write().


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1390 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-21 12:57:37 +00:00
Bart Oldeman
2092745236 Force near fnode use to use either fnode[0] or fnode[1] instead of the
allocation scheme. This eliminates the checks done in inthndlr.c because
the f_count field is no longer checked.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1389 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-20 18:13:37 +00:00
Bart Oldeman
d6ad12a3dc Add Linux cross-compile capability, using Open Watcom:
* Flip \ to / where possible.
* Introduce $(DIRSEP) (/ or \) for use inside commands in makefiles
  where / won't work in DOS.
* Override various settings for Linux in owlinux.mak.
* Add quotes in exeflat.c to avoid shell expansion of $$$$$.
* Let "make all", "make clean", and "make clobber" do the job.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1387 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-19 21:39:29 +00:00
Kenneth J Davis
9e2421746b correct FCB fix from Bart, during open only certain fields of FCB should be initialized, programs may expect others to remain as set prior to open/create call
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1380 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-17 01:06:07 +00:00
Kenneth J Davis
01cc83bc82 From Eric, reduce unnecessary calls to share hook, only re-check (int 2f/1000) on open/close, not on each access
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1379 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-11 22:04:43 +00:00
Kenneth J Davis
d41599e2cc from Lucho, there is no any key, don't ask the user to press it
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1378 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-11 21:45:12 +00:00
Kenneth J Davis
da25cd58b4 use total cylinders (+1 for count, not maximum value)
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1377 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-11 17:11:30 +00:00
Kenneth J Davis
c6b55c1119 From Tom, return 0xFF on invalid drives for int 21h/1c get drive allocation information (sectors/clusters)
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1376 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-10 12:36:57 +00:00
Kenneth J Davis
d9e2861a44 improve comments regarding call PSP:5 patch
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1375 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-08 00:00:17 +00:00
Kenneth J Davis
0d16215fef adjust so FCB reads return data (fix loading of config file [assign.sys] by GEM versions that use FCBs)
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1374 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-07 01:42:16 +00:00
Kenneth J Davis
65f8276a45 fix nasm warning - add missing colon to label
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1373 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-04 03:12:53 +00:00
Kenneth J Davis
240bcc30e2 commit Bart's patch to fix CP/M call psp:05h compatibility call along with some comments to explain the call trampoline
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1372 6ac86273-5f31-0410-b378-82cca8765d1b
2009-05-01 04:25:27 +00:00
Kenneth J Davis
ae3d48ab33 Change how DosGetExtFree checks for drive so int 21h/7303h more lax about path given, support driver specifier with or without slash (C: or C:\) and just slash (\) for current drive (does allow some additional bogus paths to return success)
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1369 6ac86273-5f31-0410-b378-82cca8765d1b
2009-04-30 05:16:31 +00:00
Eric Auer
31bc1f6149 Added support for BUFFERSHIGH as alias to BUFFERS: No new code
but useful for people who are used to writing HIGH everywhere.
Thanks to Christian Wallbaum the hint that config.txt had both.
Removed code which called int 16.1 in a loop before 16.0 - this
would only be useful if you invoke HLT before each int 16.1 ...


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1366 6ac86273-5f31-0410-b378-82cca8765d1b
2008-06-01 22:44:19 +00:00
Eric Auer
74167734ff Compatibility: Allow fat/data/dir type hints even for disk read
in int 21.7305 to fix compat issue found by Christian Wallbaum.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1365 6ac86273-5f31-0410-b378-82cca8765d1b
2008-04-12 15:54:29 +00:00
Eric Auer
bfb40c4b1c Workaround for y2k BIOS bugs at the only location where FreeDOS
reads the BIOS (CMOS RTC) date (at boot). Note that according to
RBIL, DRDOS would even hook int 1a ah=4 to force a correct year.

/* A BIOS with y2k (year 2000) bug will always report year 19nn */
if ((dosregs.c.x >= 1900) && (dosregs.c.x < 1980)) dosregs.c.x += 100;


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1359 6ac86273-5f31-0410-b378-82cca8765d1b
2008-03-09 16:11:10 +00:00
Eric Auer
26f116a217 More secure FAT handling: Avoids risk of cross links for example if
you reboot while files are open... Reported by Hardi Stengelin :-).

Always test *link_fat* result. New function is_free_cluster.  Extra
checks in *link_fat* (bad r/w offset, i/o, write) and *next_cluster*
(dangling chain: bad value in chain) with short messages (no msg for
bad chain start). Shorter "Bad DPB" (FAT size) msg.  More comments!

Update FS INFO on disk only when needed.  Check if chain EOF was at
expected place when extending.  Call *link_fat* before! *setdstart*
when a FAT chain grows.   [Q: Does 0 byte write always trunc? Why?]


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1358 6ac86273-5f31-0410-b378-82cca8765d1b
2008-03-08 20:31:37 +00:00
Eric Auer
0cc297cf2d The truename function must use the current working directory of
the virtual / created-by-subst drive when it resolves relative
paths, even though truename returns the "real" drive and dir
of where your files actually are in the end. Using the current
directory of the "real" drive made truename give wrong results.

PS: If "subst e: d:\" says "physical path x:\ cannot be made",
then it refers to "making" a root dir. "subst e: d:\foo" works.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1357 6ac86273-5f31-0410-b378-82cca8765d1b
2007-09-15 22:01:03 +00:00
Bart Oldeman
69d767be50 Let exeflat call UPX itself like in the unstable branch. Simplifies makefile.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1353 6ac86273-5f31-0410-b378-82cca8765d1b
2007-08-29 08:49:02 +00:00
Bart Oldeman
266398c247 Add ASM to HaltCpuWhileIdle declarations for compatibility with Turbo C.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1350 6ac86273-5f31-0410-b378-82cca8765d1b
2007-08-27 11:41:13 +00:00
Eric Auer
94d0560e7b Do not ABORT if image size is above 1 MB - Instead, handle size
MODULO 1 MB (paras = low_16_bits(pages<<5) ...) because for e.g.
Turbo C++ 3.0 needs this: Their IDE is 1.3 MB BOSS NE style EXE,
the first < 0.3 MB load a DOS ext which loads and runs the rest.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1348 6ac86273-5f31-0410-b378-82cca8765d1b
2007-08-25 02:37:59 +00:00
Eric Auer
f7320f6452 Init HaltCpuWhileIdle to 0 before installing int handlers.
Removed HaltCpuWhileIdle handling from GetBiosKey because it is
only used *before* IDLEHALT is processed anyway - in the config
sys menu *and* in CheckContinueBootFromHarddisk. Adding s.th.
like "switches /i" would be a way to enable it a bit earlier.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1346 6ac86273-5f31-0410-b378-82cca8765d1b
2007-08-17 19:33:24 +00:00