Skip to content

Commit b0524ba

Browse files
committed
ata.device [44.43] added cdfs to rom - DOS/0 default - StartCyl ApolloTeam-dev#2 - Format check for DOS/o
1 parent 6ed2876 commit b0524ba

File tree

6 files changed

+24
-21
lines changed

6 files changed

+24
-21
lines changed

arch/m68k-amiga/boot/mmakefile.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ AFILES := ext_entry
166166
ifeq ($(APOLLOROM),V4)
167167
KLIBS := keymap graphics layers intuition gadtools workbench mathffp mathieeesingbas freeanim lowlevel setpatch
168168
KDEVS := ata trackdisk
169-
KHNDLRS :=
169+
KHNDLRS := cdrom
170170
KHIDDS := bus storage system
171171
KRSRCS := shellcommands wbtag misc shell card bootloader
172172
KHOOKS := alert

rom/devs/ata/ata.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
##begin config
22
basename ata
3-
version 44.42
3+
version 44.43
44
libbasetype struct ataBase
55
residentpri 4
66
beginio_func BeginIO

rom/devs/ata/ata_init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ BOOL ata_RegisterVolume(ULONG StartCyl, ULONG EndCyl, struct ata_Unit *unit)
4949
struct ExpansionBase *ExpansionBase;
5050
struct DeviceNode *devnode;
5151
TEXT dosdevname[4] = "HD0";
52-
const ULONG IdDOS = AROS_MAKE_ID('D','O','S','\001');
53-
const ULONG IdCDVD = AROS_MAKE_ID('C','D','V','D');
52+
const ULONG IdDOS = AROS_MAKE_ID('D','O','S','\000');
53+
const ULONG IdCDVD = AROS_MAKE_ID('C','D','F','S'); // Opticals are all using CDFS
5454

5555
ExpansionBase = (struct ExpansionBase *)TaggedOpenLibrary(TAGGEDOPEN_EXPANSION);
5656
if (ExpansionBase)

rom/devs/ata/lowlevel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,7 @@ static BYTE ata_Identify(struct ata_Unit *unit)
12041204
unit->au_Heads = 16;
12051205
unit->au_Sectors = 63;
12061206
unit->au_Cylinders = 195;
1207-
unit->au_StartCyl = 4; // First partition starts on Cylinder 4
1207+
unit->au_StartCyl = 2; // First partition starts on Cylinder 4
12081208
unit->au_EndCyl = unit->au_Cylinders - 1; // Partition covers full disk
12091209
unit->au_Capacity = unit->au_Heads * unit->au_Sectors * unit->au_Cylinders;
12101210
unit->au_Capacity48 = unit->au_Capacity;

