WFSINITing IDE disc for a Level 3 File Server

comms devices, modems, serial links, terminal software, BBS's, memories from the past, Prestel/Micronet etc
Post Reply
marrold
Posts: 158
Joined: Wed Feb 02, 2022 8:36 pm
Contact:

WFSINITing IDE disc for a Level 3 File Server

Post by marrold »

Hi all,

I've been experimenting with setting up a Level 3 File Server on a Model B. I've previously gone through the process with Pi1MHz emulating a SCSI disc which worked fine, but now I am trying with an IDE adapter and SD card I'm not having much luck.

I've formatted the CF card with "HDInit", and copied the L3 file server files across but when attempting to run "WFSINIT" it fails due to "Bad DIM at line 380".

I'm using the L3FS-ISW disk originally supplied with BeebEm, so I also attempted to use WFS-IW which I assume is a patched version from BeebMaster, but it seems to corrupt the disk. On the first attempt it appeared to complete successfully but I got a "Bad Directory" error and could no longer read the disk. On subsequent attempts it didn't complete successfully with the error "Bad FS map at line 4770" and now I get "Bad FS Map" on boot.

Does anyone have any suggestions, or the latest and greatest WFSINIT that can handle IDE discs?

Thanks
User avatar
jgharston
Posts: 5321
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: WFSINITing IDE disc for a Level 3 File Server

Post by jgharston »

It falls over because the disk is a lot larger than it expects. I tweeked WFSInit here:
https://mdfs.net/Apps/Networking/FServers/

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.45
(C) Copyright J.G.Harston 1989,2005-2024
>_
marrold
Posts: 158
Joined: Wed Feb 02, 2022 8:36 pm
Contact:

Re: WFSINITing IDE disc for a Level 3 File Server

Post by marrold »

jgharston wrote: Fri Dec 15, 2023 12:45 pm It falls over because the disk is a lot larger than it expects. I tweeked WFSInit here:
https://mdfs.net/Apps/Networking/FServers/
I stumbled across that one after posting but after displaying "Scanning Drive 0" and "Drive Size: 5XXXXXXK" it seemed to freeze with a blinking cursor and no activity light on the IDE interface. I gave it 20 minutes but it seemed to hang there - perhaps I didn't leave it long enough?
User avatar
jgharston
Posts: 5321
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: WFSINITing IDE disc for a Level 3 File Server

Post by jgharston »

Hmm... It worked last time I tried it. ;) I'll have a look later.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.45
(C) Copyright J.G.Harston 1989,2005-2024
>_
marrold
Posts: 158
Joined: Wed Feb 02, 2022 8:36 pm
Contact:

Re: WFSINITing IDE disc for a Level 3 File Server

Post by marrold »

Thanks. I checked with Mark and the fundamental operation of the IDE interface hasn't changed since the DataCentre so there should be a way to get it working if its worked previously on the DataCentre

This thread and this archived page from BeebMaster's site are relevant but both are for a Master.
marrold
Posts: 158
Joined: Wed Feb 02, 2022 8:36 pm
Contact:

Re: WFSINITing IDE disc for a Level 3 File Server

Post by marrold »

Having looked around a bit more it looks like most people that have managed to get this working used a Master to initialise the image.

Unfortunately I don't have a Master to try it, has anyone got a raw image of their CF card with the ADFS and Econet partitions setup that I can try writing to the card with a PC?

Cheers
User avatar
BeebMaster
Posts: 7380
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: WFSINITing IDE disc for a Level 3 File Server

Post by BeebMaster »

That webpage is still live, but as my hosting thing is now Linux based, it's all case sensitive, so it needs to be:

https://www.beebmaster.co.uk/Econet/L3CF.html

It's been a long time since I did anything with IDE discs. I dallied for a while, then took hold of myself and went back to SCSI.

However my L3 server is still using a Retroclinic CF hard drive with (Master 128) ADFS 1.53. Originally it was "formatted" with JGH's HDInit, and then initialised for L3 with some form or other of WFSInit.

It's also been a long time since I did any WFSInit development, but my latest version 1.7 from 2020 claims to work with ADFS 1.33 and 1.53, so please have a go, bearing in mind it might break existing discs/Beebs/National Grid/foment wars in far-flung parts, etc.:

Code: Select all

  100REM > WFSInitFul
  120REM Initialiser Version 0.90 - (C) Acorn Computers plc 1985
  140REM ISW Version 1.7 10/8/20
  150REM Version history to date has
  155REM been removed to save space
  160REM (see 1.6 for details)
  170REM Now works correctly with IDE
  180REM ADFS 1.33/53
  520ONERRORV%=VPOS+2:VDU26:PRINTTAB(0,V%):REPORT:PRINT" at line"ERL:END
  540DIMname% 250
  560from%=8:to%=8
  580MODE7:REM@%=5
  620osword%=&FFF1:osbyte%=&FFF4:osfile%=&FFDD:osgbpb%=&FFD1:oscli%=&FFF7:osfind%=&FFCE
  640srcdrive%=0:REM new variable to read master dirs, alter if not dr.0 //ISW 17/7/10
  660spt%=33:REM Default no of sectors per track; alter to 46 or 47 for RLL controller //ISW 22/7/20
  680beebscsi=FALSE
  720pssz%=&100:drsz%=&200
  740bufsze%=&400:REM Was &900 //ISW 9/8/20
  760DIMtrcb% 20,tempname% 50,t% 1,c% 5
  780DIMtn2% 20,pass% 256
  800DIMbuf% drsz%,dir% drsz%,cli% 80,sec0% 512,dbuff% bufsze%
  820DIMosblock 32, result 16:REM for BeebSCSI sense call //ISW 9/2/20
  840namelength%=20:passlength%=6:free%=26:option%=30
  860adfsdirsize%=5
  880maxspc%=2040
  900maxcap%=&200000:REM Max ADFS size
  910sectorspcyl%=0:REM //ISW 9/8/20
  920lsig%=&0000FFFF:msig%=&FFFF0000
  940tradd%=1:cmd%=5:longth%=11
  960X%=dbuff%:Y%=dbuff%DIV256:A%=&70:CALLosword%
  980inuse%=0:freep%=inuse%+13:objcount%=freep%+2
 1000objname%=2:objload%=objname%+10:objexec%=objload%+4:objacc%=objexec%+4:objdate%=objacc%+1
 1020objsin%=objdate%+2:objsze%=objsin%+3
 1040infof%=10
 1060SPACE%=ASC" "
 1080FORi%=1TO2:PRINTCHR$141+"File Server Disc Initialiser":NEXT
 1100VDU28,0,24,39,3
 1120INPUT"Drive number:"TAB(20)drivenumber%
 1140PROCoscli("MOUNT "+STR$drivenumber%)
 1160beebscsi=FNBeebSCSI
 1180IFbeebscsi PRINT"BeebSCSI detected":spt%=32:REM Set to 32 spt for BeebSCSI for round disc geometry //ISW 22/7/20
 1200REMREPEAT:REMPROCoscli("Compact 30 4C")
 1220PROCread(sec0%,512,0)
 1240IFFNafs PRINT" DISC ALREADY CONTAINS NET PARTITION!":PROCproceed
 1280IFsec0%?510>3PRINT"DISC NOT COMPACTED - DATA WILL BE LOST!ƒCOMPACT THE DISC FIRST!":END
 1300REPEATINPUT"Disc name:"TAB(20)$tempname%
 1320IFLEN$tempname%>16PRINT"Name should be less than 16 characters"':UNTIL0
 1340IFLEN$tempname%ELSEUNTIL0
 1360i%=0:REPEATi%=i%+1:UNTILi%>=LEN$tempname%ORtempname%?i%<=SPACE%ORtempname%?i%>=127
 1380IFINSTR($tempname%," ")PRINT"Space is Illegal":UNTIL0
 1400UNTILi%>LEN$tempname%-1
 1420res%=FNdrive(drivenumber%):IF?trcb%PRINT"Not an ST506 disc":PROCgetscsiparms ELSEdisccylinders%=res%AND&FFFF:hds%=(res%AND&FF0000)DIV&10000
 1430IFsectorspcyl%=0 sectorspcyl%=hds%*spt%:REM if not read by mode sense ISW 9/8/2020
 1440REM PUT BODGED GEOMETRY HERE FOR TESTING PURPOSESdisccylinders%=1024:hds%=64:sectorspcyl%=1024
 1460capax%=disccylinders%*sectorspcyl%
 1480PRINT'"Disc Geometry Detected:"
 1500PROCshowparms
 1520PROCoptimiseparms
 1540INPUT'"Modify geometry?"TAB(20)mod$:IFmod$="Y"ORmod$="y"ORmod$="YES"ORmod$="yes"PROCmodparms
 1560IFFNoverflow PRINT"Capacity error: unable to read last     sector on disc":END
 1580cymapsz%=disccylinders%*2+3
 1600DIMcymap% cymapsz%+4
 1620FORi%=0TOcymapsz%+4STEP4:cymap%!i%=0:NEXT
 1640REMbitmapsze%=((((sectorspcyl% DIV 8)+1) DIV 256)+1)*256  ORIGINAL ACORN CALC
 1660bitmapsze%=sectorspcyl%DIV8
 1680IFsectorspcyl%DIV8=sectorspcyl%/8ELSEbitmapsze%=bitmapsze%+1
 1700IFbitmapsze%MOD256=0ELSEbitmapsze%=((bitmapsze%DIV256)+1)*256:REM New calc ISW 22/7/20
 1720PRINT"Free space bitmaps: ";bitmapsze%;" bytes"
 1740INPUT"Next drive:"TAB(20)additionfact%:additionfact%=additionfact%-drivenumber%
 1760DIMdblock% bitmapsze%,mpblk% bitmapsze%
 1780Q%=FNget_date_User
 1800PROCproceed:REM ISW 28/7/20 Last chance to abort
 1820PRINT"Please wait ....";
 1840PROCto:GOTO2020:REM Don't make bootable
 1860PROCto:PROCoscli("s.$.!Boot 400+8500"):g%=FNopen("$.!boot",&C0)
 1880PROCfrom:h%=FNopen(":0.$.fs",&40)
 1900REPEATPROCfrom:trcb%?0=h%:trcb%!1=dbuff%:trcb%!5=bufsze%
 1920X%=trcb%:Y%=trcb%DIV256:A%=4:CALLosgbpb%:bit%=bufsze%-trcb%!5
 1940PROCto:trcb%?0=g%:trcb%!1=dbuff%:trcb%!5=bit%
 1960X%=trcb%:Y%=trcb%DIV256:A%=2:CALLosgbpb%
 1980UNTILbit%<>bufsze%:CLOSE#g%
 2000PROCfrom:CLOSE#h%:PROCto
 2020PROCread(sec0%,512,0):REM read sector zero, one
 2040fssze%=((sec0%!0)AND&FFFFFF)*256+&2000:REM space for ADFS structure //ISW 9/2/20 reduce from &4000 to &2000
 2060discinfo%=dblock%:fourchars%=discinfo%
 2080dname%=fourchars%+4:nocyls%=dname%+16
 2100nosecs%=nocyls%+2:ndscs%=nosecs%+3
 2120secpcyl%=ndscs%+1:szobtmp%=secpcyl%+2
 2140addfact%=szobtmp%+1:drinc%=addfact%+1
 2160TheSinOfroot%=drinc%+1:date%=TheSinOfroot%+3
 2180startcyl%=date%+2
 2200FORi%=0TObitmapsze%-1STEP4:dblock%!i%=0:NEXT
 2220tfree%=adfsdirsize%+2:REM for the map
 2240tfree%=tfree%+fssze%DIV256
 2260IFfssze%MOD256 tfree%=tfree%+1
 2280stcyl%=tfree%DIVsectorspcyl%
 2300IFtfree%MODsectorspcyl% stcyl%=stcyl%+1
 2320adfsdiscsize%=stcyl%*sectorspcyl%
 2340sec1%=stcyl%*sectorspcyl%+1
 2360sec2%=sec1%+sectorspcyl%
 2380PRINT
 2400PROCinitmaps:PROCfreeinfospace
 2420PRINT
 2440sec0%!&F6=sec1%
 2460sec0%!256=adfsdiscsize%-sec0%!0
 2480sec0%!502=sec2%
 2500sec0%!252=stcyl%*sectorspcyl%:REM new disc size
 2520sec0%?255=FNchecksum(sec0%):sec0%?511=FNchecksum(sec0%+256)
 2530PRINT"Writing new ADFS free space map";
 2540PROCwrite(sec0%,512,0)
 2560FORi%=0TO255STEP4:discinfo%!i%=0:NEXT
 2580root%=FNablk(drsz%)
 2600REM now create and write out sector 2 and sector 12
 2620FORi%=0TO255STEP4:discinfo%!i%=0:NEXT
 2640$fourchars%="AFS0":$dname%=$tempname%
 2660FORi%=LEN$dname%TO16:dname%?i%=SPACE%:NEXT
 2680nocyls%!0=disccylinders%
 2700nosecs%!0=disccylinders%*sectorspcyl%
 2720ndscs%!0=1
 2740secpcyl%!0=sectorspcyl%
 2760szobtmp%?0=bitmapsze%DIV256
 2780addfact%?0=additionfact%
 2800drinc%?0=1:REM next logical drive
 2820TheSinOfroot%!0=root%-1
 2840date%!0=Q%
 2860startcyl%!0=stcyl%
 2870PRINT'"Writing NFS first sector at &";~sec1%;
 2880PROCwrite(discinfo%,256,sec1%)
 2890PRINT'"Writing NFS copy sector at &";~sec2%;
 2900PROCwrite(discinfo%,256,sec2%):REM second sector
 2920PROCto:PROCoscli("dir")
 2940PROCsetup(root%)
 2960PRINT'''"** Disc initialised **"
 2980V%=VPOS+2:VDU26:PRINTTAB(0,V%):END
 3020DEFPROCread(straddr%,bytes%,startsector%)
 3040REM read data from disc
 3060trcb%?cmd%=8
 3080GOTO3180
 3100DEFPROCwrite(straddr%,bytes%,startsector%)
 3120REM write data to disc
 3140trcb%?cmd%=&A
 3160IFstartsector%<2 straddr%?&FF=FNchecksum(straddr%)
 3180addhi%=startsector%DIV&10000
 3200addhi%=addhi%OR(drivenumber%*32)
 3220trcb%?(cmd%+1)=addhi%
 3240trcb%?(cmd%+2)=startsector%DIV&100
 3260trcb%?(cmd%+3)=startsector%
 3280trcb%?(cmd%+4)=0
 3300trcb%?(cmd%+5)=0
 3320trcb%?0=0
 3340trcb%!tradd%=straddr%
 3360trcb%!longth%=bytes%
 3380A%=&72:X%=trcb%:Y%=trcb%DIV256
 3400CALLosword%
 3420IFtrcb%?0PRINT"Disc error "~?trcb%:END
 3440ENDPROC
 3460DEFPROCsetbit(n%)
 3480REM set a bit
 3500LOCALbyte%,curval%,bit%:byte%=n%DIV8
 3520curval%=dblock%?byte%
 3540bit%=n%MOD8
 3560curval%=curval%OR(2^bit%)
 3580dblock%?byte%=curval%
 3600ENDPROC
 3620DEFPROCresbit(n%)
 3640REM reset a bit
 3660LOCALbyte%,curval%,bit%:byte%=n%DIV8
 3680curval%=dblock%?byte%
 3700bit%=n%MOD8
 3720curval%=curval%AND(NOT(2^bit%))
 3740dblock%?byte%=curval%
 3760ENDPROC
 3800DEFFNcheckbit(n%)
 3820REM check state of a bit
 3840LOCALbyte%,curval%,bit%:byte%=n%DIV8
 3860curval%=dblock%?byte%
 3880bit%=n%MOD8
 3900=curval%AND(2^bit%)
 3920DEFPROCgetnext
 3940REM find next cylinder with free space
 3960LOCALi%,nd%:i%=oset%
 3980nd%=disccylinders%
 4000REPEATREPEATi%=i%+1
 4020UNTIL((cymap%!((i%-1)*2+3)MOD&10000)OR(i%=nd%))
 4040IFcymap%!((i%-1)*2+3)MOD&10000UNTIL-1:GOTO4100
 4060nd%=oset%-1:i%=1
 4080UNTIL0
 4100oset%=i%:big%=cymap%!((i%-1)*2+3)MOD&10000
 4120ENDPROC
 4140DEFFNablk(btes%)
 4160REM allocate a number of blocks
 4180LOCALnblks%,sin%,alblks%,curoff%,oset%,big%:nblks%=btes%DIV256
 4200IFbtes%MOD256 nblks%=nblks%+1
 4220FORi%=0TObitmapsze%STEP4:mpblk%!i%=0:NEXT
 4240REM find cylinder with largest free space
 4260oset%=0:big%=0
 4280FORi%=1TOdisccylinders%
 4300IFcymap%!((i%-1)*2+3)MOD&10000>big% oset%=i%-1:big%=cymap%!((i%-1)*2+3)MOD&10000
 4320NEXT
 4340PROCread(dblock%,bitmapsze%,oset%*sectorspcyl%)
 4360psn%=-1:REPEATpsn%=psn%+1:UNTILFNcheckbit(psn%):REM find first free block
 4380PROCresbit(psn%)
 4400PROCwrite(dblock%,bitmapsze%,oset%*sectorspcyl%)
 4420sin%=oset%*sectorspcyl%+psn%
 4440PROCremove(1)
 4460alblks%=big%-1:IFbig%-1>nblks% alblks%=nblks%
 4480$mpblk%="JesMap":mpblk%?6=0:curoff%=infof%:REM identifier for Map blocks
 4500PROCread(dblock%,bitmapsze%,oset%*sectorspcyl%)
 4520mpblk%!curoff%=sin%+1
 4540mpblk%!(curoff%+3)=alblks%
 4560FORi%=1TOalblks%:PROCresbit(psn%+i%):NEXT
 4580PROCremove(alblks%)
 4600PROCwrite(dblock%,bitmapsze%,oset%*sectorspcyl%)
 4620nblks%=nblks%-alblks%
 4640IFnblks%>0PROCgetnext:GOTO4460
 4660mpblk%?8=btes%MOD256
 4680PROCwrite(mpblk%,256,sin%)
 4700=sin%+1
 4720DEFPROCremove(n%)
 4740REM remove blocks from cylinder map
 4760LOCALblks%:blks%=!cymap%MOD&1000000
 4780blks%=blks%-n%
 4800?cymap%=blks%:cymap%?1=blks%DIV256:cymap%?2=blks%DIV&10000
 4820blks%=cymap%!(oset%*2+3)MOD&10000
 4840blks%=blks%-n%
 4860cymap%?(oset%*2+3)=blks%:cymap%?(oset%*2+4)=blks%DIV256
 4880ENDPROC
 4900DEFPROCsetup(root%)
 4920REM setup directories and password file
 4940LOCALm%,i%,j%,t%,passptr%,n$,name$:FORi%=0TO508STEP4:buf%!i%=0:NEXT
 4950PRINT'"Creating root directory";
 4960PROCmake_dir("$",root%,buf%)
 4980RESTORE8420
 5000PRINT:REPEATINPUT"Password file (Y/N):"TAB(20)t$:UNTIL(INSTR("YyNn",t$)ANDLENt$=1)
 5020IFINSTR("Yy",t$)ELSE5440
 5040FORi%=0TO252STEP4:i%!pass%=0:NEXT
 5060passptr%=FNenter_name(pass%,0,"Syst",TRUE)
 5080READm%:IFm%ELSE5120
 5100FORJ%=1TOm%:READname$:passptr%=FNenter_name(pass%,passptr%,name$,FALSE):NEXT
 5120dirs%=1
 5140REPEAT
 5160REPEATPRINT"User name ";dirs%":"TAB(20);:INPUT""name$:IFname$=""THEN5420
 5180IFLEN(name$)>10PRINT"Name too long":UNTIL0
 5200$c%=LEFT$(name$,1):IFFNalpha($c%)ELSEPRINT"Must start with a letter":UNTIL0
 5220IFLEN(name$)=1THEN5320
 5240A%=TRUE:FORi%=2TOLEN(name$)
 5260$c%=MID$(name$,i%,1)
 5280IFFNalphanum($c%)ELSEA%=FALSE:PRINT""""$c%""" is invalid"
 5300NEXT:UNTILA%
 5320block1%=FNablk(drsz%)
 5340PROCmake_dir(name$,block1%,dir%)
 5360PROCenter_dir(name$,&30,block1%-1,0,0,buf%)
 5380passptr%=FNenter_name(pass%,passptr%,name$,FALSE)
 5400dirs%=dirs%+1:UNTILdirs%>13
 5420PROCenter_dir("Passwords",&0,FNwrite_PW-1,0,0,buf%)
 5440PROCcopyfiles(buf%)
 5460PROCwrite(buf%,drsz%,root%)
 5480ENDPROC
 5500DEFFNalpha(char$)
 5520REM check if alphabetic character
 5540IFchar$ < "A" =FALSE
 5560IFchar$ > "z" =FALSE
 5580=NOT((char$>"Z")AND(char$<"a"))
 5600DEFFNalphanum(char$)
 5620REM check if alphanumeric character
 5640IF((char$="!")OR(char$="-")) =TRUE
 5660IFFNnumeric(char$)THEN=TRUE ELSE=FNalpha(char$)
 5680DEFFNcompare(S1$,s2%)
 5700LOCALch1%,ch2%
 5720REM compare two strings
 5740FORi%=0TO9
 5760IFs2%?i%=SPACE%THENtn2%?i%=13ELSEtn2%?i%=s2%?i%
 5780NEXT
 5800tn2%?i%=13
 5820REM returns TRUE if S1 "<" S2
 5840index%=0:res%=1
 5860eq%=(LENS1$=LEN$tn2%)
 5880REPEAT
 5900ch1%=ASC(MID$(S1$,index%,1)):IFFNalpha(CHR$ch1%)THENch1%=ch1%AND&DF
 5920ch2%=ASC(MID$($tn2%,index%,1)):IFFNalpha(CHR$ch2%)THENch2%=ch2%AND&DF
 5940IFch1%<>ch2%THENres%=0:UNTILTRUE:GOTO6060
 5960index%=index%+1
 5980IFindex%>LENS1$ res%=TRUE
 6000IFindex%>LEN$tn2% res%=FALSE
 6020UNTILres%<>1
 6040IFeq%THEN=1ELSE=res%
 6060=ch1%<ch2%
 6080DEFPROCmake_dir(name$,s1%,dir%)
 6100REM create a directory
 6120FORi%=0TOdrsz%-1STEP4:dir%!i%=0:NEXT
 6140$(dir%+3)=name$+"          ":dir%?(3+LEN(name$))=SPACE%
 6160dir%!freep%=&1E5
 6180j%=0:FORi%=&11TO&1E6STEPobjsze%
 6200dir%!i%=j%:j%=i%:NEXT
 6220PROCwrite(dir%,drsz%,s1%)
 6240ENDPROC
 6260DEFPROCenter_dir(n$,acc%,sn%,la%,ea%,buff%)
 6280LOCALpt%,lpt%,gt%,sp%
 6300pt%=inuse%
 6320REPEAT
 6340lpt%=pt%
 6360pt%=(buff%!pt%)ANDlsig%
 6380IFpt%THENgt%=FNcompare(n$,buff%+pt%+objname%)ELSEgt%=TRUE
 6400UNTILgt%
 6420IF((buff%!lpt%)ANDlsig%)ELSEbuff%!lpt%=(((buff%!lpt%)ANDmsig%)OR((buff%!freep%)ANDlsig%))
 6440sp%=((buff%!freep%)ANDlsig%)
 6460buff%!freep%=(buff%!freep%ANDmsig%)OR(buff%!sp%ANDlsig%)
 6480buff%?lpt%=sp%:buff%?(lpt%+1)=sp%DIV256
 6500buff%?sp%=pt%:buff%?(sp%+1)=pt%DIV256
 6520$(sp%+objname%+buff%)=n$+"          ":buff%?(sp%+objname%+LEN(n$))=SPACE%
 6540buff%!(sp%+objload%)=la%
 6560buff%!(sp%+objexec%)=ea%
 6580buff%?(sp%+objacc%)=acc%
 6600buff%!(sp%+objdate%)=Q%
 6620buff%!(sp%+objsin%)=((buff%!(sp%+objsin%))ANDmsig%)ORsn%
 6640buff%!objcount%=(buff%!objcount%)+1
 6660ENDPROC
 6680DEFFNwrite_PW
 6700REM allocate and write out Password file
 6720LOCALs1%:s1%=FNablk(pssz%)
 6740PROCwrite(pass%,256,s1%)
 6760=s1%
 6780DEFFNget_date_User
 6800REM input the date
 6820LOCALi%,j%,k%,z%,X%,Y%,A%,z$
 6840REPEATINPUT"Date (dd/mm/yy):"TAB(20)$trcb%
 6860j%=0
 6880FORk%=0TO1:i%=j%
 6900j%=INSTR($trcb%,"/",i%+1):NEXT
 6920IFj%=0UNTIL0
 6940z$=LEFT$($trcb%,i%-1)
 6960IFLENz$>2UNTIL0
 6980IFLENz$=0UNTIL0
 7000IFFNnumeric(z$)ELSEUNTIL0
 7020z%=EVALz$
 7040IFz%>31UNTIL0
 7060z$=MID$($trcb%,i%+1,j%-i%-1)
 7080IFLENz$>2UNTIL0
 7100IFLENz$=0UNTIL0
 7120IFFNnumeric(z$)ELSEUNTIL0
 7140Y%=EVALz$
 7160IFY%>12UNTIL0
 7180z$=RIGHT$($trcb%,(LEN$trcb%)-j%)
 7200IFLENz$>2UNTIL0
 7220IFLENz$=0UNTIL0
 7240IFFNnumeric(z$)ELSEUNTIL0
 7260X%=1900+EVALz$:X%=X%-100*(X%<1981):UNTILY%+z%:X%=X%-1981:=z%+Y%*256+(X%AND15)*4096+(X%DIV16)*32:REM //ISWviaJGH
 7280DEFFNnumeric(num$)
 7300REM check if numeric character
 7320LOCALA%,v$:A%=TRUE:FORl%=1TOLENnum$
 7340v$=MID$(num$,l%,1)
 7360IFA%THENA%=((v$>="0")AND(v$<="9"))
 7380NEXT:=A%
 7400DEFFNchecksum(data%)
 7420REM Forms end-around carry checksum on 255 bytes of data
 7440LOCALcsum%,i%
 7460csum%=&FF
 7480FORi%=254TO0STEP-1
 7500IF(csum%DIV256)>0 csum%=(csum%AND&FF)+1
 7520csum%=csum%+data%?i%
 7540NEXT
 7560=csum%AND&FF
 7580DEFPROCinitmaps
 7600REM initialise the disc maps
 7620LOCALfreesecs%,ttsecs%:freesecs%=sectorspcyl%-1:ttsecs%=0
 7640PRINT"Creating bitmap...";
 7660FORj%=0TObitmapsze%-1STEP4:dblock%!j%=0:NEXT:FORj%=1TOsectorspcyl%-1:PROCsetbit(j%):NEXT
 7700FORi%=stcyl%TOdisccylinders%-1
 7720IFi%=0 PRINT"for cyl 0...";:PROCread(dblock%,bitmapsze%,i%*sectorspcyl%):FORj%=1TOsectorspcyl%-1:PROCsetbit(j%):NEXT
 7740IFi%=1 PRINT"for cyl 1...";:FORj%=0TObitmapsze%-1STEP4:dblock%!j%=0:NEXT:FORj%=1TOsectorspcyl%-1:PROCsetbit(j%):NEXT:PRINT
 7760VDU13:PRINT"Writing bitmap to cylinder ";i%;
 7780PROCwrite(dblock%,bitmapsze%,i%*sectorspcyl%)
 7800cymap%!(i%*2+3)=freesecs%
 7820ttsecs%=ttsecs%+freesecs%
 7840NEXT
 7860?cymap%=ttsecs%MOD256:cymap%?1=ttsecs%DIV256:cymap%?2=ttsecs%DIV&10000
 7880ENDPROC
 7900DEFPROCfreeinfospace
 7920REM free space for info sectors
 7940LOCALcysec1%,cysec2%
 7960cysec1%=(sec1%DIVsectorspcyl%)*sectorspcyl%
 7980cysec2%=(sec2%DIVsectorspcyl%)*sectorspcyl%
 7990PRINT'"Updating bitmaps for sectors &";~cysec1%'"and &";~cysec2%;
 8000IF(sec1%DIVsectorspcyl%)<stcyl%GOTO8100
 8020PROCread(dblock%,bitmapsze%,cysec1%)
 8040PROCresbit(sec1%MODsectorspcyl%)
 8060PROCwrite(dblock%,bitmapsze%,cysec1%)
 8080PROCsubcyl(1,(sec1%DIVsectorspcyl%))
 8100PROCread(dblock%,bitmapsze%,cysec2%)
 8120PROCresbit(sec2%MODsectorspcyl%)
 8140PROCwrite(dblock%,bitmapsze%,cysec2%)
 8160PROCsubcyl(1,(sec2%DIVsectorspcyl%))
 8180ENDPROC
 8200DEFPROCsubcyl(n%,c%)
 8220REM free space in cylinder map
 8240LOCALttsecs%,t%:ttsecs%=ttsecs%-n%
 8260t%=cymap%!(c%*2+3)AND&FFFF
 8280t%=t%-n%
 8300cymap%?(c%*2+3)=t%:cymap%?(c%*2+4)=t%DIV256
 8320?cymap%=ttsecs%:cymap%?1=ttsecs%DIV&100:cymap%?2=ttsecs%DIV&10000
 8340ENDPROC
 8360REM data for creating new directories
 8380REM data is in the form [number of entries,entry 1 string,..]
 8420DATA1,Boot
 8440REM files to be transferred in the form [network directory name, disc directory name, name1,name2,....,] ending in a null name
 8460DATALibrary,$.Library
 8480DATAClose,Date,Discs,FindLib,Flip,Free,FS,LCat
 8500DATALex,Notify,Prot,Ps,ReadFree,Remote,SetFree,Time,Unprot,Users,View,
 8520DATALibrary1,$.Library1
 8540DATABas128,BasObj,Date,Discs,FindLib,Free,Netmon,Notify
 8560DATAReadFree,Remote,Set,SetFree,Time,Users,View,
 8580DATAUtils,$.Utils
 8600DATAArchive,CopyFiles,DirCopy,GetBack,L2To3,LogCopy,NetMgr,SetStation,SetTime,TreeCopy
 8620DATA,,
 8640DEFPROCcopyfiles(root%)
 8660RESTORE8460
 8680LOCALdirsn%,hla%,hea%,hsz%,flsn%,netdir$,discdir$
 8700INPUT"Copy master directories (Y/N): "netdir$:IF((netdir$="Y")OR(netdir$="y"))THENREADnetdir$,discdir$ELSEENDPROC
 8720A%=229:X%=1:Y%=0:REMCALLosbyte //ISW 17/7/10
 8740REPEATPRINT'"Copying "netdir$" directory .."
 8760PROCfrom:PROCoscli("DIR :"+STR$srcdrive%+"."+discdir$):PROCto:REM //ISW 17/vii/2010
 8780dirsn%=FNablk(drsz%)
 8800PROCmake_dir(netdir$,dirsn%,dir%)
 8820PROCenter_dir(netdir$,&30,dirsn%-1,0,0,root%)
 8840READ$tempname%
 8860REPEAT:PRINT"Copying "$tempname%" .."
 8880PROCfrom
 8900!trcb%=tempname%
 8920A%=5:X%=trcb%:Y%=trcb%DIV256:CALLosfile%
 8940hla%=trcb%!2:hea%=trcb%!6:hsz%=trcb%!10
 8960PROCto
 8980flsn%=FNablk(hsz%)
 9000PROCenter_dir($tempname%,&15,flsn%-1,hla%,hea%,dir%)
 9020PROCtransfile($tempname%)
 9040READ$tempname%
 9060UNTIL$tempname%=""
 9080PROCwrite(dir%,drsz%,dirsn%)
 9100READnetdir$,discdir$
 9120UNTILnetdir$=""
 9140A%=229:X%=0:Y%=0:CALLosbyte%
 9160ENDPROC
 9180DEFPROCtransfile(name$)
 9200LOCALh%,curoff%,cursize%,cursin%,chunk%
 9220PROCfrom:PROCoscli("DIR :"+STR$srcdrive%+"."+discdir$):h%=FNopen(name$,&40):IFh%ELSEPRINT"File "name$" not found":ENDPROC:REM //ISW 17/vii/2010
 9240curoff%=infof%:cursin%=(mpblk%!curoff%)AND&FFFFFF
 9260IFcursin%ELSE9560
 9280REPEAT
 9300cursize%=(mpblk%!(curoff%+3)AND&FFFF)*256
 9320REPEAT
 9340PROCfrom
 9360chunk%=cursize%:IFchunk%>bufsze%THENchunk%=bufsze%
 9380?trcb%=h%:trcb%!1=dbuff%:trcb%!5=chunk%
 9400X%=trcb%:Y%=trcb%DIV256:A%=4:CALLosgbpb%
 9420PROCto:PROCwrite(dbuff%,chunk%,cursin%)
 9440cursize%=cursize%-chunk%
 9460cursin%=cursin%+(chunk%DIV256)
 9480UNTILcursize%=0
 9500curoff%=curoff%+5
 9520cursin%=(mpblk%!curoff%)AND&FFFFFF
 9540UNTILcursin%=0
 9560PROCfrom:CLOSE#h%:PROCto
 9580ENDPROC
 9600DEFFNfindsin(n$)
 9620LOCALpt%,gt%:pt%=inuse%
 9640REPEAT
 9660pt%=buf%!pt%ANDlsig%
 9680gt%=pt%=0:IFgt%ELSEgt%=FNcompare(n$,buf%+pt%+objname%)=1
 9700UNTILgt%
 9720IFpt%THEN=buf%!(pt%+objsin%)AND&FFFFFFELSE=0
 9740DEFPROCfrom:ENDPROC:REM //ISW 17/vii/2010
 9760DEFPROCto:ENDPROC:REM //ISW 17/vii/2010
 9780DEFPROCfs(no%)
 9800REM selects filing system
 9820LOCALA%,X%,Y%
 9840A%=&8F:X%=&12:Y%=no%:CALLosbyte%
 9860ENDPROC
 9880DEFPROCoscli($cli%)
 9900LOCALX%,Y%,A%
 9920X%=cli%:Y%=cli%DIV256:CALLoscli%
 9940ENDPROC
 9960DEFFNdrive(d%)
 9980REM get drive characteristics
10000LOCALX%,Y%,A%
10020trcb%?0=0:trcb%!1=buf%:trcb%!5=&1A+(d%*8192):trcb%!9=22
10040X%=trcb%:Y%=trcb%DIV256:A%=&72:CALL&FFF1
10060=buf%?14+(buf%?13*256)+(buf%?15*256*256)
10080DEFFNenter_name(pass%,passptr%,name$,priv%)
10100$(pass%+passptr%)=name$
10120pass%?(passptr%+namelength%)=13:pass%!(passptr%+free%)=&40000000:pass%?(passptr%+option%)=&80+(priv%AND&40)
10140= passptr%+option%+1
10160DEFFNopen(name$,how%)
10180LOCALA%,X%,Y%:$name%=name$
10200X%=name%:Y%=name%DIV256:A%=how%
10220=(USRosfind%)AND&FF
10240DEFPROCgetscsiparms
10260REM First see if floppy
10280IFdrivenumber%>3PRINT"Floppy disc":disccylinders%=80:hds%=2:sectorspcyl%=hds%*16:ENDPROC:REM **ASSUMES 640K**** //ISW 22/7/20
10300FORmp%=4TO3STEP-1
10320A%=&72
10340X%=trcb%MOD256
10360Y%=trcb%DIV256
10380?trcb%=0
10400trcb%!1=buf%
10420trcb%?5=&1A:REM mode sense
10440trcb%?6=drivenumber%*32
10460trcb%?7=mp%
10480trcb%?8=0:REM reserved
10500trcb%?9=35
10520trcb%?10=0:REM Control
10540CALL&FFF1
10560IF?trcb%<>0PRINT"Error ";?trcb%;" in Mode Sense ";mp%;'"Disc geometry will have to be input     manually":PROCmodparms:mp%=0
10580IFmp%=4 disccylinders%=(buf%?14*65536+buf%?15*256+buf%?16):hds%=buf%?17
10600IFmp%=3  sectorspcyl%=hds%*(buf%?22*256+buf%?23)
10620NEXT
10640ENDPROC
10660DEFFNBeebSCSI
10680A%=&72
10700X%=osblock MOD256
10720Y%=osblock DIV256
10740?osblock=0
10760osblock!1=result
10780osblock?5=&D0:REM BeebSCSI Sense
10800osblock!6=0:REM reserved
10820osblock?9=8:REM 8 bytes returned
10840osblock!10=0:REM reserved
10860CALL&FFF1
10880IF?osblock=0 =TRUE ELSE=FALSE
10900DEFPROCoptimiseparms
10920IFcapax%>maxcap% disccylinders%=INT(maxcap%/sectorspcyl%):capax%=disccylinders%*sectorspcyl%:PRINT"Max capacity exceeded - reducing disc   cylinders to ";disccylinders%
10940IFsectorspcyl%>maxspc%PROCreducespc:ENDPROC
10960IFsectorspcyl%<maxspc%PROCincreasespc
10980ENDPROC
11000DEFPROCreducespc
11020PRINT'"Reducing sectors per cylinder to ";maxspc%:sectorspcyl%=maxspc%
11040IFdisccylinders%*sectorspcyl%<capax% disccylinders%=INT(capax%/sectorspcyl%):PRINT"Increasing logical cylinders to ";disccylinders%'"New capacity:"TAB(20)"&";~disccylinders%*sectorspcyl%;" sectors":REM //ISW 27/7/20
11060ENDPROC
11080DEFPROCincreasespc
11100REM Work out optimum cyl/spc to maximise available space after bitmaps taken into account - best calc appears to be 2*cyl //ISW 27/7/20
11120newspc%=disccylinders%*2
11140IFnewspc%>maxspc% newspc%=maxspc%
11160newcyl%=INT(capax%/newspc%):newcapax%=newcyl%*newspc%
11180IFnewcapax%-newcyl%>capax%-disccylinders%ELSEENDPROC
11200PRINT"Reducing logical cylinders to ";newcyl%'"New sectors per cyl"TAB(20)newspc%'"New capacity:"TAB(20)"&";~newcapax%;" sectors"
11220IFnewcapax%<capax%PRINT"Capacity has reduced by &";capax%-newcapax%;" sectors"'"This is offset by ";disccylinders%-newcyl%;" fewer sectors required"'"for free space bitmaps"
11240disccylinders%=newcyl%:sectorspcyl%=newspc%
11260ENDPROC
11280DEFPROCshowparms
11300PRINT'"Cylinders:"TAB(20);disccylinders%'"Heads:"TAB(20);hds%'"Sectors per track:"TAB(20);sectorspcyl%/hds%'"Sectors per cyl:"TAB(20);sectorspcyl%'"Disc capacity"TAB(20)"&";~capax%;" sectors"
11320ENDPROC
11340DEFPROCmodparms
11360REPEAT
11380REPEAT
11400INPUT'"Cylinders:"TAB(20)disccylinders%"Heads:"TAB(20)hds%"Sectors per track:"TAB(20)spt%
11420sectorspcyl%=hds%*spt%
11480capax%=disccylinders%*sectorspcyl%
11500PRINT"New capacity:"TAB(20)"&";~capax%;" sectors"
11510PRINT"Sectors per cyl:"TAB(20);sectorspcyl%
11515IFsectorspcyl%>maxspc% PRINT"WARNING - greater than recommended max"
11520IFcapax%>maxcap%PRINT"Capacity exceeds maximum ADFS size"
11530IFcapax%=0 PRINT"Invalid geometry entered"
11532INPUT'"Correct?"TAB(20)mod$
11534UNTILmod$="Y"ORmod$="y"ORmod$="YES"ORmod$="yes"
11540UNTILcapax%<=maxcap% AND capax%>0:ENDPROC
11560DEFFNafs
11580REM Check for existing net partition //ISW 28/7/20
11600netsector%=!(sec0%+246)
11620IFnetsector%=0 =FALSE
11640PROCread(sec0%,256,netsector%)
11660fsdisc$=CHR$?sec0%+CHR$sec0%?1+CHR$sec0%?2+CHR$sec0%?3
11680IFfsdisc$<>"AFS0" =FALSE
11700=TRUE
11720DEFFNoverflow
11740REM Check capacity by reading last sector
11760PRINT"Checking capacity...";
11780PROCread(sec0%,256,capax%-1)
11800REM If error, will have already ended during PROCread
11820PRINT"OK"
11840=FALSE
11860DEFPROCproceed
11880REM Ask to proceed //ISW 28/7/20
11900INPUT"Proceed? (Y/N)"TAB(20)P$
11920IFP$<>"Y"ANDP$<>"YES"PRINT"Ended.":END
11940ENDPROC
Image
User avatar
BeebMaster
Posts: 7380
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: WFSINITing IDE disc for a Level 3 File Server

Post by BeebMaster »

PS this thread is probably better in "Acorn 8 bit hardware" area which is where most Econet topics go.

A long time ago I asked for an Econet sub-forum as it covers 8 bit, 32 bit, hardware, software, utilities, games, RISC IX, comms, Atom, Electron... (Station 2-5-Mod not listening).
Image
User avatar
IanJeffray
Posts: 5963
Joined: Sat Jun 06, 2020 3:50 pm
Contact:

Re: WFSINITing IDE disc for a Level 3 File Server

Post by IanJeffray »

BeebMaster wrote: Mon Dec 18, 2023 6:43 pm PS this thread is probably better in "Acorn 8 bit hardware" area which is where most Econet topics go.

A long time ago I asked for an Econet sub-forum as it covers 8 bit, 32 bit, hardware, software, utilities, games, RISC IX, comms, Atom, Electron... (Station 2-5-Mod not listening).
It's always seemed mildly irritating that anything Econet related gets lost over in the 8bit area - I don't look there much. The fact the PiBridge and PicoNet stuff is in there is pretty silly, but for lack of a better home.
User avatar
BeebMaster
Posts: 7380
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: WFSINITing IDE disc for a Level 3 File Server

Post by BeebMaster »

Re-jigged BBC B Station 128 a bit tonight to add my second CF hard drive, and successfully initialised a CF card for Level 3 file server using HDInit 1.11 (had to use Scan and Investigate drive options a few times till it got it right) and then the version of WFSInit I posted earlier.

I'm quite pleased with that version of WFSInit, I'd forgotten how much I'd done on it. It's a lot better than the previous one I did which STOPs in the middle and has you editing in your own geometry figures. It has a running commentary during the initialisation so you know what's going on. With ADFS, ANFS, DFS and NET in Station 128, PAGE went up to &2200 so I had to use the second processor to run WFSInit.

It doesn't detect the geometry for IDE discs so it has to be input manually. For a 512MB ADFS disc I recommend using 1057x62x32 cylinders x heads x sectors per track which I worked out a long time ago as the optimum settings for a maximum size ADFS disc. The total number of sectors per track has to be kept under 2048 otherwise the sector free space bitmaps go all wrong.

I didn't get much further as annoyingly I can't find a version of the L3 FS which correctly reads the 21st century date from the RTC dongle. Version 1.25 which is patched from 1.24 doesn't read it correctly, and doesn't allow the file server time to be changed using the FS op. Also that version (maybe others) reports different time and date if not logged on than if logged on. It shouldn't do that either, as reading the FS time is one of a small number of FS ops a logged off user is allowed to do.
Image
marrold
Posts: 158
Joined: Wed Feb 02, 2022 8:36 pm
Contact:

Re: WFSINITing IDE disc for a Level 3 File Server

Post by marrold »

Cheers BeebMaster I'll give that a try and it'll be good to have the latest version of WFSInit around.

Mark Haysman also kindly posted his method of initialising the disc on Youtube - https://www.youtube.com/watch?v=hooeZi1GGEU
PS this thread is probably better in "Acorn 8 bit hardware" area which is where most Econet topics go.
I've always found this a bit confusing for the reasons IanJ mentioned. I know the "communications" board is relatively new but it does feel like a better fit.
User avatar
BeebMaster
Posts: 7380
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: WFSINITing IDE disc for a Level 3 File Server

Post by BeebMaster »

I watched that (mind you, I had no sound so I missed any commentary) but I didn't understand why the L3 partition was set to stop at 16MB in on a 512 MB disc, it would leave 496MB unused and inaccessible after the end of the L3 area. Maybe what he actually intended to do was keep 16MB free at the beginning in the ADFS area?

I do this by reserving space in on the ADFS by creating big files before running WFSInit, and then deleting the big files.
Image
User avatar
IanJeffray
Posts: 5963
Joined: Sat Jun 06, 2020 3:50 pm
Contact:

Re: WFSINITing IDE disc for a Level 3 File Server

Post by IanJeffray »

BeebMaster wrote: Tue Dec 19, 2023 3:50 pm I watched that (mind you, I had no sound so I missed any commentary) but I didn't understand why the L3 partition was set to stop at 16MB in on a 512 MB disc, it would leave 496MB unused and inaccessible after the end of the L3 area. Maybe what he actually intended to do was keep 16MB free at the beginning in the ADFS area?
Would the disk map for a 512MB drive not take annoying long to read in and use a lot of RAM on an ickle beeb? So skip the pointlessness - "16MB is enough for anyone".
markusher
Posts: 345
Joined: Tue Jul 17, 2018 10:55 am
Contact:

Re: WFSINITing IDE disc for a Level 3 File Server

Post by markusher »

It does take longer to read the initial disk, but it isn't too much of a deal killer.
-Mark
2 x BBC, 1 Viglen BBC, M128, M512, M128+copro, 1 Master ET, BBC AIV Domesday System, E01S, E01, E20 Filestore, 3 x A4000, RISC PC 600,700, StrongArm. Probably more I've missed and all sorts of bits and pieces.
User avatar
BeebMaster
Posts: 7380
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: WFSINITing IDE disc for a Level 3 File Server

Post by BeebMaster »

Yes, indeed, it takes longer to read the sector bitmaps for a larger disc, and uses up more RAM, reducing the cache. In fact, my experiments with FileStores found that they don't support much more storage than 250MB altogether without the thing falling over, so a maximally expanded FileStore with 4 E60S discs is about the actual limit of what it could take.

16MB isn't really big enough though if you want to use a Level 3 file server for imaging hard discs.

My current L3 file server (with 4MHz co-processor) with CF drive takes 4 minutes to start with 4 512MB "discs" but Pi1MHzSCSI is considerably quicker, and quicker still with a PiTube 1000MHz co-processor.
Image
User avatar
jgharston
Posts: 5321
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: WFSINITing IDE disc for a Level 3 File Server

Post by jgharston »

I've done some experimenting, and a couple of issues cropped up.

Some drives don't like accesses right to the end of the disk. Add the following line:
5135IF sect%>&1DFFFF:=&10
Yep. 1DFFFF not 1FFFFF. Don't know why. Still gives you over 500M.

You need a lot of memory to build the disk map for a large disk. Add the following line:
345DIM A%-1:IF A%+I%*2+1024>HIMEM:PRINT "Out of memory - use larger system":END
That will tell you you need to run the program with more memory. Testing shows that 6502 HiBASIC gives enough memory to initialise a 500M disk. 32K of memory will let you initialise a disk up to around 80M.

I'll upload updated versions to mdfs when I finish tweeking the documentation.

Edit: A bit of arithmetic and some testing shows you need about 64 bytes per Meg of disk space, plus about 8K for WFSInit, so working in reverse, the maximum disk size you can initialise with the BBC I/O computer is around 260M. 8192+260*64 = 24832, VAREND at around &7BE0.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.45
(C) Copyright J.G.Harston 1989,2005-2024
>_
marrold
Posts: 158
Joined: Wed Feb 02, 2022 8:36 pm
Contact:

Re: WFSINITing IDE disc for a Level 3 File Server

Post by marrold »

Thanks for looking into this, I've got a few ways to skin this cat now!
Post Reply

Return to “communications”