@@ -284,7 +284,7 @@ BOOL bSetDevfFromSz( const char * pszDevFlags )
284284BOOL 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