Commit Graph

32 Commits

Author SHA1 Message Date
Jiri Malak
db43a4b343 far-fix: symbols BIOSInt13, UserInt13 and BIOSInt19 are far (in LGROUP)
these symbols are in LGROUP and generaly cannot be addressed by DGROUP:offset
for Turbo C DGROUP offset overflow because symbols are too far to be addressed by DGROUP offset
2024-07-15 15:21:36 -04:00
Jiri Malak
2fb0956513 tc2-build: correct various build breaks for Turbo C 2.0 build 2024-07-13 19:37:21 -04:00
Jiri Malak
58573d69d9 tc2-build: correct various build breaks for Turbo C 2.0 build 2024-07-13 19:37:21 -04:00
Jiri Malak
5304e657fd time.t: resolve issue with internal and standard C time.h files and remove all hacks
- fix issue by renaming header file and symbols which consolidate with standard C time.h
- rename also date.h for consistency
- remove all hacks from make files and from sys.c

now can share new dtime.h with standard C time.h without any collision that any order of internal and standard C header path is possible
2024-07-10 11:32:10 -04:00
Jiri Malak
4ca28252da code-mismatch: fix various kernel code discrepancies which break TURBO C build
main issue is missing ASM attributes that C and asm code uses different names
correct long constant by standard suffix 'L' or 'UL'
2024-07-10 11:30:20 -04:00
Bernd Boeckmann
c08313ab62 fix issue #144 by correcting getbpb return code
getbpb now returns 0 instead of S_DONE in case of an uninitialized
partition, copying the default BPB into the BPB.

The previous return of S_DONE in case of uninitialized partitions
resulted in rp->r_bpptr not getting set in bldbpb. This in
combination with indicating success resulted in garbage returned
via rp->r_bpptr.

The DPB values are now being set to the default BPB ones in media_check
ea951d8136/kernel/fatfs.c (L1728)
via call to bpb_to_dpb in case of an uninitialized partition.
This may have side effects. But because DF_NOACCESS is still set, I
think it is the right way to do it.

The commit also masks high bit of AL for INT25/26 containing the drive
number. Some programs may set the bit according to RBIL:

"examination of CPWIN386.CPL indicates that if this call fails with
error 0408h on an old-style (<32M) call, one should retry the
call with the high bit of the drive number in AL set"

Leaving the bit set may render the given drive number unusable.
It should do no harm to mask it to increase the chance of the operation
to succeed. Also, the AH should be set to zero, because drive is given
only in AL.
2024-03-05 16:35:31 -05:00
C. Masloch
ab3cac6d0c allow gcc build to succeed with -DWIN31SUPPORT 2024-02-03 20:59:11 -05:00
Andrew Bird
afe7fbe068 inthndlr: align hma size to para
Based on a patch https://github.com/dosemu2/fdpp/commit/e7fe81d458
for FDDP by @stsp

[fixes #101]
2023-04-13 18:05:24 -04:00
Kenneth J Davis
e1b22c7035
update comments
(from Geoff Chappell blog and RBIL)
2022-10-24 20:19:32 -04:00
Kenneth J Davis
740e31fd2e don't overwrite CX on windows startup broadcast, windows sets this to 0 so unneeded and another program in chain may have set to nonzero for a reason 2021-08-20 18:24:45 -04:00
Kenneth J Davis
9186e6c5ed initial windows 3 enhanced support based on unstable kernel branch 2021-08-19 11:46:10 -04:00
Kenneth J Davis
e341cce4ed fix build error on FAT16 (non FAT32) variant because of unused label 2021-08-14 19:22:09 -04:00
Kenneth J Davis
b0653c0c5f add missing #ifdef, this code is part of skeleton logic for upcoming LFN support - int 2F 1242 internal 64 bit LSEEK should only be active if LFN API available 2021-08-09 17:42:07 -04:00
Kenneth J Davis
1bb536c383 LONG SEEK actually use lower 32 bits of 64 bit value (not 16 bits) 2021-08-08 14:37:07 -04:00
Kenneth J Davis
b7bcef73a1 build fixes - update inthndlr.c to compile with LFNAPI enabled (more fixes from earlier oops, lfnapi.c still doesn't compile) 2021-08-08 14:26:34 -04:00
Kenneth J Davis
246b0037a8 initial implementation of extended seek (0x7142 - LONG LSEEK with 64-bit file position) 2021-08-08 03:52:58 -04:00
Kenneth J Davis
15900d7827 add implementation of int 0x2F function 0x1f build CDS from dosemu2/fdpp 2021-08-08 02:19:14 -04:00
Kenneth J Davis
d410370580 add skeleton for LFN API, includes 0x71a6 implementation (call to redirector only) from dosemu2/fdpp 2021-08-07 20:43:04 -04:00
Tee-Kiah Chia
26626f2fed ia16-elf-gcc: use new SS != DGROUP support for int21_syscall(.) 2021-05-11 21:47:12 -04:00
Tee-Kiah Chia
c07577cbfb (Mostly) fix gcc-ia16 code for non-stack-switching int21 funcs. 2019-12-09 06:23:12 -05:00
Tee-Kiah Chia
0114ab3be4 int2f: fix call interface around int2F_12_handler( )
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.)
2019-12-09 06:23:12 -05:00
Andrew Bird
0dc6a02450 int2f: Allow 1217h function to return new CDS entry
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.
2019-12-02 15:09:23 -05:00
Mondgestein
a2ad348ed8 Function 30h (Get DOS Version): Get DOS version from PSP
- 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.
2019-12-02 12:06:22 -05:00
C. Masloch
6fbb1d0043 inthndlr.c: in Int21.43FF, dispatch DosMkRmdir on CL not AH 2019-11-08 18:19:11 -05:00
Bart Oldeman
8ee8135d4f ia16-elf-gcc port: use CDECL = __attribute__((cdecl)) instead of varargs. 2018-07-12 10:56:26 -04:00
Bart Oldeman
89d97b18de Fix ASMCFUNC (FAR) functions for ia16-elf-gcc.
We need to use make the functions vararg (,...) to make them cdecl.
For FAR functions we need wrappers.
2018-01-11 17:50:31 -05:00
KJD
c9300387e7 Implement Int 2F/AX=120Bh based on RBIL description 2016-01-16 20:56:29 -05:00
KJD
ad3d7802f6 Implement Int 2F/AX=120Ah based on RBIL description - untested! 2016-01-16 16:46:22 -05:00
lpproj
5756cf8d26 On creating child PSP (func 0x55), copy command line parameters from the parent
(required for some device loaders)
2015-09-22 11:58:25 +09:00
lpproj
effd87fafb Return current country code (func 0x38) 2015-03-29 15:16:59 +09:00
lpproj
0246178809 Fix pointer of DBCS table (int 0x21, func 0x6300) 2014-11-22 11:41:07 +09:00
KJD
c431157156 FreeDOS kernel current - 2041+svn1709 2012-10-14 20:08:06 -04:00