Z80 co-pro, and datacentre?

discuss both original and modern hardware for the bbc micro/electron
User avatar
jgharston
Posts: 4119
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: Z80 co-pro, and datacentre?

Post by jgharston » Tue Mar 03, 2015 5:05 pm

jgharston wrote:Try this: RFSTools.ssd contains a *RAMCPM command.
As it's not specific to CP/M - for instance, Flex on the 6809 will also use it - I've renamed this to *RAMTRAP.

I'll investigate the other issues people have raised.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.32
(C) Copyright J.G.Harston 1989,2005-2020
>_

User avatar
lurkio
Posts: 2899
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Z80 co-pro, and datacentre?

Post by lurkio » Tue Mar 03, 2015 9:57 pm

jgharston wrote:I've renamed this to *RAMTRAP.
Damn. That means that my *RAMCPM demo/showoff video is already out of date!:

http://www.youtube.com/watch?v=CZil9mC6oq8

(Apologies for the picture quality, the weird camera-angle, and my blundering.)

User avatar
hoglet
Posts: 9438
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: Z80 co-pro, and datacentre?

Post by hoglet » Tue Mar 03, 2015 10:16 pm

I'm still waiting for any kind of rational explanation as to why *DTRAP worked on mine and Jonathan's systems, but not on Lurkio's. Any thoughts on this Jonathan?

Dave

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

Re: Z80 co-pro, and datacentre?

Post by jgharston » Wed Mar 04, 2015 2:07 am

lurkio wrote:Damn. That means that my *RAMCPM demo/showoff video is already out of date!:
http://www.youtube.com/watch?v=CZil9mC6oq8
Is that disk (infocom with HHGTTG on it) protected by any chance? There are some blank-ish entries in the catalog. I tried to clean it up by properly nulling them out, and HITCH2 and PLANET2 promptly stopped working! I also tried simply copying them over to another clean, empty disk, and they also stopped working.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.32
(C) Copyright J.G.Harston 1989,2005-2020
>_

User avatar
hoglet
Posts: 9438
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: Z80 co-pro, and datacentre?

Post by hoglet » Wed Mar 04, 2015 7:06 am

jgharston wrote:
lurkio wrote:Damn. That means that my *RAMCPM demo/showoff video is already out of date!:
http://www.youtube.com/watch?v=CZil9mC6oq8
Is that disk (infocom with HHGTTG on it) protected by any chance?
Not intentionally - I made it back in December. See here for details:
http://www.stardot.org.uk/forums/viewto ... 2l#p100432

Considering the process I went through, it's more likely to be corruption that protection!

Dave

User avatar
lurkio
Posts: 2899
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Z80 co-pro, and datacentre?

Post by lurkio » Wed Mar 04, 2015 8:21 pm

hoglet wrote:
jgharston wrote:Is that disk (infocom with HHGTTG on it) protected by any chance?
Not intentionally - I made it back in December. See here for details:
http://www.stardot.org.uk/forums/viewto ... 2l#p100432
Considering the process I went through, it's more likely to be corruption that protection!
Dave, could you please post the programs you used to process the original CP/M disk images you downloaded? I'm specifically interested in how you stripped out the ANSI control codes at the moment.

User avatar
hoglet
Posts: 9438
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: Z80 co-pro, and datacentre?

Post by hoglet » Wed Mar 04, 2015 8:32 pm

lurkio wrote:
hoglet wrote:
jgharston wrote:Is that disk (infocom with HHGTTG on it) protected by any chance?
Not intentionally - I made it back in December. See here for details:
http://www.stardot.org.uk/forums/viewto ... 2l#p100432
Considering the process I went through, it's more likely to be corruption that protection!
Dave, could you please post the programs you used to process the original CP/M disk images you downloaded? I'm specifically interested in how you stripped out the ANSI control codes at the moment.
I just edited the HITCH and PLANET files in a binary editor on Linux, and saved them as HITCH2 and PLANET2. I used emacs and used it's hexl-mode, which is a hex editor. But I wouldn't recommend this if you have never used emacs before. I'm sure there are much easier to use binary editors.

The other programs (e.g. cpmcp) is part of the cpmtools package, that can be installed with:

Code: Select all

sudo apt-get install cpmtools
The final piece converts between Standard and Acorn CPM images:
https://github.com/hoglet67/CoPro6502/t ... a/cpmutils

