Commit c030e516 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

No longer offer PCMCIA SRAM card as a format option

Untangle the PCMCIATRUE misnomer - what it really meant was "offer PCMCIA card as an option for *Format AND allow non floppy geometries".
Nothing has shipped with PCCardFS since October 1994, so stop offering it as a possible *Format.
However, we do rely on the non floppy geometries for things like SD cards and USB sticks, so retain that with a new switch (permanently enabled) called NONFLOPPIES.

Tested with a Pi SD card and a 4GB USB stick.

Version 1.11. Tagged as 'DOSFS-1_11'
parent 8e566c40
......@@ -32,8 +32,7 @@ LIBS = ${ASMUTILS}
include CModule
DBG_LIBS += ${NET5LIBS}
ASFLAGS += -pd "PCMCIATRUE SETL {${PCMCIA}}"
CFLAGS += -DPCMCIA${PCMCIA}
CFLAGS += -DNONFLOPPIES
CDFLAGS += -DDEBUGLIB
# Dynamic dependencies:
No preview for this file type
/* (1.10)
/* (1.11)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.10
#define Module_MajorVersion_CMHG 1.11
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 21 Nov 2017
#define Module_Date_CMHG 17 Dec 2017
#define Module_MajorVersion "1.10"
#define Module_Version 110
#define Module_MajorVersion "1.11"
#define Module_Version 111
#define Module_MinorVersion ""
#define Module_Date "21 Nov 2017"
#define Module_Date "17 Dec 2017"
#define Module_ApplicationDate "21-Nov-17"
#define Module_ApplicationDate "17-Dec-17"
#define Module_ComponentName "DOSFS"
#define Module_ComponentPath "castle/RiscOS/Sources/FileSys/ImageFS/DOSFS"
#define Module_FullVersion "1.10"
#define Module_HelpVersion "1.10 (21 Nov 2017)"
#define Module_LibraryVersionInfo "1:10"
#define Module_FullVersion "1.11"
#define Module_HelpVersion "1.11 (17 Dec 2017)"
#define Module_LibraryVersionInfo "1:11"
......@@ -202,7 +202,7 @@ static int testforbpb(ADFS_drecord *dr,char *sector,bool floppy,
/* Can only make sketchy test for a valid boot block, later test should fail */
/* if the boot block is not really valid */
#ifdef PCMCIATRUE
#ifdef NONFLOPPIES
if (sector_size(bblock) == DOSsecsize)
#else
if (sector_size(bblock) == DOSsecsize || bblock->BOOT_num_fats == 2)
......@@ -223,8 +223,8 @@ static int testforbpb(ADFS_drecord *dr,char *sector,bool floppy,
dprintf(("","DOSFS: testforbpb: discSize = &%08X\n",discSize)) ;
dprintf(("","DOSFS: testforbpb: check size = &%08X\n",bbsize)) ;
#ifdef PCMCIATRUE
/* Now have to cope with PCMCIA cards with bits of first track "missing" */
#ifdef NONFLOPPIES
/* Now have to cope with solid state media with bits of first track "missing" */
/* but if it's not a floppy we can't be sure of the real size */
if (((bbsize < (discSize + (secspertrk(dr)*bytespersec(dr)))) && (bbsize >= discSize)) || !floppy)
#else
......@@ -710,9 +710,7 @@ static void validatedosformat(ADFS_drecord *dr,_kernel_swi_regs *rset)
}
/*-------------------------------------------------------------------------*/
/* NOTE: This code currently only deals with floppy structures and */
/* optionally PCMCIA (arbitrary sector-multiple size structures) through */
/* the addition of r4 as a parameter */
/* NOTE: This code currently only deals with floppy structures */
static _kernel_oserror *FSSWI_LayoutStructure(_kernel_swi_regs *rset,void *privateword)
{
......@@ -720,7 +718,6 @@ static _kernel_oserror *FSSWI_LayoutStructure(_kernel_swi_regs *rset,void *priva
* r1 = pointer to -1 terminated list of bad blocks
* r2 = pointer to NULL terminated disc name
* r3 = file handle of system image
* r4 = size of partiton if r0 = PCMCIA
* out:
*/
_kernel_swi_regs reglist ;
......@@ -729,13 +726,11 @@ static _kernel_oserror *FSSWI_LayoutStructure(_kernel_swi_regs *rset,void *priva
dprintf(("", "DOSFS: FSSWI_LayoutStructure: r0 = &%08X, r1 = &%08X, r2 = &%08X, r3 = &%08X\n",rset->r[0],rset->r[1],rset->r[2],rset->r[3]));
#ifdef PCMCIATRUE
/* Should be a multiple of sectors big for PCMCIA */
if((rset->r[0] == 9) && ((rset->r[4] % DOSsecsize) != 0)) {
/* Bounds check */
if (rset->r[0] > 8) {
rerror = global_error(err_badformat);
return(rerror); /* Quit! */
}
#endif
/* Place default BOOT BLOCK (shape defined by r0 on entry) */
if ((sector = (char *)malloc(DOSsecsize)) != NULL)
......@@ -767,17 +762,6 @@ static _kernel_oserror *FSSWI_LayoutStructure(_kernel_swi_regs *rset,void *priva
dbsector->BOOT_heads = 1;
}
#ifdef PCMCIATRUE
/* Special code for PCMCIA format */
if(rset->r[0] == 9) {
/* We need to change the max_sect and secsFAT settings */
maxsect = rset->r[4] / DOSsecsize; /* Should be an integer result */
dbsector->BOOT_max_sect = ((maxsect >> 0) & 0xFF) ;
dbsector->BOOT_max_sectHI = ((maxsect >> 8) & 0xFF) ;
dbsector->BOOT_FAT_size = ((maxsect * 2) + (DOSsecsize / 2))/ DOSsecsize; /* Rounded up */
}
#endif
/* Special code for Atari formats */
if ((strcmp(DOS_formats[rset->r[0]].idtext,"Atari/M") == 0) || (strcmp(DOS_formats[rset->r[0]].idtext,"Atari/N") == 0))
{
......
......@@ -339,7 +339,7 @@ DOSdisc *DOSFS_image_open(word fshand, word buffsize)
}
/* If this doesn't look like a BOOT block then try a partition. */
#ifdef PCMCIATRUE
#ifdef NONFLOPPIES
if (sector_size(dboot) != DOSsecsize)
#else
if (sector_size(dboot) != DOSsecsize || dboot->BOOT_num_fats != 2)
......@@ -421,8 +421,7 @@ DOSdisc *DOSFS_image_open(word fshand, word buffsize)
* BLOCK. **** research into this ****
*/
#ifdef PCMCIATRUE
/*if ((sector_size(dboot) != DOSsecsize) || (max_sector(dboot) != winisize))*/
#ifdef NONFLOPPIES
if (sector_size(dboot) != DOSsecsize)
#else
if ((sector_size(dboot) != DOSsecsize) || (dboot->BOOT_num_fats != 2) || (max_sector(dboot) != winisize))
......
......@@ -104,12 +104,6 @@ func_DOS_formatinfo
DCD DOSsecsize, 50, 50, 84
DCB 9, Ddensity, SStepSSided, 1, 0, 0, 0, &4E
DCD 80, 0, 0, 0, 0, 0, 0, 0, 0, 0
[ PCMCIATRUE
; PCMCIA (Fixed Disk) variable numtrks, 8sec/trk: USUALLY ONLY AVAILABLE VIA PCCARDFS *CARDFORMAT
DCD DOSsecsize, 50, 50, 84
DCB 8, 0, 0, 0, 0, 0, 0, 0
DCD 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
]
; Terminator
DCD 0, 0, 0, 0
DCB 0, 0, 0, 0, 0, 0, 0, 0
......@@ -140,9 +134,6 @@ Format5 DCB "DOS/T",0
Format6 DCB "DOS/U",0
Format7 DCB "Atari/M",0
Format8 DCB "Atari/N",0
[ PCMCIATRUE
Format9 DCB "PCMCIA",0
]
ALIGN
EXPORT func_DOS_formats
......@@ -182,11 +173,6 @@ func_DOS_formats
DCD Format8
DCB 7, 1, &F8, 2, 5, 112
ALIGN
;
[ PCMCIATRUE
DCD Format9
DCB 8, 0, &F8, 1, 1, 208 ; Last-but-1 value is just spacefiller
]
; Terminator
DCD 0
DCB 0, 0, 0, 0, 0, 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment