After comparison with DR-DOS 7.01 and MS-DOS 6.22 over at Dosemu2 it
was seen that rmdir of a directory having the _A_RDONLY bit set should
succeed. This patch makes that change.
For reference the test report can be found in the fdpp issue
https://github.com/dosemu2/fdpp/issues/161. An identical patch has
been applied there.
This changes the interface between reloc_call_int2f_handler
(int2f.asm) and int2F_12_handler( ) (inthndlr.c) so that
- int2F_12_handler( ) will not try to output values to its
caller by passing "back" input parameter values
- reloc_call_int2f_handler will switch to an internal
stack before calling int2F_12_handler( ), so that SS ==
DGROUP as expected by the latter.
This partly addresses https://github.com/FDOS/kernel/issues/11 .
(The call to syscall_MUX14( ) in int2f.asm seems to have
similar issues, and should probably also be updated.)
DOS provides the interrupt 2f/12xx functions for use by
filesystem redirectors in order that they do not need to access
structures and variables using undocumented methods. Interrupt
2f/1217 is a function used by a redirector to get the CDS entry
corresponding to a drive without iterating the CDS array found
via SYSVARS LOL.
FreeDOS currently validates the flags in CDS entry before
deciding whether to return the entry to the caller. This behaviour
prevents a redirector receiving the CDS entry corresponding to
an as yet unassigned drive so preventing any new drive mapping.
I've tested the following flavours of DOS and only FreeDOS
does this.
# DOS variants returning new CDS entries okay
DR-DOS
6.00-930319 7.00 7.01 7.02-971119 7.02-980123 7.03 8.00
MS-DOS
3.10 3.20 3.21 3.30-Nec 3.30 3.31 4.01 5.00 6.00 6.20 6.21 6.22
7.00 7.10
PC-DOS
3.00-Compaq 3.00 3.10-850307 3.10-850422 3.10-Compaq 3.20-851230
3.20-860221 3.30 3.31-Compaq 4.00 4.01 5.00 5.02 6.10 6.30 7.00
7.10 7.2K
# DOS variants that return error rather than new CDS entry
FR-DOS
1.00 1.10 1.20
This patch introduces an unvalidated version of get_cds() and calls
it only for the int2f/1217h call, other uses remain as before.
- Upon creation, initialize the PSP version field
to os_setver_minor / os_setver_major.
- When calling Function 30h, return the contents
of the current PSP's version field to the caller.
Some ancient NE programs set exMinAlloc to 0xffff to signify
that they should not be run as normal MZ programs at all:
00000000 4d 5a 40 00 01 00 00 00 04 00 ff ff ff ff 00 00
00000010 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00000030 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00
00000040 4e 45 04 00 9b 00 07 00 00 00 00 00 06 40 02 00
...
The kernel should reject these programs, rather than try to
run them (and crash the system).
Two variables named 'result' were defined, at the outer level a
UBYTE to hold the function return value and the inner a COUNT to
hold returns from 'truename()'. The overall function return value
was always FCB_SUCCESS due to shadowing, however removing the
inner variable definition as a fix does not work due to sign
issues and intermixing of the variable uses, so rename the inner
variable.
Tested this patch using FDPP platform
1/ Simple rename of file with conditions for success (ok)
2/ Simple rename of file with conditions for failure - source missing (ok)
3/ Simple rename of file with conditions for failure - target exists (ok)
Fixes#16
GCC has -mrtd but the args are pushed in reverse versus PASCAL. So asm
routines have to use macros to obtain the stack arguments.
For the complex call_nls assembly, revert the arguments in C using a
preprocessor macro.
Using DOSTEXT(x) accesses x in LGROUP and DOSDATA(x) in DGROUP.
This is necessary since ia16-elf-gcc does not understand data
in far segments.
For non-macro'ed symbols, FP_SEG needs to be replaced by explicit
segment references.
Because ia16-elf-gcc and the GNU linker do not understand OMF we
need to use ELF everywhere.
This also means we cannot use "wrt", "seg" and "call/jmp far".
Most wrt's are superfluous, and seg and call/jmp far can be
replaced by explicit ?GROUP references (to be defined in the
linker script).
LBA_to_CHS() uses geometry taken from BIOS, but LBA_Transfer()
was using the geometry from VBR. This caused "count" variable
to underflow over unsigned long, then corrupting the entire
DOS memory with the large read.
This patch makes LBA_to_CHS() to return the geometry to caller,
so that the calculus do always match.
Thanks to @ecm-pushbx and @andrewbird for helping to
nail this down.
Based on lpproj's nec98:Fix for DOS 3.x partitions
5fab40fc63
On loading BPB check signature if extended fields (serial#, volume, and fstype) are available, use dummy values if not.
Return error if attempt to set BPB serial# and not part of BPB.