The usage of this is:

Code: Select all

java -jar cpmutils.jar <A2S|S2A> <Src CPM Image> <Dst CPM Image>
This basically deals with the differences in track ordering between standard CPM images (which are sequential) and Acorn DSD images which are interleaved.

Let me know if you want me to post a binary build of cpmutils.jar.

Dave

User avatar
lurkio
Posts: 2899
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Z80 co-pro, and datacentre?

Post by lurkio » Wed Mar 04, 2015 9:06 pm

hoglet wrote:I just edited the HITCH and PLANET files in a binary editor on Linux, and saved them as HITCH2 and PLANET2. I used emacs and used it's hexl-mode, which is a hex editor. But I wouldn't recommend this if you have never used emacs before. I'm sure there are much easier to use binary editors.
Thanks, Dave!

Actually, I was hoping you'd tell me how you recognised the ANSI codes! But perhaps that's a silly question. I'll look into it. Not urgent right now; just curious.

I have a copy of cpmtools, and it seems to be working alright. I can extract hitch.com, etc., from the CPM disk image you linked to in the other thread. But there do seem to be an awful lot of CPM disk formats out there! (See the diskdefs file in cpmtools.) Plus, I've found some CPM images that don't seem to be extractable with cpmtools at all. But, again, not a big problem at the mo.

I'll get round to looking at your Java stuff a bit later. Thanks again.

User avatar
hoglet
Posts: 9438
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: Z80 co-pro, and datacentre?

Post by hoglet » Wed Mar 04, 2015 9:17 pm

lurkio wrote:Actually, I was hoping you'd tell me how you recognised the ANSI codes! But perhaps that's a silly question. I'll look into it. Not urgent right now; just curious.
Not silly at all.

I got some hints from here:
http://www.retroarchive.org/cpm/cdrom/C ... RKNOTE.TXT

Dave

User avatar
lurkio
Posts: 2899
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Z80 co-pro, and datacentre?

Post by lurkio » Fri Mar 06, 2015 6:14 pm

