ADFS disk fomat for hard disks

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
Post Reply
dave-c
Posts: 6
Joined: Wed Aug 27, 2008 5:26 pm
Location: UK - south west
Contact:

ADFS disk fomat for hard disks

Post by dave-c » Thu Aug 28, 2008 10:49 am

Hi (from a new poster :D ),
i am trying to get a SCSI disk working with a BBC master using a "morley" SCSI 1MHz adaptor. i don't recall the origin of this card but the hardware 'seems' to work ...

i have got to the point where it can read and write sectors in BASIC using the OS calls but the root directory format / free space map isn't right somehow - resulting in "bad directory" when ADFS tries to mount the disk.

I have details of the required ADFS directory structure / free space map, and have even tried to clone the directory/map from a blank floppy disc and verify that it is correctly written but it still results in the same error. i also have a working viglen hard disk (greedy devil that i am :wink: ) and when i swap that in the root directory seems to obey the directory details i am using - it mounts fine - so i am somewhat puzzled :?: :?:

did i miss something ?
is there another copy of the root directory/ FSmap on the hard disk ?
is there some weird hardware issue with the morley SCSI I/F ?
did i upset the magic pixies ??

any diagnostic suggestions will be greatfully recieved [-o< [-o<


system details:
BBC master (mos 3.2) + disabled internal copro (80186)
Morley SCSI / IMHz IF
Fujitsu 512M SCSI disk - formatted to 256 byte sectors

thx in advance, dave

User avatar
retroclinic
Posts: 3032
Joined: Thu Jul 03, 2008 1:22 pm
Location: East Riding of Yorkshire
Contact:

Re: ADFS disk fomat for hard disks

Post by retroclinic » Thu Aug 28, 2008 8:20 pm

Hi.

Which chipset does the Morley board have, or it is Morely's own logic? Have you tried the Acorn, or other brand Winchester Format utilities? If you don't have them, I've got a whole stack of various ones I can email to you for you to try, none of them secifically say they're for Morely tho. PM me if you need them.

I know you said it is formatted 256 byte sectors - you absolutely sure? I've read that SCSI HDs stopped supporting 256 byte/sector formats very soon after it was introduced from SASI.

Mark.

dave-c
Posts: 6
Joined: Wed Aug 27, 2008 5:26 pm
Location: UK - south west
Contact:

Re: ADFS disk fomat for hard disks

Post by dave-c » Fri Aug 29, 2008 2:50 pm

Mark, you may be right about the sector size. the disk 'claims' to be able to support 256 byte sectors (ie BPPS - bytes per physical sector - is flagged as an alterable/saveable parameter) but after the format command is issued it seems to have reverted to 512. the complication is that i was altering the format parameters with a linux box then formatting using the BBC. i'll have another bash at this soon now i know what the correct mode select packet is ...

i did find out that the morley card is good, i swapped it with the one in the viglan HD and it fires right up =D>
the morley card looks like it's either custom chips or PLA's - less than ~ 1/2 dozen chips on a 4*2 inch pcb. a very neat job =D> although not as neat as your IDE interface !! =D> =D> =D>

dave

User avatar
KenLowe
Posts: 760
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: ADFS disk fomat for hard disks

Post by KenLowe » Fri Aug 29, 2008 9:25 pm

I've successfully interfaced several Fujitsu SCSI drives with the BBC using a Viglen host adapter board. I assume you're using the Fujitsu M2684, which is a 512MB drive that both supports SCSI1 and 256 byte sectors?

I used this guide http://www.fujitsu-europe.com/archive/a ... 000009.htm to convert the Fujitsu drives to 256 byte sectors.

I wrote a short BBC program to issue the necessary mode select & SCSI format commands. I also wrote a BBC program to write the FSM and Catalogue. I can post these up if you wish.

Edit 28/03/17: Guide is no longer available on web page. Fortunately I took a print of it back in the day...
SCSIBlockLength.pdf
(15.13 KiB) Downloaded 21 times
Last edited by KenLowe on Tue Mar 28, 2017 9:05 pm, edited 1 time in total.

dave-c
Posts: 6
Joined: Wed Aug 27, 2008 5:26 pm
Location: UK - south west
Contact:

Re: ADFS disk fomat for hard disks

Post by dave-c » Fri Aug 29, 2008 10:05 pm

Ken,
excellent info !!!! and yes, that's the disk i have (2 in fact)
post away please :D

I know the morley adaptor is sound, both by my recent subsitution and that i now remember having it working long ago with a syquest SCSI 'cartridge' disk until it decided to eat its own flying head !!!

i may give it another bash tomorrow ...

thanks again guys :D

edit:
ahh, i forgot to ask about jumpers
i assume its SCSI1 / no parity / no unit attention ??

User avatar
KenLowe
Posts: 760
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: ADFS disk fomat for hard disks

Post by KenLowe » Fri Aug 29, 2008 10:45 pm

I'll transfer the files across from my BBC HDD tomorrow. In the interim, here's a listing of the program to change byte sectors, and format:

Code: Select all

10*FADFS
20DIMX%20:Y%=X%DIV256
30DIMC%20
40?X%=0
50X%!1=C%
60X%?5=&15
70X%?6=&10
80X%?7=0
90X%?8=0
100X%?9=&C
110X%?10=0
120?C%=0
130C%?1=0
140C%?2=0
150C%?3=8
160C%?4=0
170C%?5=0
180C%!6=0
190C%?10=1
200C%?11=0
210A%=&72
220CALL&FFF1
230INPUT"READY TO FORMAT";A$
240?X%=0
250X%!1=C%
260X%?5=4
270X%!6=0
280X%?10=0
290A%=&72
300CALL&FFF1
From memory, formatting will take about 20 minutes - so don't worry that you don't immediately get a the > prompt back

User avatar
KenLowe
Posts: 760
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: ADFS disk fomat for hard disks

Post by KenLowe » Fri Aug 29, 2008 11:01 pm

dave-c wrote:ahh, i forgot to ask about jumpers
i assume its SCSI1 / no parity / no unit attention ??
CNH1 jumpers should be set as follows:

1-2 - OPEN - SCSI ID bit value 1 (ID0)
3-4 - OPEN - SCSI ID bit value 2 (ID0)
5-6 - OPEN - SCSI ID bit value 4 (ID0)
7-8 - SHORT - UNIT ATTENTION enabled
9-10 - OPEN - SCSI bus parity disabled
11-12 - OPEN - SCSI level - CCS/SCSI-1
13-14 - SHORT - Spin up on power up
15-16 - SHORT - RESERVED

User avatar
KenLowe
Posts: 760
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: ADFS disk fomat for hard disks

Post by KenLowe » Sat Aug 30, 2008 6:56 am

Files attached...

FORM256 / FORM256.INI
This will format the SCSI drive to 256 byte sectors
Listing above

ROOT256 / ROOT256.INI
This will write the Root onto the drive once it's been formated 256 byte sectors

Code: Select all

   10 *FADFS
   20 DIMX%20
   30 Y%=X%DIV256
   40 DIMB%1280
   50 FORI%=B%TOB%+1279STEP4:!I%=0:NEXT
   60 B%!1=&6F677548:B%!&4FB=&6F677548:$(B%+&4CC)="$":$(B%+&4D9)="$"
   70 B%?&4D6=2
   80 PRINT"Writing Root"
   90 ?X%=0
  100 X%!1=B%
  110 X%?5=10
  120 X%?6=0
  130 X%!7=&50200
  140 A%=&72
  150 CALL&FFF1
FSM256 / FSM256.INI
This will write the Free Space Map to the drive. Note that you will need to modify line 60 to reflect the available number of sectors that your drive has. I took the Cylinders / Heads / SPT data from http://www.fel.fujitsu.com/archive/archive/00000309.htm (I struggled to determine total number of sectors from the spec sheet for the SCSI drive). Obviously the SPT value is not correct once the drive is formatted 256 byte sectors, and I don't think you can just double this value. It may take a bit of experimentation to find out the true number of available sectors on your drive. Alternatively you may be able to read this from the drive by issuing a SCSI mode command. I've never tried this.

Code: Select all

   10 *FADFS
   20 DIMX%20
   30 Y%=X%DIV256
   40 DIMB%1280
   50 FORI%=B%TOB%+1279STEP4:!I%=0:NEXT
   60 !B%=7:B%!252=((11*977*47)-128):B%!256=((11*977*47)-135):B%!507=0:B%!509=&300
   70 P%=B%+1000:[OPT2:CLC:LDY#&FF:TYA:.p%ADCB%+255,Y:DEY:BNEp%:TAX:DEY:CLC:TYA:.q%ADCB%-1,Y:DEY:BNEq%:STXB%+511:STAB%+255:RTS:]:CALLB%+1000
   80 PRINT"Writing Map"
   90 ?X%=0
  100 X%!1=B%
  110 X%?5=10
  120 X%?6=0
  130 X%!7=0
  140 X%!9=2
  150 A%=&72
  160 CALL&FFF1
WFORM / WFORM.INI
This is the original Format program that came with a Viglen drive I once had, and which was used as a basis to create the above files. I've not included the listing in this post, because the file's too long.
Attachments
ADFS Format 256.zip
ADFS Formatting Utilities
(5.22 KiB) Downloaded 96 times

dave-c
Posts: 6
Joined: Wed Aug 27, 2008 5:26 pm
Location: UK - south west
Contact:

Re: ADFS disk fomat for hard disks

Post by dave-c » Sun Aug 31, 2008 2:01 pm

After following the info above, it's now working !!
I've not worked out the exact no of sectors yet,
hopefully i'll be able to code the relevent "mode sense"
command to get it from the drive ...

Thanks again Ken.

Post Reply