Commit Graph

10 Commits

Author SHA1 Message Date
Jiri Malak
2985b3386c ow: use safer form of #pragma aux
using ISO standard reserved word form of #pragma aux
2024-07-11 06:35:41 -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
Kenneth J Davis
af52b0c8c3
fix OW warning W115 in dsk.c 2022-10-24 18:01:50 -04:00
Kenneth J Davis
dd91e3c005 From Tom Ehlert: don't split disk transfers crossing DMA boundary if BIOS indicates can handle transparently 2021-07-30 23:04:06 -04: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
Stas Sergeev
8187fd8153 disk: fix sectors count truncation for CHS [fixes #10]
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.
2017-09-22 23:03:47 -04:00
KJD
234ed1181f Improve support for older BPB based volumes lacking extended fields.
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.
2015-05-27 23:54:45 -04:00
KJD
ed84760c0e use absolute not relative disk read/writes;
fix for syslinux DOS installer
partial fix, still need to confirm if other uses should also be absolute
2014-07-03 20:06:47 -04:00
KJD
c431157156 FreeDOS kernel current - 2041+svn1709 2012-10-14 20:08:06 -04:00