Keyboard Shortcuts
Likes
Search
uSD card content?
Hi Paul,
According to the Z80MC-2017 manual on page 20,
"On a Cold or Hard Reset, the system will look for, and if found automatically load and execute a
file called ¡°Z80MC_GO.HEX¡± from the SD Card. The option to get to the regular monitor menu will be provided for a short time while the system slowly prints dots. CP/M The SD Card files come with 4 files called Disk-A.BIN to Disk-D.BIN, a file called CPMDISKS.TXT and the Z80MC_GO.HEX file needed to load CP/M." ?
Also regarding to the FAT16 format : "The card must be formatted with
FAT-16 and then the files in the root directory can be listed and any Intel Hex formatted file can be opened and loaded to memory. Sub directories/folders are not supported. Creating or appending to a FAT-16 file is not supported. Only writing to an existing fixed length file is possible. " ?
Regards,
Kerem |
Disk A though D are fat 16 container files but there content
is a CP/M disk with CP/M formatted directory and applications.
?
That means only a utility on the PC that understands CP/M file
format (disk Explorer) can read the content of the container
file.? It also requires that the BIOS on the Z80MC understand
the FAT16 to find the container and open it for CP/M use.?
Hence the files are named like A.bin.? All reads a write to the
uSD by cp/m are to within the container files.
?
That has two effects convenient from the PC side and
slow from the z80 side.
?
?
Allison |
It never worked for me either (Windows).
Paul
|
Hi Paul,
?
In order to prepare a new 2GB uSD card to work with SIO, you need to partition it correctly. I couldn't figure out how to do it from scratch. So I copied the Partition Table from the original uSD (MassStorageDevice(2GB).ptf) and Restored it on a new one using a freeware called DiskGenius. I am attaching the Partition Table. Once you Restore the partition table, either you can save the files from the .zip on Lee's website or use the attached "Restore from partition image files" function (Z80-SIO.pmf).
?
Doing so I have functioning new uSD cards with no problem.
?
Regards,
Kerem MassStorageDevice_2GB_.ptf
MassStorageDevice_2GB_.ptf
MassStorageDevice_2GB_.txt
MassStorageDevice_2GB_.txt
Z80-SIO.pmf
Z80-SIO.pmf
|
It is a VB6 application; perhaps MSVBVM60.dll (and any dependencies) are not available in a WINE environment?
?
It does run for me on a native Win11 box, but in my case I wound up using 'cpmtools', which is command-line.
?
If anyone cares to try cpmtools out, there are builds for Windows, and likely ones for Linux in the distro's package repository (if not, it's open source, and just use 'make' et al). ?Here is a link for Windows users:
?
?
The tool requires that the disk's parameters be declared as a 'format' in the 'diskdefs' configuration file. ?Here are two that I created for the 250 KiB and the mondo 8 MiB floppies for the Z80MC build of CP/M. ?Just append this to the end of 'diskdefs':
?
==========begin snippet
==========end snippet
?
Then you reference the format in the command line tools. ?E.g.:
?
?
The tools are rudimentary. ?Stick with the uppercase file names and specify the 'user number' in the CP/M files when creating. ?You will need to 'rm' a file before you can 'cp' it over.
?
Anyway, aside from figuring out diskdefs, I found the command line more helpful because I can script it.
Maybe this will be useful to someone...
?
-dave
|
Thats it!? That dang DLL, easy to find and install.
?
Myself I do large devices and I don't do from container files in
Fat file systems.
?
My approach is format the uSD or CF as fat.? Then use parted(linux) or
other tool discover where the device Block replacement table
that is used internally.
?
The system treats any foreign format as meaningless.? ?The BIOS I've
done treat CF or uSD as a contiguous collection of 512 byte blocks
addressed as LBA.? Usually starting at 1000h and for every 16384
(0x4000)blocks are a? 8mb disk.? The parameter block in the bios
has a parameter called offset by making sequential logical drives
easy to do on large devices.? ?No need to partition the device.
?
One trick I've started to use is make the first block in a non file space
a format table so I can move the device to another system
(mostly IDE/CF).? It describes size and organization.? A single
block is easy to read and understand than a partition table.
?
Using FAT16 to do this works but adds another layer of?file system?
to find the desired container files and its starting address or
extended address.? Adds overhead and makes the device
readable by PC save for the file contents still needs a tool
to understand the CP/M directory structure.? A similar tool
could easily read the device directly without using FAT.
?
Actually I have tools for CP/M that can write RX01 (RT11 format)
and DOS fat12 or fat16 floppies and write them as well.
I found that more convenient when floppies were a thing.
?
Allison
? |
Unless the system has a real floppy I do not bother with smaller
disk formats.?
?
When you use CP/M larger disks makes life easier as anything
under 500K can get cramped fast or force spreading out across
multiple drives.? Assembling CP/M (CCPand BDOS) from source?
on a 8" 241K disks needed three drives source on A: and output
to B: and C: even then it was cramped.? The resulting new version
with new bios and FDC that could support double density two
sided on the 8" drives 1020k system, usability and speed improved.
?
Allison |
That's super interesting. ?I wonder what the numbers are on the Z80MC for the elimination of the FAT layer relative to direct block I/O. ?I would guess that a majority of the time is spent in the bit-banged SPI, which might swamp out the benefits, but you never know until you measure... ?(and maybe ram/rom savings alone makes it worth it).
Anyway, if you have code, I wouldn't mind seeing it. ?I am Z80 competent, but a CP/M dilettante, so I'm sure I would have knumbskull questions. ?
-dave |
Generally its better.
?
Since the SPI interface is bit banged having to shuffle less means
less time doing bit bang to move stuff.? Think in terms of layers.
?
Code may be smaller as well, less code executed is faster.
However the BIOS changes!??
?
To date I only have two systems with uSD the z80MC and
SC131 (20mhz z180).? Note the Z180 uses the SPI interface on chip
so speed is very fast.? The rest of my systems are IDE one
with spinning media and two with CF (CF is byte parallel, faster).
The rest of my 8085/z80 systems have MFM-hard disks D540
31mb (spinning rust) and intelligent controllers.? I have over
20 CP/M systems of various designs and performance levels
many running BIOS I had to build.? Of those 5 are S100 crates.
Most portable of the is the Epsom PX-8s laptops I have.
?
Me, been using CP/M since '76 and did V1.3, 1.4, and usually V2.x.
I also use PCP/M variant and Zrdos enhanced CP/M clones.? The
clones are structurally similar but add features like logical devices
larger than 8MB as the internal math is more complex and can
directly address 1GB.? Only one comment is that big devices
have big flat directories that take forever to search.? CP/M
does not hierarchical directories.? So partitioning devices to
smaller 8MB is the general way.
?
I also write code for CP/M but also have modified CP/M internally
and run with ZCCP replacement for CCP.? ?For the non-CP/M fluent
the CCP is the command line processor, Bdos is the base logical
Filesystem and IO, the BIOS is the layer that does logical abstraction
to physical for IO and mass storage.
?
CP/M discussion are based on logical devices and physical.? For
example logical sector is always 128 bytes.? Physical can be anything
that is usually device inherent (IDE, CF, uSD that's 512bytes).??
?
A must have is the entire CP/M manual set (many thin manuals
or one thicker book) as they pretty much give the whole of
required information on use and modification.
?
I speak PDP-8, 8080,8085,Z80, fluently and passable conversations in
1802, TI9900 , PDP-11 and solder (hardware).
?
Allison |
Dave,
?
Code for direct sector access is currently only for CF (and IDE).? Since only two of
my machines are uSD I haven't gotten to it but the basic skeleton would based
off the CF versions with the device level interface and command protocols
being different.? ?For bit bang uSD that is a lot of code that is different but
it eliminates the code needed to find a directory and file under fat16.? The
read and write to a sector (physical 512) will be the same.
?
The two sections of the BIOS impacted is (D=Disk) DREAD and DWRITE.
If I get that far I'd likely add large buffers in one of the unused 32K ram
banks.? And foreground background as I have systems with that built in
most common use is print spooling.
?
As it stands the current code is very good and the TPA is large enough
to run most C compilers and screen editors.? I use BDS-C, BASCOM,
Mbasic, Pascal, assembler and macro assembler,?and Vedit.? Generally
save for screen specific code ( cursor and keyboard keys) if it runs
on Kaypro it runs on MC (using serial terminal).?
?
Right now I'm spending more time on RF analog stuff (222 transverter,
432 power amp).? ?Lots of drilling and blasting (mechanical construction).
?
?
Allison |
Josh Bensadon originally wrote the Z80MC's CP/M code for his JAIR board. It's a single-board S-100 computer with an 8080 CPU, 64k RAM, boot ROM, 2 serial, 3 parallel ports, and a parallel interface to an SD-card serving as its "disk" drive. He noted that the 2 MHz 8080 parallel interface was about the same speed as the 4 MHz Z80 with "bit banged" SD-card interface. So that's what we went with for the Z80-SIO. ? It's not as fast as modern hard drives, but is certainly faster than any floppy disk system I've had. CP/M programs also tend to be small, so disk read/write time is not nearly as important as you might expect. ? Josh used FAT16 so you could read/write/format the SD-card on a PC. It does slow down the Z80 to read the FAT16 directory structure instead of the simpler CP/M structure, but was a straightforward way to allow up to a 2 Gb disk. ? Lee -- Excellence does not require perfection. -- Henry James But it *does* require attention to detail! -- Lee Hart -- Lee A. Hart |
Hi, Using FAT16 as the underlaying model isn't as wasteful as you might think. When booting up, the BIOS looks at the main boot partition (Sector 0) to see where the FAT16 Partition starts. This becomes the base to further set two pointers, one for directory and the other for the FAT. The directory is searched for the files that will become DISK-A to DISK-D.? Once there, the location of the first cluster then becomes the pointer to that disk. Sectors are then added to that pointer and if it goes beyond a FAT16 cluster, then the code needs to look up the FAT table for the correct cluster. SD Cards are 512 byte sectors, that's 4 CP/M sectors.? Clusters are usually like 128 sectors, so there's 512 CP/M sectors.?? But the real thing to keep your eye on, there's just 1 pointer to load (then add your sector) to find your sector for most of the time.?? If FAT16 was not used, it would be about the same, 1 pointer (because you want to offset all the drives on a single SD Card) and add. Normal CP/M uses sequential reads/writes, this is not an issue and speed between FAT and raw-block would probably be about the same. If you're running a CP/M program that needs random access to the disk, then FAT would definitely slow you down. Even with the FAT hopping, it's still faster than real 8" drives (I know, because I've tried it). Bit banging with Z80 is about 90% as fast as parallel processing.? That bit of loss was worth the gain of 4 chips and PCB Space. This is because the Z80 is much faster (both speed and shorter cycle lengths).?? High up look: raw-block: -a bit faster 90% of time/use -a lot faster 10% of time (when using programs that need full random access of CP/M Disk) -needs extra firmware to format / load blank SD cards FAT16: -Entire disks can be duplicated using any PC that access FAT16 -Simple programming for CP/M File management of disks (CPM Disk Explorer tool) -SD Card can hold many other files of use (like operating firmware, user manual, etc) -Still not as slow as real floppy disks In a nutshell, using FAT16 just made the file system easy to access on any modern computer.? I just figured, that's a win-win. Cheers, Josh
On Saturday, April 19, 2025 at 01:57:33 p.m. EDT, dave <dev@...> wrote:
makes sense since you'd probably otherwise need a special app on the PC side to read/write into the raw block store.
|
Josh,
?
You still? need a ap on your PC to read the CP/M directory in the container file.
so going direct is one step less.? If the one available works great.
?
Fat with the container file fragmented (scatter gather) would be bad and
CP/M itself? has the scatter-gather in the file system.? So you can have a
literal double scatter.? ?That is unlikely as the FAT file is built as whatever
size on formatted media, delete it and write again all bets are off.
?
>>>needs extra firmware to format / load blank SD cards
?
Not so, the card has base format (unlike spinning rust).? So an unformatted
drive only needs?a valid directory to use it and that easy to do?
C> del? d:*.*
It assumes the BIOS knows where D: starts on the media.
?
Oddly in normal operation CP/M does more reads than writes.? Most
common is directory.? Second most common file loading.?
?
Indeed it beats floppies hands down.? ?Ask me how i know... ;)??
Hint a very early adopter....
?
Still baffled why anyone would? small container files (like 360K)??
Might as well all be 8mb for elbow room not as if it takes much of the uSD.
?
Also what's missing is a way to remap any container file on the media?
to one of 4 drives.? CP/M allows that and I do that all the time on my
AmproLB+.? ?It allows me to use more of the larger disk without?
eating up the TPA for allocation tables.? ?Most of the systems
I've built are 4 logical drives (some 8 if the tables are in mapped
ram) with a mount utility to access other sections (containers)
on the larger disk on the fly.?
?
?
Allison |
I don't understand "remap"? >Also what's missing is a way to remap any container file on the media? to one of 4 drives.? CP/M allows that and I do that all the time on my
AmproLB+.? ?It allows me to use more of the larger disk without?
eating up the TPA for allocation tables.? ?Most of the systems
I've built are 4 logical drives (some 8 if the tables are in mapped
ram) with a mount utility to access other sections (containers)
on the larger disk on the fly.?
? |
Lee,
My first system with disk was Altair box NS* disk and 48K ram
and that was 1977.? FYI the NS disk was Sa400 35 tracks,
10 hard sectors and the boot disk has about 81K of usable space.?
Since the altair backpland and from panel were on a good day
flakey and only got worse with Z80....
?
Next system was Northstar Horizon crate.? Good backplane,
two serial ports, one parallel and 56K of ram and the NS* floppy
controller.? That would go from hard sector to softsector using
d765 and to 64K ram.? less than a year later St506 (5mb) and
soon after quantum D540 31mb. Boot was from eprom.
?
Multiple generations later...
?
The Compupro based in a new Northstar horizon box was
created to get the most possible out of CP/M.? It still lives.
That has many CPUs with slave cards and other smart
hardware support. by 1985 it had more resources than
the then average PC.
?
Actually the whole 20 CP/M systems still live and work as?
desired.
?
Needless to say there were many generations of BIOS to suit
hardware and support expanding ideas.? I did it to get
performance and avoiding the bag on the side 8088.
I managed to stay out of PC until the mid 90s networking
was the inflection point.
?
?
Allison |