jgharston wrote:Is that disk (infocom with HHGTTG on it) protected by any chance? There are some blank-ish entries in the catalog. I tried to clean it up by properly nulling them out, and HITCH2 and PLANET2 promptly stopped working! I also tried simply copying them over to another clean, empty disk, and they also stopped working.
I did manage to copy them to another clean disc-image successfully.
INFOCOM2.DSD.zip
Zork1, Hitchhiker's Guide To The Galaxy, and Planetfall on an interleaved Acorn CP/M DSD disc-image
(256.43 KiB) Downloaded 61 times
I used the CP/M command PIP, in Acorn Z80 emulation mode in Mac BeebEm, to copy the files across. The disc-image works on a real Beeb+DC+Z80 copro too. I've included two versions of the Hitchhiker's interpreter program, the second of which (HITCH2.COM) I pointlessly spent ages hacking (following Dave's link) to enable the display of the screen-top status bar, using VDU codes!
1.png
Hitchiker's -- now with added status!
I've had no luck with Zork2 though. It runs but produces garbage text.
2.png
CP/M Zork2 fails
One of the main problems is the file ZORK2.DAT, which I downloaded from somewhere as a raw data-file (i.e. not on a disc-image of any kind): I don't have a good way of transferring it to an Acorn CP/M disc-image. I did sort of manage to do so after a lot of faffing around with file-splitting and DIP and PIP, but I'm really not sure my crackpot toolchain didn't introduce errors into the data. I've had similar travails with Zork3.
zorks.DSD.zip
Zork1 and Zork2 (Zork2 doesn't work) on an interleaved Acorn CP/M DSD disc-image
(232.94 KiB) Downloaded 51 times
hoglet wrote:

Code: Select all

java -jar cpmutils.jar <A2S|S2A> <Src CPM Image> <Dst CPM Image>
This basically deals with the differences in track ordering between standard CPM images (which are sequential) and Acorn DSD images which are interleaved. Let me know if you want me to post a binary build of cpmutils.jar.
Yes, please! (I know cpmutils.jar won't help me with my Zork2 and Zork3 problems, but I'd still like to play with it.)
Last edited by lurkio on Fri Mar 06, 2015 6:32 pm, edited 1 time in total.

User avatar
hoglet
Posts: 9438
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: Z80 co-pro, and datacentre?

Post by hoglet » Fri Mar 06, 2015 6:32 pm

lurkio wrote:
hoglet wrote:

Code: Select all

java -jar cpmutils.jar <A2S|S2A> <Src CPM Image> <Dst CPM Image>
This basically deals with the differences in track ordering between standard CPM images (which are sequential) and Acorn DSD images which are interleaved. Let me know if you want me to post a binary build of cpmutils.jar.
Yes, please! (I know cpmutils.jar won't help me with my Zork2 and Zork3 problems, but I'd still like to play with it.)
Here you go:
cpmutils.zip
(2.92 KiB) Downloaded 64 times
Dave

User avatar
hoglet
Posts: 9438
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: Z80 co-pro, and datacentre?

Post by hoglet » Fri Mar 06, 2015 7:19 pm

Lurkio,

A little something for the weekend :D
zork23.zip
(246.18 KiB) Downloaded 59 times
It's a bootable Acorn CPM Disk with Zork2 and Zork3.

I grabbed the raw files from here:
http://www.classiccmp.org/cpmarchives/c ... ocom/Zork/

I made this as follows:

Code: Select all

wget http://www.classiccmp.org/cpmarchives/cpm/Miscellany/Games/Infocom/Zork/zork248c.zip
wget http://www.classiccmp.org/cpmarchives/cpm/Miscellany/Games/Infocom/Zork/zork317c.zip
unzip zork248c.zip
unzip zork317c.zip
cp blank.img zork23.img
cpmcp -f acorn zork23.img zork2.com zork2.dat zork3.com zork3.dat 0:
java -jar cpmutils.jar  S2A zork23.img  zork23.dsd
I think my bootable blank image might be a bit messed up though, as it seems to contain some empty directory entries. I started with cpm1.dsd and removed all the files. Maybe I'll try a different approach tomorrow.

Dave

User avatar
lurkio
Posts: 2899
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Z80 co-pro, and datacentre?

Post by lurkio » Fri Mar 06, 2015 7:42 pm

hoglet wrote:a bootable Acorn CPM Disk with Zork2 and Zork3
Great! Thanks!
hoglet wrote:

Code: Select all

cpmcp -f acorn zork23.img zork2.com zork2.dat zork3.com zork3.dat 0:
The diskdefs file in my copy of cpmtools doesn't have an "acorn" entry. Are you using a custom "acorn" diskdef?

User avatar
hoglet
Posts: 9438
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: Z80 co-pro, and datacentre?

Post by hoglet » Fri Mar 06, 2015 7:51 pm

lurkio wrote: The diskdefs file in my copy of cpmtools doesn't have an "acorn" entry. Are you using a custom "acorn" diskdef?
Oops, yes I forgot I created this:

Code: Select all

diskdef acorn
  seclen 256
  tracks 160
  sectrk 10
  blocksize 2048
  maxdir 64
  skew 0
  boottrk 3
  os 0
end
Dave

User avatar
lurkio
Posts: 2899
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Z80 co-pro, and datacentre?

Post by lurkio » Fri Mar 06, 2015 8:38 pm

hoglet wrote:
lurkio wrote: The diskdefs file in my copy of cpmtools doesn't have an "acorn" entry. Are you using a custom "acorn" diskdef?
Oops, yes I forgot I created this:

Code: Select all

diskdef acorn
  seclen 256
  tracks 160
  sectrk 10
  blocksize 2048
  maxdir 64
  skew 0
  boottrk 3
  os 0
end
Dave
Thanks. I had to change the value of "os" from 0 to 2.2 before cpmcp would accept the def.

cpmutils.jar isn't working for me: Firstly, it isn't a jar but a zip, but I presume I just need to change the filename extension from zip to jar? Secondly, do I need a specific version of Java installed? I only have v6 at the mo, and I'm getting "Invalid or corrupt jarfile cpmutils.jar".

User avatar
hoglet
Posts: 9438
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: Z80 co-pro, and datacentre?

Post by hoglet » Fri Mar 06, 2015 8:40 pm

lurkio wrote: cpmutils.jar isn't working for me: 1. It isn't a jar but a zip, but I presume I just need to change the filename extension from zip to jar? 2. Do I need a specific version of Java installed? I only have v6 at the mo, and I'm getting "Invalid or corrupt jarfile cpmutils.jar".
It's a zipped jar file, because the forum doesn't allow jar files to be posted.

Just unzip it, and you should get cpmutils.jar

What Linux are you using?

Dave

User avatar
lurkio
Posts: 2899
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Z80 co-pro, and datacentre?

Post by lurkio » Fri Mar 06, 2015 8:47 pm

hoglet wrote:It's a zipped jar file, because the forum doesn't allow jar files to be posted. Just unzip it, and you should get cpmutils.jar
Ah. I was having problems with OS X's unzipping. Sorted now. Which answers your next question:
hoglet wrote:What Linux are you using?
I'm on an old version ( 10.6.8 ) of OS X. Now getting this:

Code: Select all

$ java -jar cpmutils.jar 
Exception in thread "main" java.lang.UnsupportedClassVersionError: uk/co/acornatom/cpmutils/Convert : Unsupported major.minor version 51.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
	at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

User avatar
hoglet
Posts: 9438
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: Z80 co-pro, and datacentre?

Post by hoglet » Fri Mar 06, 2015 9:00 pm

Ah, I did compile this with Java 1.7, so you'll probably need that to run it.

If that's a problem, I could try to generate a 1.6 Jar file.

Dave

User avatar
danielj
Posts: 8419
Joined: Thu Oct 02, 2008 5:51 pm
Location: Manchester
Contact:

Re: Z80 co-pro, and datacentre?

Post by danielj » Fri Mar 06, 2015 9:45 pm

Lurkio - you can pop a more contemporary java on your OSX machine -

http://java.com/en/download/

It won't kipper the Apple version (you can still play minecraft :D) but it will be maintained more regularly :)

d.

User avatar
lurkio
Posts: 2899
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Z80 co-pro, and datacentre?

Post by lurkio » Fri Mar 06, 2015 9:56 pm

danielj wrote:Lurkio - you can pop a more contemporary java on your OSX machine

My OS and machine are so old that I actually can't -- not without a lot of faff, anyway!
danielj wrote:It won't kipper the Apple version (you can still play minecraft
Minecraft!? Away with your modern fripperies! I remember when graphics were blocky coz they had to be..! Good times.
hoglet wrote:Ah, I did compile this with Java 1.7, so you'll probably need that to run it. If that's a problem, I could try to generate a 1.6 Jar file.
I had Java 1.7 on a different machine, and ran your JAR there.It didn't quite work..!

I started with cpm1.dsd, like you, and deleted all the files on it using the CP/M command ERA in BeebEm to create my blank image, to which I added HITCH.COM and HITCHHIK.DAT using cpmcp. I then ran the image through cpmutils.jar, as you specified. Strange. Btw, the resultant DSD is not only corrupt as shown above, but it doesn't boot either:
2.png
Dave, don't stress too much about all this. It's just the way of things. 8)
Last edited by lurkio on Fri Mar 06, 2015 10:20 pm, edited 1 time in total.

User avatar
hoglet
Posts: 9438
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: Z80 co-pro, and datacentre?

Post by hoglet » Fri Mar 06, 2015 10:05 pm

lurkio wrote:[I started with cpm1.dsd, like you, and deleted all the files on it using the CP/M command ERA in BeebEm to create my blank image, to which I added HITCH.COM and HITCHHIK.DAT using cpmcp. I then ran the image through cpmutils.jar, as you specified. Strange. Btw, the resultant DSD is not only corrupt as shown above, but it doesn't boot either
What make's you think it's corrupt?

HITCH looks to be working to me.

Dave

User avatar
lurkio
Posts: 2899
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Z80 co-pro, and datacentre?

Post by lurkio » Fri Mar 06, 2015 10:18 pm

hoglet wrote: What make's you think it's corrupt? HITCH looks to be working to me.
I think you're right. Oops! My mistake. :oops:
Last edited by lurkio on Fri Mar 06, 2015 10:21 pm, edited 1 time in total.

User avatar
hoglet
Posts: 9438
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: Z80 co-pro, and datacentre?

Post by hoglet » Fri Mar 06, 2015 10:20 pm

The funny characters are just because it's sending VT100/ANSI control codes that the Beeb doesn't know how to display.

I still think there might be something amiss with the directory, as there are blank entries showing. I think this is what made JGH think the Infocom.dsd I posted earlier was protected.

Dave

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

Re: Z80 co-pro, and datacentre?

Post by jgharston » Sat Mar 07, 2015 1:46 am

You can make a blank unbootable Acorn CP/M disk image with:

Code: Select all

out%=OPENOUT("datadisk")
FOR A%=1 TO 409600:BPUT#out%,&E5:NEXT
CLOSE#out%
You can reduce the 409600 to 25600 if the system you use is happy with truncated images.

You can make a blank bootable Acorn CP/M disk image if you already have a bootable disk image image with:

Code: Select all

in%=OPENIN("reference/ssd")
out%=OPENOUT("bootdisk/ssd")
FOR A%=1 TO &1E00:BPUT#out%,BGET#in%:NEXT A% :REM Copy system data
FOR A%=1 TO 5120:BPUT#out%,&E5:NEXT A%       :REM Create blank catalog
CLOSE#out%:CLOSE#in%
If you want to create a dsd image, you need to do:

Code: Select all

in%=OPENIN("reference/ssd")
out%=OPENOUT("bootdisk/dsd")
FOR A%=1 TO 3
FOR B%=1 TO 2560:BPUT#out%,BGET#in%:NEXT B% :REM Copy system data
FOR B%=1 TO 2560:BPUT#out%,&E5:NEXT B%      :REM Interleave a blank track
NEXT A%
FOR A%=1 TO 10240:BPUT#out%,&E5:NEXT A%     :REM Create blank catalog
CLOSE#out%:CLOSE#in%
If your reference image is also a dsd image, you need to do:

Code: Select all

in%=OPENIN("reference/dsd")
out%=OPENOUT("bootdisk/dsd")
FOR A%=1 TO 3
FOR B%=1 TO 2560:BPUT#out%,BGET#in%:NEXT B% :REM Copy system data
FOR B%=1 TO 2560:BPUT#out%,&E5:NEXT B%      :REM Interleave a blank track
PTR#in%=PTR#in%+2560                        :REM Step to next source track
NEXT A%
FOR A%=1 TO 10240:BPUT#out%,&E5:NEXT A%     :REM Create blank catalog
CLOSE#out%:CLOSE#in%

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.32
(C) Copyright J.G.Harston 1989,2005-2020
>_

User avatar
lurkio
Posts: 2899
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Z80 co-pro, and datacentre?

Post by lurkio » Sun Mar 08, 2015 6:16 pm

hoglet wrote:I still think there might be something amiss with the directory, as there are blank entries showing.
I've been trying to look into this problem, in my own inept way...
jgharston wrote:You can reduce the 409600 to 25600 if the system you use is happy with truncated images ... You can make a blank bootable Acorn CP/M disk image if you already have a bootable disk image image with ...
Thanks for that. I used your info to create this truncated, sequential, blank, bootable Acorn CP/M disc image:

CPM_SEQ_BLANK_half.ssd.zip
A truncated sequential blank bootable Acorn CP/M disc image (&32000 bytes long).
(6.57 KiB) Downloaded 76 times

I then stole from Dave's Convert.java code and tinkered with cpmtools's diskdefs file to create this new definition for sequential Acorn CP/M disc images...

diskdef acorn3a
seclen 512
tracks 160
sectrk 5
blocksize 2048
maxdir 64
skewtab 0,2,4,1,3
boottrk 3
os 2.2
end

[EDIT: See updated definition, two posts down.]

...and used cpmtools to add ZORK2.DAT and Dave's de-ANSIfied ZORK2.COM to the blank image (now renamed toolzrk2.ssd):

Code: Select all

cpmcp -f acorn3a toolzrk2.ssd ZORK2* '0:'
Thus modified, the disc image can be loaded into Mac BeebEm in Z80 copro mode, and it's recognised as a bootable image, and you can run Zork2 -- but we do have the old catalogue problem:
1.png
But if you use PIP.COM to copy ZORK2.COM and ZORK2.DAT to a new copy of the blank disc image (called bbczrk2.ssd), you get this:
2.png
The catalogue problems have disappeared, and Zork2 still seems to work! If you compare the two images toolzrk2.ssd and bbczrk2.ssd in a hex editor, you see that the first difference is that in the disc image with the "correct" catalogue (bbczrk2.ssd), the beginning of the first file, ZORK2.COM, appears to be in block 2 -- whereas in the image with the "wrong" catalogue (toolzrk2.ssd), it's in block 1:
3.png
Another wrinkle is that if you start from scratch and repeat the same experiment but with a large textfile instead of ZORK2.COM and ZORK2.DAT, both disc images have good catalogues!

I don't know what any of this means, but I just thought I'd record my findings in the unlikely event that they turn out to be useful!

(I'm deliberately ignoring the issue of interleaving tracks in a DSD because the catalogue problem seems to be independent of that.)

-------

UPDATE

Having poked around a bit more, I think what's going on is that Acorn CP/M disc images reserve all the bytes from &1E00 to &29FF for the catalogue (or "directory" in CP/M-speak), and they store actual files only from &2A00 (which they consider to be the start of block 2). But the cpmtools utility doesn't know that; it thinks it can start writing files at &2400 (which it thinks is the start of block 1), which is in the middle of the area that Acorn CP/M discs reserve for the directory.
CPM_dir.png
A sequential Acorn CP/M disc image created by JGH and containing lots of files, showing that the directory ranges from &1E00 to at least &26BF and possibly all the way to &29FF
So if you want to use cpmtools to write to my blank disc image (see top), the workaround is that you first need to modify the image slightly by adding a dummy catalogue entry for a non-existent file at block 1:

[EDIT: Attachment deleted -- see below]

You can now write to this modified image either with cpmtools or with CP/M running on the Acorn Z80 copro (in Mac BeebEm at least), and the catalogue problem won't manifest itself because any files you add to the image will be written starting from block 2 (&2A00), which comes after the area that Acorn CP/M discs seem to reserve for the directory.

[EDIT: There's no need for a workaround. See JGH's post immediately following this one.]
Last edited by lurkio on Fri Jun 15, 2018 1:30 pm, edited 3 times in total.

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

Re: Z80 co-pro, and datacentre?

Post by jgharston » Fri Mar 13, 2015 11:04 pm

If you have access to a RISC OS machine you can use Matthew Phillips's CPMFS (also).
lurkio wrote:You can now write to this modified image either with cpmtools or with CP/M running on the Acorn Z80 copro (in Mac BeebEm at least), and the catalogue problem won't manifest itself because any files you add to the image will be written starting from block 2 (&2A00), which comes after the area that Acorn CP/M discs seem to reserve for the directory.
All CP/M disks reserve one or more blocks from block 0 for the directory. Acorn CP/M disks reserve block 0 and block 1.
diskdef acorn
seclen 256
tracks 160
sectrk 10
blocksize 2048
maxdir 64
skew 0
boottrk 3
os 0
end
There's your problem. Acorn CP/M disks have 128 directory entries, not 64. The full AcornCPM disk specification is:

Code: Select all

.DPB_Acorn400k   ; DPB for AcornCPM 400K disk
DEFW &0014       ; SPT=20   128-byte Sectors Per Track
DEFB &04         ; BSH=4    Block Shift
DEFB &0F         ; BLM=15   Block Mask
DEFB &01         ; EXM=1    Extent Mask
DEFW &00C3       ; DSM=195  Disk Sector Max
DEFW &007F       ; DRM=127  Maximum directory entry number
DEFB &C0         ; AL0=&C0  Directory occupies
DEFB &00         ; AL1=&00    first two blocks
DEFW &0020       ; CKS=32   Size of directory checksum vector
DEFW &0003       ; ‡=3    Reserved tracks before logical start of disk
; Total disk size is 128*(BLM+1)*(DSM+1)=392K
; Physical disk size is 128*SPT*‡+128*(BLM+1)*(DSM+1)=399.5K
Unfortunately, CP/M disks do not store the filesystem shape information on the disk itself, it's stored in the BIOS of the machine that uses the disks, so a system that uses multiple machines' disks needs to guess, or be explicitly told, what shape the disk is. It's a problem I have with CPMFiler, and CPMFS only solves it by assigning different filetypes to different images that otherwise would be impossible to tell apart.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.32
(C) Copyright J.G.Harston 1989,2005-2020
>_

User avatar
lurkio
Posts: 2899
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Z80 co-pro, and datacentre?

Post by lurkio » Sat Mar 14, 2015 1:33 am

jgharston wrote:If you have access to a RISC OS machine
Sadly, I don't.
jgharston wrote:Acorn CP/M disks have 128 directory entries, not 64.

Aha! I've updated my cpmtools diskdefs definition for sequential Acorn CP/M discs accordingly:

Code: Select all

diskdef acorn3a
  seclen 512
  tracks 160
  sectrk 5
  blocksize 2048
  maxdir 128
  skewtab 0,2,4,1,3
  boottrk 3
  os 2.2
end
Using this new def, I can successfully use cpmtools to write to my original blank Acorn CP/M disc image (a sequential 200K SSD that includes your HD BIOS). No more catalogue problems!
jgharston wrote:Unfortunately, CP/M disks do not store the filesystem shape information on the disk itself, it's stored in the BIOS
It's a right bugger! There are loads of forums discussing different cpmtools disk definitions, and some of them even give Acorn a mention, but when they do, most of them (if not all of them) seem to be wrong! I might have known mdfs.net would be the only site out there that seems to have accurate Acorn CP/M disc format info! I should have searched it more thoroughly in the first place. #-o

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

Re: Z80 co-pro, and datacentre?

Post by jgharston » Tue Mar 17, 2015 11:51 pm

lurkio wrote:
jgharston wrote:Acorn CP/M disks have 128 directory entries, not 64.
Aha! I've updated my cpmtools diskdefs definition for sequential Acorn CP/M discs accordingly:

Code: Select all

diskdef acorn3a
  seclen 512
  tracks 160
  sectrk 5
  blocksize 2048
  maxdir 128
  skewtab 0,2,4,1,3
  boottrk 3
  os 2.2
end
I've been updating my CPMFiler which is effectively cpmtools for BBC/RISC OS, and was looking through some cpmtools diskdefs and thought of a possible issue. Does cpmtools understand that the tracks on the second side of AcornCPM disks are numbered backwards? Logical tracks 0 to 79 access physical tracks 0 to 79 on side 0, but logical tracks 80 to 159 access physical tracks 79 down to 0 on side 1. Every other double-sided sequential file system I've ever encounted goes upwards on side 1.

I've skimmed through the cpmtools source archive, but can't find any documentation of diskdef definition entries, and can't see anything in the source that clarifies what entries are possible, or whether it understands "flipped" track numbering.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.32
(C) Copyright J.G.Harston 1989,2005-2020
>_

User avatar
lurkio
Posts: 2899
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Z80 co-pro, and datacentre?

Post by lurkio » Wed Mar 18, 2015 12:21 am

jgharston wrote:Does cpmtools understand that the tracks on the second side of AcornCPM disks are numbered backwards? Logical tracks 0 to 79 access physical tracks 0 to 79 on side 0, but logical tracks 80 to 159 access physical tracks 79 down to 0 on side 1. Every other double-sided sequential file system I've ever encounted goes upwards on side 1.

I've skimmed through the cpmtools source archive, but can't find any documentation of diskdef definition entries, and can't see anything in the source that clarifies what entries are possible, or whether it understands "flipped" track numbering.
cpmtools seems to be very under-documented. Or at least the format and content of the diskdefs config file certainly is. The rather important "skewtab" option isn't very easy to find out about. In fact, come to think of it, I don't think there's any official documentation on diskdefs at all. I'm away from my regular IT setup at the mo, so I can't quickly check like I normally would. However, I did find this on track-numbering: http://cpm.os.comp.groups.com.ru/28480- ... _BBC_image

The key seems to be the "sides" parameter, which can have a value of "outout" or "outback", the latter seemingly being what we want for Acorn CP/M images (if that link is accurate and if I've understood everything correctly).
Last edited by lurkio on Thu Jun 25, 2015 12:54 pm, edited 1 time in total.

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

Re: Z80 co-pro, and datacentre?

Post by jgharston » Wed Mar 18, 2015 12:53 am

lurkio wrote:However, I did find this on track-numbering: http://cpm.os.comp.groups.com.ru/28480- ... _BBC_image
Ah, that's the thread I discovered a couple of days ago myself and commented on.

I normally dip into comp.os.cpm every few days, but the last couple of months of driving around the country and limited internet access I've missed quite a few posts.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.32
(C) Copyright J.G.Harston 1989,2005-2020
>_

Post Reply

Return to “8-bit acorn hardware”