workbench/system/BHFormat/gui.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@ int rcGuiMain(void)
520520
goto cleanup;
521521
}
522522
strcpy(szVolumeName, "_____");
523+
523524
} else {
524525
if( _WBenchMsg->sm_ArgList[1].wa_Name[0] == 0 )
525526
{
@@ -578,7 +579,7 @@ int rcGuiMain(void)
578579
}
579580

580581
if (!bGetDosDevice(pdlDevice, LDF_DEVICES|LDF_READ)) goto cleanup;
581-
582+
582583
ComputeCapacity(pdlVolume, &dinf );
583584

584585
DD(bug("Device = %s | Volume = %s | Capacity = %s\n", szDosDevice, szVolumeName, szCapacityInfo));

workbench/system/BHFormat/main.c

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ BOOL bSetDevfFromSz( const char * pszDevFlags )
284284
BOOL bGetDosDevice(struct DosList *pdlDevice, ULONG flags)
285285
{
286286
struct DosList *pdlList;
287-
struct DosEnvec * pdenDevice;
287+
struct DosEnvec *pdenDevice;
288288

289289
if (!pdlDevice)
290290
{
@@ -304,8 +304,7 @@ BOOL bGetDosDevice(struct DosList *pdlDevice, ULONG flags)
304304
}
305305

306306
/* Find startup message and verify file-system settings. Use TypeOfMem to protect against devices that use integer or string startup values. */
307-
if( (pfssm = (struct FileSysStartupMsg *)
308-
BADDR(pdlDevice->dol_misc.dol_handler.dol_Startup)) == 0
307+
if( (pfssm = (struct FileSysStartupMsg *)BADDR(pdlDevice->dol_misc.dol_handler.dol_Startup)) == 0
309308
|| TypeOfMem(pfssm) == 0
310309
|| pfssm->fssm_Device == 0
311310
|| (pdenDevice = (struct DosEnvec *)BADDR(pfssm->fssm_Environ)) == 0
@@ -340,16 +339,23 @@ BOOL bGetDosDevice(struct DosList *pdlDevice, ULONG flags)
340339
ibyStart = pdenDevice->de_LowCyl * cbyCylinder;
341340
ibyEnd = (pdenDevice->de_HighCyl + 1) * cbyCylinder;
342341

343-
DD(bug("bGetDosDevice: LowCyl = %u | HighCyl = %u | Heads = %u | Sectors = %u | ibyStart = %u | ibyEnd = %u\n",
344-
pdenDevice->de_LowCyl, pdenDevice->de_HighCyl, pdenDevice->de_Surfaces, pdenDevice->de_BlocksPerTrack, ibyStart, ibyEnd));
342+
DD(bug("bGetDosDevice: LowCyl = %u | HighCyl = %u | Heads = %u | Sectors = %u | ibyStart = %llu | ibyEnd = %llu | DosType = %u\n",
343+
LowCyl, HighCyl, pdenDevice->de_Surfaces, pdenDevice->de_BlocksPerTrack, ibyStart, ibyEnd, DosType));
344+
345+
if(DosType == 0x444F5300) // Check for DOS/0 and if found then Drive needs to be partitioned by HDToolBox first
346+
{
347+
DD(bug("bGetDosDevice: ERROR: No Partition(s) Found!\n"));
348+
ReportErrSz( ertError, 0, "\nERROR: No Partition(s) Found!\n\nUse Tools->HDToolBox to Create Partition(s)\n");
349+
return FALSE;
350+
}
351+
DD(bug("bGetDosDevice: OK: Partition(s) Found!\n"));
345352

346353
#if defined(__mc68000) && !defined(__AROS__)
347354
/* If the device has a native Amiga file-system, we can check for
348355
various limitations and also apply the various command-line
349356
flags that specify which variant to use for the new volume. */
350-
351-
if( pdenDevice->de_DosType >= 0x444F5300
352-
&& pdenDevice->de_DosType <= 0x444F5305 )
357+
358+
if( pdenDevice->de_DosType >= 0x444F5300 && pdenDevice->de_DosType <= 0x444F5305 ) // Filter for classic AmigaDOS OFS/FFS
353359
{
354360
const struct Resident * prt;
355361
UWORD verFS;
@@ -360,14 +366,10 @@ BOOL bGetDosDevice(struct DosList *pdlDevice, ULONG flags)
360366
would be a bit pointless. Perhaps I should use TypeOfMem
361367
to decide whether the segment is in ROM or RAM first? */
362368

363-
prt = (struct Resident *)((char *)BADDR(
364-
pdlDevice->dol_misc.dol_handler.dol_SegList) + 4);
365-
while( prt->rt_MatchWord != RTC_MATCHWORD
366-
|| prt->rt_MatchTag != prt )
367-
prt = (struct Resident *)((UWORD *)prt + 1);
369+
prt = (struct Resident *)((char *)BADDR(pdlDevice->dol_misc.dol_handler.dol_SegList) + 4);
370+
while( prt->rt_MatchWord != RTC_MATCHWORD || prt->rt_MatchTag != prt ) prt = (struct Resident *)((UWORD *)prt + 1);
368371
verFS = prt->rt_Version;
369-
DD(bug( "found RomTag at 0x%08lx; rt_Version = %lu\n",
370-
(ULONG)prt, (ULONG)verFS ));
372+
DD(bug( "found RomTag at 0x%08lx; rt_Version = %lu\n", (ULONG)prt, (ULONG)verFS ));
371373

372374
/* check that the fs can handle this device correctly */
373375

0 commit comments

Comments
 (0)