Difference between revisions of "HDCPM"

From CPCWiki - THE Amstrad CPC encyclopedia!
Jump to: navigation, search
(The MOUNT.COM utility)
 
(55 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''by Dimitris Kefalas <d_kef@yahoo.gr> - 2022'''<br />
+
 
'''https://www.cpcwiki.eu/forum/applications/hdcpm-boot-and-run-cpm-plus-from-hard-disk/'''<br />
+
HDCPM is a Hard Disk boot loader for [[CP/M]] Plus, developed by d_kef<br />
 +
 
 +
You can read more about the development of the application here:<br />
 +
https://www.cpcwiki.eu/forum/applications/hdcpm-boot-and-run-cpm-plus-from-hard-disk/<br />
 +
[[File:hdcpm.gif|HDCPM booting CP/M Plus]]
 +
 
 
==Introduction==
 
==Introduction==
 
HDCPM is an Amstrad CPC application that enables your computer to boot and run CP/M Plus from a mass storage device. A maximum of four 8MB partitions or virtual disks can be used to make the vast amount of 32MB of data available to CP/M Plus.<br />
 
HDCPM is an Amstrad CPC application that enables your computer to boot and run CP/M Plus from a mass storage device. A maximum of four 8MB partitions or virtual disks can be used to make the vast amount of 32MB of data available to CP/M Plus.<br />
Line 17: Line 22:
 
* One not partitioned FAT16 or FAT32 formatted hard disk. You can place one to four CP/M disk image files in the root directory. Every disk image file is accessed as a separate hard disk by CP/M.
 
* One not partitioned FAT16 or FAT32 formatted hard disk. You can place one to four CP/M disk image files in the root directory. Every disk image file is accessed as a separate hard disk by CP/M.
 
* One FAT16 or FAT32 and one to three CP/M formatted partitions. You can place one to four CP/M disk image files in the root directory of the FAT file system. Every disk image file is accessed as a separate hard disk by CP/M. CP/M disk images have priority over CP/M partitions so if you have three CP/M image files and three CP/M partitions then HDCPM will mount the three CP/M images and only the first CP/M partition. If the first partition on your hard disk is formatted to FAT16 or FAT32 then HDCPM expects to find the file CPMDSK01.IMG in the root directory. Failed to do so the system won't boot.
 
* One FAT16 or FAT32 and one to three CP/M formatted partitions. You can place one to four CP/M disk image files in the root directory of the FAT file system. Every disk image file is accessed as a separate hard disk by CP/M. CP/M disk images have priority over CP/M partitions so if you have three CP/M image files and three CP/M partitions then HDCPM will mount the three CP/M images and only the first CP/M partition. If the first partition on your hard disk is formatted to FAT16 or FAT32 then HDCPM expects to find the file CPMDSK01.IMG in the root directory. Failed to do so the system won't boot.
* For interfaces that use SD card or USB flash drive as a mass storage device ([[M4 Board]], [https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/usifac-iimake-your-pc-or-usb-stick-an-hdd-for-amstrad-access-dsk-and-many-more!/ USIfAC II] or [http://www.tmtlogic.com/ Symbiface III]) the only supported configuration is one to four CP/M disk image files in the root directory of the FAT file system.
+
* For interfaces that use SD card or USB flash drive as a mass storage device ([[M4 Board]], [https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/usifac-iimake-your-pc-or-usb-stick-an-hdd-for-amstrad-access-dsk-and-many-more!/ USIfAC II], [http://www.tmtlogic.com/ Symbiface III] or [[Albireo]]) the only supported configuration is one to four CP/M disk image files in the root directory of the FAT file system.
 
 
 
Currently only the master IDE device can be accessed by HDCPM. The slave device is available to be used by your favourite DOS.<br />
 
Currently only the master IDE device can be accessed by HDCPM. The slave device is available to be used by your favourite DOS.<br />
Line 23: Line 28:
 
HDCPM can also utilize the RTC found in the [[SYMBiFACE II]] in order to implement CP/M Plus BIOS function 26: TIME.<br />
 
HDCPM can also utilize the RTC found in the [[SYMBiFACE II]] in order to implement CP/M Plus BIOS function 26: TIME.<br />
  
HDCPM is compatible with Dobbertin HD20 Harddisc and can be used together.<br />
+
HDCPM is compatible and can be used together with the [[Dobbertin Harddisc]].<br />
  
HDCPM has been developed with [[WinApe]] Z80 Assembler and was tested with [[WinApe]], [[CPCemu]], an Amstrad Plus 464 upgraded to 6128 and an Amstrad CPC 6128.<br />
+
HDCPM has been developed with [[WinApe]] Z80 Assembler and was tested with [[WinApe]], [[CPCemu]], [http://www.roudoudou.com/ACE-DL/ ACE-DL] an Amstrad Plus 464 upgraded to 6128 an Amstrad CPC 6128 and an Amstrad CPC 464 with [https://www.cpcwiki.eu/index.php/Universal_512K_and_1MByte_RAM_Expansions Universal 512K RAM Expansion].<br />
 
Although every effort has been made to ensure that HDCPM works properly, there is a chance of hard disk data corruption in case of a stray bug in the code. So make a backup of your hard disk before installing and trying out the ROM. I'll not be held responsible for any data loss or damage to your hard disk.<br />
 
Although every effort has been made to ensure that HDCPM works properly, there is a chance of hard disk data corruption in case of a stray bug in the code. So make a backup of your hard disk before installing and trying out the ROM. I'll not be held responsible for any data loss or damage to your hard disk.<br />
  
Line 32: Line 37:
 
* HDCPM.BIN the executable binary file
 
* HDCPM.BIN the executable binary file
 
* HDMGR.COM Hard Disk Manager utility
 
* HDMGR.COM Hard Disk Manager utility
 +
* MOUNT.COM Hard Disk mount utility
 
* RTC.COM RTC synchronization utility
 
* RTC.COM RTC synchronization utility
 
* MAKEIMG.BAS CP/M image file creation utility
 
* MAKEIMG.BAS CP/M image file creation utility
Line 39: Line 45:
  
 
HDCPM is free software. It can be used and distributed with no restrictions.<br />
 
HDCPM is free software. It can be used and distributed with no restrictions.<br />
 +
 
==Prerequisites==
 
==Prerequisites==
 
* Amstrad CPC/Plus computer capable of running CP/M Plus.
 
* Amstrad CPC/Plus computer capable of running CP/M Plus.
Line 46: Line 53:
 
** [[SYMBiFACE II]]
 
** [[SYMBiFACE II]]
 
** [[X-Mass]]
 
** [[X-Mass]]
 +
** [https://github.com/salafek/cyboard-for-cpc Cyboard]
 
** [[uIDE 16]] (base address = &FEF0)
 
** [[uIDE 16]] (base address = &FEF0)
 
** [[M4 Board]]
 
** [[M4 Board]]
** [https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/usifac-iimake-your-pc-or-usb-stick-an-hdd-for-amstrad-access-dsk-and-many-more!/ USIfAC II]
+
** [[USIFAC]] II/[[ULIfAC]]
 
** [http://www.tmtlogic.com/ Symbiface III]
 
** [http://www.tmtlogic.com/ Symbiface III]
* and a compatible storage device with enough free space to accommodate the desirable CP/M hard disk configuration.
+
** [[Albireo]] (SD card only)
 +
* Compatible storage device with enough free space to accommodate the desirable CP/M hard disk configuration.
 
* Floppy disk drive for initialization of the file system.
 
* Floppy disk drive for initialization of the file system.
 
* CP/M Plus system disks for making the system bootable.
 
* CP/M Plus system disks for making the system bootable.
Line 69: Line 78:
 
* Only storage devices with LBA addressing are supported.
 
* Only storage devices with LBA addressing are supported.
 
* Date stamps of CP/M disk image files are not maintained.
 
* Date stamps of CP/M disk image files are not maintained.
* In case a Dobbertin Harddisc is also used you can't change its drive letters (D, E, F, G) as they are hard coded in the Dobbertin driver. Use the HDMGR utility to assign other available drive letters to your IDE drive, images or partitions. If you use the same numbers for your IDE media then the corresponding HD20 partitions will be unavailable under CP/M.
+
* In case a Dobbertin Harddisc is also used you can't change its drive letters (D, E, F, G) as they are hard coded in the Dobbertin driver. Use the HDMGR utility to assign other available drive letters to your IDE drive, images or partitions. If you use the same letters for your IDE media then the corresponding HD20 partitions will be unavailable under CP/M.
 +
 
 
==How it works==
 
==How it works==
Using the ROM:<br />
+
===Using the ROM===
 
Upon computer power-up the HDCPM ROM will be initialized and will inform you of the presence of a compatible interface and RTC. Two bytes of RAM will be reserved for storing the interface type and [[M4 Board]] ROM number (if found). The boot loader can be started by executing one of the following commands:
 
Upon computer power-up the HDCPM ROM will be initialized and will inform you of the presence of a compatible interface and RTC. Two bytes of RAM will be reserved for storing the interface type and [[M4 Board]] ROM number (if found). The boot loader can be started by executing one of the following commands:
 
|HDCPM (no TIME function support) or |HDCPMT (TIME function support)<br />
 
|HDCPM (no TIME function support) or |HDCPMT (TIME function support)<br />
 
Alternatively it can be started by holding down the Tab key (no TIME function support) or Shift+Tab (TIME function support), during power-up.<br />
 
Alternatively it can be started by holding down the Tab key (no TIME function support) or Shift+Tab (TIME function support), during power-up.<br />
<br />
+
===Using the binary===
Using the binary:<br />
+
 
HDCPM can be started by running the HDCPM.BIN file from floppy drive or mass storage.<br />
 
HDCPM can be started by running the HDCPM.BIN file from floppy drive or mass storage.<br />
 
+
===Functions===
 
HDCPM will then execute the following functions:<br />
 
HDCPM will then execute the following functions:<br />
 
* Search for a compatible mass storage interface.
 
* Search for a compatible mass storage interface.
 +
* Initialize the mass storage interface if needed.
 
* Move the boot loader and the CP/M patcher to RAM.
 
* Move the boot loader and the CP/M patcher to RAM.
 
* Mount 1 to 4 CP/M image files and/or partitions and perform fragmentation and size test.
 
* Mount 1 to 4 CP/M image files and/or partitions and perform fragmentation and size test.
 
* Read the boot sector of the 1st hard disk and learn about the DPB, presence and size of the .EMS file, the startup drive, the drive letters and the CP/M console colour scheme.
 
* Read the boot sector of the 1st hard disk and learn about the DPB, presence and size of the .EMS file, the startup drive, the drive letters and the CP/M console colour scheme.
 
* Read the .EMS file from the reserved track and store it in RAM just as the normal CP/M Plus boot loader does.
 
* Read the .EMS file from the reserved track and store it in RAM just as the normal CP/M Plus boot loader does.
* Move the top of TPA and transfer the hard disk driver, RTC driver (in case of |HDCPMT) and initialize the XDPH, DPB, ALV of the mounted hard disks to the memory area just below the normal BDOS base address. The newly inserted code will be handled by CP/M as if it was a normal RSX.
+
* Move the top of TPA and transfer the hard disk driver, RTC driver (in case of |HDCPMT) and initialize the XDPH, DPB, ALV of the mounted hard disks to the memory area just below the normal BDOS base address. The newly inserted code will be handled by CP/M as if it were a normal RSX.
 +
* Patch the floppy disk drive routines in case a FDC's not been found.
 
* Patch the SCB in order to change the startup/default drive.
 
* Patch the SCB in order to change the startup/default drive.
* Patch the drive table records to reassign drive letters for floppy drives 1 and 2, hard disks 1,2,3,4 (if any) and ram drive if Dk'tronics or Dobbertin RAM disk driver is present.
+
* Patch the drive table records to reassign drive letters for floppy drives 1 and 2, hard disks 1,2,3,4 (if any) and ram drive if [[Dk'tronics memory expansion]] or [[Dobbertin Memory Expansion]] driver is present.
* Move the ALV of the Dk'tronics RAM disk if ZPM is detected.
+
* Move the ALV of the Dk'tronics RAM disk if [[Z-System]] has been detected.
 
* Patch the CP/M console with the desired colour scheme.  
 
* Patch the CP/M console with the desired colour scheme.  
 
* Patch the system message.
 
* Patch the system message.
 
* Do a normal CP/M cold start.
 
* Do a normal CP/M cold start.
 
Any CP/M 3.0 compatible system that loads the BDOS, BIOS, SCB to the default AMSTRAD CP/M addresses should work. HDCPM will be able (hopefully) to patch it on the fly.<br />
 
Any CP/M 3.0 compatible system that loads the BDOS, BIOS, SCB to the default AMSTRAD CP/M addresses should work. HDCPM will be able (hopefully) to patch it on the fly.<br />
 +
 
==CP/M Plus disk image files==
 
==CP/M Plus disk image files==
 
A CP/M Plus disk image file is a raw binary image of a CP/M hard disk or partition. Its name must be in the form CPMDSK0x.IMG where x=1, 2, 3 or 4 in order to be recognized by HDCPM. The size of the file depends on the Disk Parameter Block of the virtual hard disk it represents and for the initial release of HDCPM it is fixed and equal to 1 reserved track * 256 sectors per track * 512 bytes per sector + 8MB data = 8519680 bytes. If possible create your CPMDSK01.IMG file in a modern computer and copy it in the root directory of your FAT formatted medium. You can use the free online hex editor [https://hexed.it/ hexed.it] or any hex editor capable of creating binary files filled with a specific pattern.<br />
 
A CP/M Plus disk image file is a raw binary image of a CP/M hard disk or partition. Its name must be in the form CPMDSK0x.IMG where x=1, 2, 3 or 4 in order to be recognized by HDCPM. The size of the file depends on the Disk Parameter Block of the virtual hard disk it represents and for the initial release of HDCPM it is fixed and equal to 1 reserved track * 256 sectors per track * 512 bytes per sector + 8MB data = 8519680 bytes. If possible create your CPMDSK01.IMG file in a modern computer and copy it in the root directory of your FAT formatted medium. You can use the free online hex editor [https://hexed.it/ hexed.it] or any hex editor capable of creating binary files filled with a specific pattern.<br />
In case of hexed.it select 'New file' fill in 'Size of the new file = 8519680' and 'Fill Pattern = 0xE5' and press apply. Save the file as CPMDSK01.IMG If you have a FAT capable DOS installed in your AMSTRAD you can use the provided MAKEIMG.BAS utility to create your image file. Keep in mind that it takes more than 1.5 hour for a 8MB image file to be created that way.<br />
+
In case of hexed.it select 'New file' fill in 'Size of the new file = 8519680' and 'Fill Pattern = 0xE5' and press apply. Save the file as CPMDSK01.IMG<br />
 +
If you have a FAT capable DOS installed in your AMSTRAD you can use the provided MAKEIMG.BAS utility to create your image file. Keep in mind that it takes more than 1.5 hour for a 8MB image file to be created that way.<br />
 
CP/M disk image files can be accessed by a modern computer with [http://www.moria.de/~michael/cpmtools/ cpmtools]. Use the command |HDDEF to see the record you must insert in the diskdefs file.<br />
 
CP/M disk image files can be accessed by a modern computer with [http://www.moria.de/~michael/cpmtools/ cpmtools]. Use the command |HDDEF to see the record you must insert in the diskdefs file.<br />
  
Line 111: Line 124:
 
       end
 
       end
 
<br />
 
<br />
HDCPM is not FAT aware. It utilizes code to search in the root directory of a FAT formatted medium in order to find the CP/M image files. Then it finds the LBA of the first sector of each file and passes it to the CP/M hard disk driver. The CP/M hard disk driver doesn't know anything about FAT or image files. It accesses the image file as if it was a real hard disk. It works on the sector level with LBA addressing so it expects the 'hard disk' to be a continuous block of sectors.<br />
+
HDCPM is not FAT aware. It utilizes code to search in the root directory of a FAT formatted medium in order to find the CP/M image files. Then it finds the LBA of the first sector of each file and passes it to the CP/M hard disk driver. The CP/M hard disk driver doesn't know anything about FAT or image files. It accesses the image file as if it were a real hard disk. It works on the sector level with LBA addressing so it expects the 'hard disk' to be a continuous block of sectors.<br />
A CP/M image file can easily become fragmented during its creation, especially if the hard disk is nearly full. I advice you to create/copy your CP/M image files to your FAT formatted hard disk/partition while it is still empty. HDCPM will never fragment a CP/M image file.<br />
+
A CP/M image file can easily become fragmented during its creation, especially if the hard disk is nearly full. I advice you to create/copy your CP/M image files to your FAT formatted hard disk/partition while it is still empty. [https://www.cpcwiki.eu/index.php/Albireo Albireo] incorporates a file management IC that performs FAT file system operations and handles fragmented files properly. In such case fragmented image files is not a problem. HDCPM will never fragment a CP/M image file.<br />
 
{|
 
{|
 
|-
 
|-
Line 119: Line 132:
  
 
==CP/M Plus disk/partitions==
 
==CP/M Plus disk/partitions==
You can also create one or more partitions in order to format them to CP/M file system and use them exclusively for CP/M. In such case you must make sure that the size of the partition is big enough to accommodate your file system.<br />
+
You can also create one or more partitions in order to format them to [http://www.seasip.info/Cpm/format31.html CP/M-80] and use them exclusively for CP/M. In such case you must make sure that the size of the partition is big enough to accommodate your file system.<br />
HDCPM examines the hard disk's MBR upon start and finds the partition information. Then it finds the LBA of the first sector of each partition and passes it to the CP/M hard disk driver. The CP/M hard disk driver doesn't know anything about partitions. It accesses the partition as if it was a real hard disk.<br />
+
HDCPM examines the hard disk's MBR upon start and finds the partition information. Then it finds the LBA of the first sector of each partition and passes it to the CP/M hard disk driver. The CP/M hard disk driver doesn't know anything about partitions. It accesses the partition as if it were a real hard disk.<br />
 
HDCPM can't be used to partition your hard disk. In order to create partitions you must connect the hard disk to a modern computer and use its partitioning utility.<br />
 
HDCPM can't be used to partition your hard disk. In order to create partitions you must connect the hard disk to a modern computer and use its partitioning utility.<br />
 
Use the command |HDDEF to find the exact length of the file system/partition. When you have created the partition use the HDMGR.COM utility in order to format it.<br />
 
Use the command |HDDEF to find the exact length of the file system/partition. When you have created the partition use the HDMGR.COM utility in order to format it.<br />
Line 126: Line 139:
 
{|
 
{|
 
|-
 
|-
|[[File:hdcpm-ui-boot.png|thumb|HDCPM booting on uIDE-16]]
+
|[[File:hdcpm-ui-boot.png|thumb|HDCPM ROM booting on uIDE-16]]
 
|}
 
|}
  
Line 132: Line 145:
 
===Using the ROM===
 
===Using the ROM===
 
* Install the HDCPM ROM in a free ROM slot of your ROM box.
 
* Install the HDCPM ROM in a free ROM slot of your ROM box.
* Plug in your [[SYMBiFACE II]] compatible IDE interface, [[uIDE 16]], [[M4 Board]] or [https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/usifac-iimake-your-pc-or-usb-stick-an-hdd-for-amstrad-access-dsk-and-many-more!/ USIfAC II] and attach the proper mass storage device.
+
* Plug in your mass storage interface and attach the proper mass storage device.
* Power on your Amstrad. You should see the ROM initialization message: ''CP/M+ Hard Disk boot loader v1.04 (S2)''. The type of interface found will be show inside the parentheses:<br />
+
* Power on your Amstrad. You should see the ROM initialization message: ''CP/M+ Hard Disk boot loader v1.04 (S2)''. The type of interface found will be shown inside the parentheses:<br />
 
** (S2): [[SYMBiFACE II]] compatible interface
 
** (S2): [[SYMBiFACE II]] compatible interface
 
** (uI): [[uIDE 16]] interface
 
** (uI): [[uIDE 16]] interface
 
** (M4): [[M4 Board]]
 
** (M4): [[M4 Board]]
 
** (US): [https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/usifac-iimake-your-pc-or-usb-stick-an-hdd-for-amstrad-access-dsk-and-many-more!/ USIfAC II]
 
** (US): [https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/usifac-iimake-your-pc-or-usb-stick-an-hdd-for-amstrad-access-dsk-and-many-more!/ USIfAC II]
** (S3): [http://www.tmtlogic.com/ Symbiface III]<br />
+
** (S3): [http://www.tmtlogic.com/ Symbiface III]
 +
** (AL): [[Albireo]]<br />
 
{|
 
{|
 
|-
 
|-
Line 144: Line 158:
 
|[[File:hdcpm-ui.png|thumb|HDCPM ROM - uIDE-16]]
 
|[[File:hdcpm-ui.png|thumb|HDCPM ROM - uIDE-16]]
 
|[[File:hdcpm-m4.png|thumb|HDCPM ROM - M4 Board]]
 
|[[File:hdcpm-m4.png|thumb|HDCPM ROM - M4 Board]]
 +
|}
 +
{|
 
|[[File:hdcpm-us.png|thumb|HDCPM ROM - USIfAC II]]
 
|[[File:hdcpm-us.png|thumb|HDCPM ROM - USIfAC II]]
 
|[[File:hdcpm-s3.png|thumb|HDCPM ROM - Symbiface III]]
 
|[[File:hdcpm-s3.png|thumb|HDCPM ROM - Symbiface III]]
 +
|[[File:hdcpm-al.png|thumb|HDCPM ROM - Albireo]]
 
|}
 
|}
In case a RTC is detected you will also see the RTC initialization message and the current date and time: ''RTC found: 2021/01/01 12:01''
+
In case a RTC is detected you will also see the RTC initialization message and the current date and time: ''RTC found: 2021/01/01 12:01:01''
 
* Use your original CP/M Plus system disk set to Boot CP/M Plus.
 
* Use your original CP/M Plus system disk set to Boot CP/M Plus.
 
* Use the provided HDMGR.COM utility in order to format the disk image or partition and transfer the .EMS file to the reserved track. Change the start-up drive letter to that of your first CP/M hard disk.
 
* Use the provided HDMGR.COM utility in order to format the disk image or partition and transfer the .EMS file to the reserved track. Change the start-up drive letter to that of your first CP/M hard disk.
Line 155: Line 172:
 
* Copy any other needed application etc. to your CP/M hard disk(s).
 
* Copy any other needed application etc. to your CP/M hard disk(s).
 
* You are ready to go.<br />
 
* You are ready to go.<br />
 +
 
===Using the binary===
 
===Using the binary===
* Plug in your [[SYMBiFACE II]] compatible IDE interface, [[uIDE 16]], [[M4 Board]] or [https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/usifac-iimake-your-pc-or-usb-stick-an-hdd-for-amstrad-access-dsk-and-many-more!/ USIfAC II] and attach the proper mass storage device.
+
* Plug in your mass storage interface and attach the proper mass storage device.
 
* Use your original CP/M Plus system disk set to Boot CP/M Plus.
 
* Use your original CP/M Plus system disk set to Boot CP/M Plus.
 
* Use the provided HDMGR.COM utility in order to format the disk image or partition and transfer the .EMS file to the reserved track. Change the start-up drive letter to that of your first CP/M hard disk.
 
* Use the provided HDMGR.COM utility in order to format the disk image or partition and transfer the .EMS file to the reserved track. Change the start-up drive letter to that of your first CP/M hard disk.
Line 163: Line 181:
  
 
==ROM commands==
 
==ROM commands==
[[File:hdcpm-us-boot.png|thumb|HDCPM booting on USIfAC II]]
+
[[File:hdcpm-us-boot.png|thumb|HDCPM ROM booting on USIfAC II]]
 
* |HDCPM mounts the hard disks and boots CP/M Plus. If [https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/usifac-iimake-your-pc-or-usb-stick-an-hdd-for-amstrad-access-dsk-and-many-more!/ USIfAC II] is used enable the USB disk with the |USB command first.
 
* |HDCPM mounts the hard disks and boots CP/M Plus. If [https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/usifac-iimake-your-pc-or-usb-stick-an-hdd-for-amstrad-access-dsk-and-many-more!/ USIfAC II] is used enable the USB disk with the |USB command first.
 
* |HDCPMT works like |HDCPM but also utilizes the RTC.
 
* |HDCPMT works like |HDCPM but also utilizes the RTC.
Line 196: Line 214:
 
You can use this utility to get information about your hard disk geometry, disk image files, partitions and boot sector. You have to use this utility to format a hard disk, disk image file or partition to CP/M format or manipulate the boot sector of the hard disk and/or transfer an .EMS system file to the reserved track of the hard disk.<br />
 
You can use this utility to get information about your hard disk geometry, disk image files, partitions and boot sector. You have to use this utility to format a hard disk, disk image file or partition to CP/M format or manipulate the boot sector of the hard disk and/or transfer an .EMS system file to the reserved track of the hard disk.<br />
 
The boot sector contains information about the CP/M disk drive letters, start-up drive and console colour scheme. All those properties can be changed with HDMGR.COM.<br />
 
The boot sector contains information about the CP/M disk drive letters, start-up drive and console colour scheme. All those properties can be changed with HDMGR.COM.<br />
HDMGR will perform a fragmentation test of the discovered CP/M hard disk image files uppon execution.<br />
+
HDMGR will perform a fragmentation test of the discovered CP/M hard disk image files uppon execution (not for Albireo).<br />
 
You can't use this utility to re-partition your hard disk or make a new CP/M image file or manipulate a file system other than CP/M.<br />
 
You can't use this utility to re-partition your hard disk or make a new CP/M image file or manipulate a file system other than CP/M.<br />
 
The HDMGR.COM utility is self explanatory. Just run it from the CP/M command prompt.<br />
 
The HDMGR.COM utility is self explanatory. Just run it from the CP/M command prompt.<br />
Line 203: Line 221:
 
|[[File:Hdcpm-hdmgr-m.png|thumb|HDMGR main menu]]
 
|[[File:Hdcpm-hdmgr-m.png|thumb|HDMGR main menu]]
 
|[[File:Hdcpm-hdmgr-1.png|thumb|HDMGR Hardware information]]
 
|[[File:Hdcpm-hdmgr-1.png|thumb|HDMGR Hardware information]]
 +
|[[File:Hdcpm-hdmgr-2.png|thumb|HDMGR Partition information]]
 
|[[File:Hdcpm-hdmgr-3.png|thumb|HDMGR CP/M disk image information]]
 
|[[File:Hdcpm-hdmgr-3.png|thumb|HDMGR CP/M disk image information]]
 
|}
 
|}
Line 208: Line 227:
 
|-
 
|-
 
|[[File:Hdcpm-hdmgr-4.png|thumb|HDMGR Boot sector information]]
 
|[[File:Hdcpm-hdmgr-4.png|thumb|HDMGR Boot sector information]]
 +
|[[File:Hdcpm-hdmgr-5.png|thumb|HDMGR Log disk]]
 
|[[File:Hdcpm-hdmgr-7.png|thumb|HDMGR Manage boot sector]]
 
|[[File:Hdcpm-hdmgr-7.png|thumb|HDMGR Manage boot sector]]
 
|[[File:Hdcpm-hdmgr-8.png|thumb|HDMGR Transfer CP/M to disk]]
 
|[[File:Hdcpm-hdmgr-8.png|thumb|HDMGR Transfer CP/M to disk]]
Line 213: Line 233:
  
 
==The RTC.COM utility==
 
==The RTC.COM utility==
If you need the 470 bytes of RAM that the integrated RTC driver occupies then you can make use of the RTC.COM utility in order to keep CP/M date and time updated.<br />
+
You can make use of the RTC.COM utility in order to keep CP/M date and time updated.<br />
You can synchronize the date and time of CP/M Plus with the RTC by running ''RTC -G'' manually or via your PROFILE.SUB<br />
+
You can synchronize the date and time of CP/M Plus with the RTC by running ''RTC -G'' manually or via your PROFILE.SUB.<br />
You can also set your RTC to the current CP/M date and time by running ''RTC -S''<br />
+
You can also set your RTC to the current CP/M date and time by running ''RTC -S'' (not for M4 board)<br />
 +
You can see the detected RTC interface type by running ''RTC -I''<br />
 +
Currently RTC.COM works with the RTC found in Symbiface II, Symbiface III, M4 board (read only) and [[Nova]].<br />
 +
DATE.COM, DIR.COM and SHOW.COM commands, patched for Year 2000 compatibility can be downloaded from the [http://www.cpm.z80.de/binary.html CP/M source archive - Digital Research Binary files section] .<br />
 +
 
 +
==The MOUNT.COM utility==
 +
You can use the MOUNT.COM utility in order to list the mounted CP/M disks, list the available CP/M disks in your mass storage medium and mount a new disk in one of the four available mount points.<br />
 +
You can get a list of the already mounted CP/M disks by running ''MOUNT'' without any parameters.<br />
 +
You can get a list of the available CP/M disk images or partitions by running ''MOUNT -L''<br />
 +
You can mount one of the available CP/M disk images or partitions by running ''MOUNT <mount point>,<hard disk>'' where <mount point> is a number from 1 to 4 indicating the HDCPM disk number and <hard disk> is a two digit number from 00 to 99 for CPMDSK00.IMG to CPMDSK99.IMG respectively, or P1 to P4 for partition 1 to partition 4 respectively.<br />
 +
{|
 +
|-
 +
|[[File:Hdcpm-mount-1.png|thumb|MOUNT Help]]
 +
|[[File:Hdcpm-mount-2.png|thumb|MOUNT Display mounted disks]]
 +
|[[File:Hdcpm-mount-3.png|thumb|MOUNT List available disks]]
 +
|}
  
 
==Error messages==
 
==Error messages==
 +
===ROM checksum error===
 +
* ''*** HDCPM ROM checksum error ***
 +
The ROM has failed the checksum test.
 +
The contents are probably corrupted. The ROM will not be initialized.
 +
 
===Hard disk errors===
 
===Hard disk errors===
 
* ''*** No mass storage found ***''
 
* ''*** No mass storage found ***''
Line 223: Line 263:
 
 
 
* ''ERROR: DISK I/O''
 
* ''ERROR: DISK I/O''
I/O error occurred during the last read/write operation.
+
I/O error occurred during the last read/write operation.
 
Your hard disk might be defect or the USB disk is not enabled.
 
Your hard disk might be defect or the USB disk is not enabled.
 
 
Line 257: Line 297:
 
The .EMS system file that was loaded from the system track is not
 
The .EMS system file that was loaded from the system track is not
 
compatible with HDCPM.
 
compatible with HDCPM.
+
 
 
===RTC errors===
 
===RTC errors===
 
* ''*** Battery depleted ***''
 
* ''*** Battery depleted ***''
Line 264: Line 304:
 
<br />
 
<br />
  
==Release info==
+
==Release info & download==
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Version !! Changes
+
! Version !! Changes !! Download
 
|-
 
|-
| v1.00 December 2021 || Initial release
+
| v1.00 December 2021 || Initial release || [[Media:hdcpm100.dsk|hdcpm100.dsk]]
 
|-
 
|-
 
| v1.01 January 2022 || HDCPM.ROM, HDMGR.COM: code optimization.<br />
 
| v1.01 January 2022 || HDCPM.ROM, HDMGR.COM: code optimization.<br />
Line 281: Line 321:
 
MAKEIMG.EXE: added utility for creating an image file from within SYMBOS.<br />
 
MAKEIMG.EXE: added utility for creating an image file from within SYMBOS.<br />
 
HDCPM.DOC: various additions and corrections.
 
HDCPM.DOC: various additions and corrections.
 +
|| [[Media:hdcpm101.dsk|hdcpm101.dsk]]
 
|-
 
|-
 
| v1.02 March 2022 || HDCPM.ROM, HDMGR.COM: added support for M4 board.<br />
 
| v1.02 March 2022 || HDCPM.ROM, HDMGR.COM: added support for M4 board.<br />
Line 291: Line 332:
 
HDCPM.ROM: two bytes of RAM will be reserved by the ROM for storing the interface type and M4 ROM number.<br />
 
HDCPM.ROM: two bytes of RAM will be reserved by the ROM for storing the interface type and M4 ROM number.<br />
 
HDCPM.DOC: various additions and corrections.
 
HDCPM.DOC: various additions and corrections.
 +
|| [[Media:hdcpm102.dsk|hdcpm102.dsk]]
 
|-
 
|-
 
| v1.03 April 2022 || HDCPM.ROM, HDMGR.COM: added support for USIfAC II.<br />
 
| v1.03 April 2022 || HDCPM.ROM, HDMGR.COM: added support for USIfAC II.<br />
 
HDCPM.ROM: (bug fix) uIDE-16 detection was broken.<br />
 
HDCPM.ROM: (bug fix) uIDE-16 detection was broken.<br />
 
HDCPM.DOC: various additions and corrections.
 
HDCPM.DOC: various additions and corrections.
 +
|| [[Media:hdcpm103.dsk|hdcpm103.dsk]]
 
|-
 
|-
| v1.04 June 2022|| HDCPM.ROM: code optimization.<br />
+
| v1.04 June 2022|| HDCPM.BIN: added executable binary file version of HDCPM.<br />
 
HDCPM.DOC: various additions and corrections.<br />
 
HDCPM.DOC: various additions and corrections.<br />
HDCPM.BIN: added executable binary file version of HDCPM.
+
HDCPM.ROM: code optimization.
 +
|| [[Media:hdcpm104.dsk|hdcpm104.dsk]]
 
|-
 
|-
| v1.05 July 2022 || HDCPM.ROM, HDCPM.BIN, HDMGR.COM: added support for Symbiface III<br />
+
| v1.05 July 2022 || HDCPM.ROM, HDCPM.BIN, HDMGR.COM: added support for Symbiface III.<br />
 
HDCPM.ROM, HDCPM.BIN:  code optimization.<br />
 
HDCPM.ROM, HDCPM.BIN:  code optimization.<br />
 
HDMGR.COM: Hardware info added for USIfAC II<br />
 
HDMGR.COM: Hardware info added for USIfAC II<br />
 
HDMGR.COM: (bug fix) the 'Select boot file' menu was garbled if there were 8 or more .EMS files present.<br />
 
HDMGR.COM: (bug fix) the 'Select boot file' menu was garbled if there were 8 or more .EMS files present.<br />
 
HDCPM.DOC: various additions and corrections.
 
HDCPM.DOC: various additions and corrections.
 +
|| [[Media:hdcpm105.dsk|hdcpm105.dsk]]
 +
|-
 +
| v1.06 January 2023 || HDCPM.ROM, HDCPM.BIN, HDMGR.COM: added support for Albireo.<br />
 +
RTC.COM: added support for M4 Board (r/o) and Symbiface 3.<br />
 +
HDCPM.ROM, HDCPM.BIN: (bug fix) CPC was freezing after mounting the CP/M disk(s) with incompatible .EMS file.<br />
 +
HDMGR.COM: (bug fix) the Stack was overflowed in some rare cases.<br />
 +
HDCPM.DOC: various additions and corrections.<br />
 +
|| [[Media:hdcpm106.dsk|hdcpm106.dsk]]
 +
|-
 +
| v1.10 September 2023 || HDCPM.ROM, HDCPM.BIN: added support for CPC464 with &C3 mode compatible RAM expansion card.<br />
 +
HDCPM.ROM, HDCPM.BIN: can now boot CP/M Plus on a CPC that has no or faulty Floppy Disc Controller present.<br />
 +
HDCPM.ROM: ROM checksum test and new error message added.<br />
 +
HDCPM.ROM: removed blank line from ROM initialization message.<br />
 +
HDCPM.ROM, HDCPM.BIN, HDMGR.COM:  code optimization.<br />
 +
HDCPM.ROM, HDCPM.BIN: (bug fix) incorrect patching would corrupt the Dobbertin RAM drive on CP/M Plus v1.1<br />
 +
HDCPM.ROM: (bug fix) |HDDPB was displaying wrong values<br />
 +
HDMGR.COM: (bug fix) a corruption of the MBR of USB/SD card occured in some rare cases.<br />
 +
HDCPM.DOC: various additions and corrections.<br />
 +
|| [[Media:hdcpm110.dsk|hdcpm110.dsk]]
 +
|-
 +
| v1.11 April 2024 || HDCPM.ROM, HDCPM.BIN: CP/M (virtual) disks are now treated as removable.<br />
 +
HDCPM.ROM, HDCPM.BIN, HDMGR.COM:  code optimization.<br />
 +
HDCPM.ROM, HDCPM.BIN: (bug fix) uIDE driver was corrupted.<br />
 +
HDMGR.COM: (bug fix) CP/M disk image information could skip an image file.<br />
 +
HDMGR.COM: More than 8 .EMS files can be displayed and selected.<br />
 +
RTC.COM: added support for NOVA, added option to display the RTC interface type.<br />
 +
MOUNT.COM: added utility to list and mount CP/M (virtual) disks.<br />
 +
HDCPM.DOC: various additions and corrections.<br />
 +
|| [[Media:hdcpm111.dsk|hdcpm111.dsk]]
 
|}
 
|}
  
==Downloads==
+
==Other downloads==
*[[Media:Hdcpm105.dsk|HDCPM v1.05 (floppy disk image)]] - Contains the ROM file, the binary file the utilities and the manual.
+
*[[Media:CPMDSK01&02.zip|CP/M disk images]] - CPMDSK01.IMG is bootable and contains all the files of the 3 CP/M Plus system disks and year 2000 compliant binaries downloaded from the [http://www.cpm.z80.de/binary.html Digital Research Binary Files]. CPMDSK02.IMG is empty and can also be used as a template.<br />
*[[Media:CPMDSK01&02.zip|CP/M disk images]] - CPMDSK01.IMG is bootable and contains all the files of the 3 CP/M Plus system disks. CPMDSK02.IMG is empty and can also be used as a template.<br />
+
*[[Media:Z3Plus.part1.rar|ZPM3+ZCCP disk image part 1]] , [[Media:Z3Plus.part2.rar|ZPM3+ZCCP disk image part 2]] - The Amstrad BDOS and CCP have been replaced with their counterparts [https://github.com/wwarthen/CPU280/tree/master/ZPM3/zpm3.txt ZPM3] and [https://github.com/wwarthen/CPU280/tree/master/ZCCP/zccp.txt ZCCP] written by Simeon Cran and Randy Winchester respectively. It is [https://www.cpcwiki.eu/index.php/Z-System Z-system, Z3Plus] compatible and contains the Z3Plus system files, all the files of the 3 CP/M Plus system disks, year 2000 compliant binaries and also contains some useful tools, help files and manuals.<br />
 +
*[[Media:CPMDSK04.zip|EMS Files]] - CPMDSK04.IMG contains a collection of HDCPM compatible EMS files (see table below) and the latest HDMGR.COM
 +
{| class="wikitable"
 +
|-
 +
! EMS file !! BDOS !! CCP !! BIOS !! Extras !! Description
 +
|-
 +
| C10CPM3.EMS || Digital Research || Digital Research || Amstrad v1.0 || - || Original Amstrad CP/M Plus for CPC
 +
|-
 +
| C11CPM3.EMS || Digital Research || Digital Research || Amstrad v1.1 || - || Original Amstrad CP/M Plus for CPC
 +
|-
 +
| C10ZPM3.EMS || ZPM3 by Simeon Cran  || Digital Research || Amstrad v1.0 || - || The BDOS has been replaced by ZPM3 written in Z80 assembly
 +
|-
 +
| C11ZPM3.EMS || ZPM3 by Simeon Cran  || Digital Research || Amstrad v1.1 || - || The BDOS has been replaced by ZPM3 written in Z80 assembly
 +
|-
 +
| CPM3SEMI.EMS || Digital Research || Digital Research || Amstrad v1.0 || Dk'tronics RAM drive || Patched with Dk'tronics memory expansion driver
 +
|-
 +
| ZPM3SEMI.EMS || ZPM3 by Simeon Cran || Digital Research || Amstrad v1.0 || Dk'tronics RAM drive || Patched with Dk'tronics memory expansion driver and ZPM3
 +
|-
 +
| C10ZCPR3.EMS || ZPM3 by Simeon Cran  || ZCCP by Randy Winchester || Amstrad v1.0 || - || The BDOS has been replaced by ZPM3 and the CCP has been replaced by ZCCP, both  written in Z80 assembly. Z-system/Z3Plus compatible. <b>Strartup and default drive must be drive A: (use HDMGR.COM to change). Also several Z-system files must be present ([https://github.com/wwarthen/CPU280/tree/master/ZCCP/zccp.txt read ZCCP.TXT])</b>
 +
|-
 +
| ZCPR3SEM.EMS || ZPM3 by Simeon Cran  || ZCCP by Randy Winchester || Amstrad v1.0 || Dk'tronics RAM drive || The BDOS has been replaced by ZPM3 and the CCP has been replaced by ZCCP, both  written in Z80 assembly. Z-system/Z3Plus compatible. Patched with Dk'tronics memory expansion driver. <b>Strartup and default drive must be drive A: (use HDMGR.COM to change). Also several Z-system files must be present ([https://github.com/wwarthen/CPU280/tree/master/ZCCP/zccp.txt read ZCCP.TXT]) </b>
 +
|-
 +
| D10CPM3.EMS || Digital Research || Digital Research || Amstrad v1.0 || Dobbertin RAM Drive || Patched with Dobbertin memory expansion driver
 +
|-
 +
| D11CPM3.EMS || Digital Research || Digital Research || Amstrad v1.1 || Dobbertin RAM Drive || Patched with Dobbertin memory expansion driver
 +
|-
 +
| DX10CPM3.EMS || Digital Research || Digital Research || Amstrad v1.0 || Dobbertin RAM Drive, Vortex format drive B: || Patched with Dobbertin memory expansion driver. Supports Vortex formatted, 80 track, double side floppies, in drive B:
 +
|-
 +
| DX11CPM3.EMS || Digital Research || Digital Research || Amstrad v1.1 || Dobbertin RAM Drive, Vortex format drive B: || Patched with Dobbertin memory expansion driver. Supports Vortex formatted, 80 track, double side floppies, in drive B:
 +
|-
 +
|}
  
 
==Videos==
 
==Videos==
Line 316: Line 419:
 
* [https://youtu.be/em7dHOdaylg How to create a CP/M image file under SYMBOS]
 
* [https://youtu.be/em7dHOdaylg How to create a CP/M image file under SYMBOS]
 
<br />
 
<br />
[[category:Expansion ROM]] [[category:Software]] [[category:Applications]] [[category:CP/M]] [[category:DSK images]]
+
[[category:Expansion ROM]] [[category:Applications]] [[category:CP/M]]

Latest revision as of 08:30, 20 May 2024

HDCPM is a Hard Disk boot loader for CP/M Plus, developed by d_kef

You can read more about the development of the application here:
https://www.cpcwiki.eu/forum/applications/hdcpm-boot-and-run-cpm-plus-from-hard-disk/
HDCPM booting CP/M Plus

Introduction

HDCPM is an Amstrad CPC application that enables your computer to boot and run CP/M Plus from a mass storage device. A maximum of four 8MB partitions or virtual disks can be used to make the vast amount of 32MB of data available to CP/M Plus.

It comes in the form of:

  • a standard background ROM that can be installed in any available ROM position.
  • a standard binary file that can be loaded from floppy or hard drive.


HDCPM has been developed with modern DOSs, that support the FAT file system, in mind. This means that CP/M can use the same hard disk with other DOSs.

The following configurations are possible with one hard disk:

  • One not partitioned, CP/M formatted hard disk. The whole hard disk is used by CP/M.
  • One to four CP/M formatted partitions. Every partition is accessed as a separate hard disk by CP/M.
  • One not partitioned FAT16 or FAT32 formatted hard disk. You can place one to four CP/M disk image files in the root directory. Every disk image file is accessed as a separate hard disk by CP/M.
  • One FAT16 or FAT32 and one to three CP/M formatted partitions. You can place one to four CP/M disk image files in the root directory of the FAT file system. Every disk image file is accessed as a separate hard disk by CP/M. CP/M disk images have priority over CP/M partitions so if you have three CP/M image files and three CP/M partitions then HDCPM will mount the three CP/M images and only the first CP/M partition. If the first partition on your hard disk is formatted to FAT16 or FAT32 then HDCPM expects to find the file CPMDSK01.IMG in the root directory. Failed to do so the system won't boot.
  • For interfaces that use SD card or USB flash drive as a mass storage device (M4 Board, USIfAC II, Symbiface III or Albireo) the only supported configuration is one to four CP/M disk image files in the root directory of the FAT file system.

Currently only the master IDE device can be accessed by HDCPM. The slave device is available to be used by your favourite DOS.

HDCPM can also utilize the RTC found in the SYMBiFACE II in order to implement CP/M Plus BIOS function 26: TIME.

HDCPM is compatible and can be used together with the Dobbertin Harddisc.

HDCPM has been developed with WinApe Z80 Assembler and was tested with WinApe, CPCemu, ACE-DL an Amstrad Plus 464 upgraded to 6128 an Amstrad CPC 6128 and an Amstrad CPC 464 with Universal 512K RAM Expansion.
Although every effort has been made to ensure that HDCPM works properly, there is a chance of hard disk data corruption in case of a stray bug in the code. So make a backup of your hard disk before installing and trying out the ROM. I'll not be held responsible for any data loss or damage to your hard disk.

HDCPM distribution disk contains the following files:

  • HDCPM.ROM the ROM itself
  • HDCPM.BIN the executable binary file
  • HDMGR.COM Hard Disk Manager utility
  • MOUNT.COM Hard Disk mount utility
  • RTC.COM RTC synchronization utility
  • MAKEIMG.BAS CP/M image file creation utility
  • MAKEIMG.BIN CP/M image file creation binary
  • MAKEIMG.EXE CP/M image file creation utility for SymbOS
  • HDCPM.DOC the User guide

HDCPM is free software. It can be used and distributed with no restrictions.

Prerequisites

  • Amstrad CPC/Plus computer capable of running CP/M Plus.
  • ROM box or other ROM expansion hardware if using the ROM.
  • Optionaly a FAT aware DOS like M4 ROM, USIfAC ROM, UniDOS, CubeMDOS etc if using the binary.
  • One of the following mass storage interfaces:
  • Compatible storage device with enough free space to accommodate the desirable CP/M hard disk configuration.
  • Floppy disk drive for initialization of the file system.
  • CP/M Plus system disks for making the system bootable.
  • Optionally a SYMBiFACE II compatible RTC.

Restrictions

  • CP/M 2.2 or lower is not supported.
  • In case of a patched or non AMSTRAD CP/M Plus the BIOS, BDOS, SCB base addresses must be equal to the ones used by the official distribution of the AMSTRAD CP/M Plus.
  • Only the master IDE device is accessible by HDCPM.
  • The maximum number of hard disk partition/images supported is four.
  • Only primary partitions are supported.
  • If you want to use CP/M disk images then they must be stored in a FAT16 or FAT32 formatted disk or partition.
  • If the hard disk is partitioned then the CP/M disk images must be placed in the first partition of the disk.
  • The CP/M disk images must be placed in the root directory of the FAT file system.
  • The CP/M disk images must NOT be fragmented and must have the correct size.
  • The CP/M partitions must be big enough to accommodate your CP/M file system. Otherwise the file system on the hard disk WILL get corrupted.
  • Only storage devices with 512 bytes sector size are supported.
  • Only storage devices with LBA addressing are supported.
  • Date stamps of CP/M disk image files are not maintained.
  • In case a Dobbertin Harddisc is also used you can't change its drive letters (D, E, F, G) as they are hard coded in the Dobbertin driver. Use the HDMGR utility to assign other available drive letters to your IDE drive, images or partitions. If you use the same letters for your IDE media then the corresponding HD20 partitions will be unavailable under CP/M.

How it works

Using the ROM

Upon computer power-up the HDCPM ROM will be initialized and will inform you of the presence of a compatible interface and RTC. Two bytes of RAM will be reserved for storing the interface type and M4 Board ROM number (if found). The boot loader can be started by executing one of the following commands: |HDCPM (no TIME function support) or |HDCPMT (TIME function support)
Alternatively it can be started by holding down the Tab key (no TIME function support) or Shift+Tab (TIME function support), during power-up.

Using the binary

HDCPM can be started by running the HDCPM.BIN file from floppy drive or mass storage.

Functions

HDCPM will then execute the following functions:

  • Search for a compatible mass storage interface.
  • Initialize the mass storage interface if needed.
  • Move the boot loader and the CP/M patcher to RAM.
  • Mount 1 to 4 CP/M image files and/or partitions and perform fragmentation and size test.
  • Read the boot sector of the 1st hard disk and learn about the DPB, presence and size of the .EMS file, the startup drive, the drive letters and the CP/M console colour scheme.
  • Read the .EMS file from the reserved track and store it in RAM just as the normal CP/M Plus boot loader does.
  • Move the top of TPA and transfer the hard disk driver, RTC driver (in case of |HDCPMT) and initialize the XDPH, DPB, ALV of the mounted hard disks to the memory area just below the normal BDOS base address. The newly inserted code will be handled by CP/M as if it were a normal RSX.
  • Patch the floppy disk drive routines in case a FDC's not been found.
  • Patch the SCB in order to change the startup/default drive.
  • Patch the drive table records to reassign drive letters for floppy drives 1 and 2, hard disks 1,2,3,4 (if any) and ram drive if Dk'tronics memory expansion or Dobbertin Memory Expansion driver is present.
  • Move the ALV of the Dk'tronics RAM disk if Z-System has been detected.
  • Patch the CP/M console with the desired colour scheme.
  • Patch the system message.
  • Do a normal CP/M cold start.

Any CP/M 3.0 compatible system that loads the BDOS, BIOS, SCB to the default AMSTRAD CP/M addresses should work. HDCPM will be able (hopefully) to patch it on the fly.

CP/M Plus disk image files

A CP/M Plus disk image file is a raw binary image of a CP/M hard disk or partition. Its name must be in the form CPMDSK0x.IMG where x=1, 2, 3 or 4 in order to be recognized by HDCPM. The size of the file depends on the Disk Parameter Block of the virtual hard disk it represents and for the initial release of HDCPM it is fixed and equal to 1 reserved track * 256 sectors per track * 512 bytes per sector + 8MB data = 8519680 bytes. If possible create your CPMDSK01.IMG file in a modern computer and copy it in the root directory of your FAT formatted medium. You can use the free online hex editor hexed.it or any hex editor capable of creating binary files filled with a specific pattern.
In case of hexed.it select 'New file' fill in 'Size of the new file = 8519680' and 'Fill Pattern = 0xE5' and press apply. Save the file as CPMDSK01.IMG
If you have a FAT capable DOS installed in your AMSTRAD you can use the provided MAKEIMG.BAS utility to create your image file. Keep in mind that it takes more than 1.5 hour for a 8MB image file to be created that way.
CP/M disk image files can be accessed by a modern computer with cpmtools. Use the command |HDDEF to see the record you must insert in the diskdefs file.

The HDCPM record for diskdefs is:

      diskdef hdcpm
         seclen 512
         tracks 65
         sectrk 256
         blocksize 8192
         maxdir 1024
         skew 0
         boottrk 1
         os 3
      end


HDCPM is not FAT aware. It utilizes code to search in the root directory of a FAT formatted medium in order to find the CP/M image files. Then it finds the LBA of the first sector of each file and passes it to the CP/M hard disk driver. The CP/M hard disk driver doesn't know anything about FAT or image files. It accesses the image file as if it were a real hard disk. It works on the sector level with LBA addressing so it expects the 'hard disk' to be a continuous block of sectors.
A CP/M image file can easily become fragmented during its creation, especially if the hard disk is nearly full. I advice you to create/copy your CP/M image files to your FAT formatted hard disk/partition while it is still empty. Albireo incorporates a file management IC that performs FAT file system operations and handles fragmented files properly. In such case fragmented image files is not a problem. HDCPM will never fragment a CP/M image file.

HDCPM binary booting on M4 Board

CP/M Plus disk/partitions

You can also create one or more partitions in order to format them to CP/M-80 and use them exclusively for CP/M. In such case you must make sure that the size of the partition is big enough to accommodate your file system.
HDCPM examines the hard disk's MBR upon start and finds the partition information. Then it finds the LBA of the first sector of each partition and passes it to the CP/M hard disk driver. The CP/M hard disk driver doesn't know anything about partitions. It accesses the partition as if it were a real hard disk.
HDCPM can't be used to partition your hard disk. In order to create partitions you must connect the hard disk to a modern computer and use its partitioning utility.
Use the command |HDDEF to find the exact length of the file system/partition. When you have created the partition use the HDMGR.COM utility in order to format it.
This configuration is only to be used with SYMBiFACE II or uIDE 16. USB flash disks and SD cards should not be partitioned as they will not be detected by their interface ROM.

HDCPM ROM booting on uIDE-16

Installation

Using the ROM

  • Install the HDCPM ROM in a free ROM slot of your ROM box.
  • Plug in your mass storage interface and attach the proper mass storage device.
  • Power on your Amstrad. You should see the ROM initialization message: CP/M+ Hard Disk boot loader v1.04 (S2). The type of interface found will be shown inside the parentheses:
HDCPM ROM - SYMBiFACE II
HDCPM ROM - uIDE-16
HDCPM ROM - M4 Board
HDCPM ROM - USIfAC II
HDCPM ROM - Symbiface III
HDCPM ROM - Albireo

In case a RTC is detected you will also see the RTC initialization message and the current date and time: RTC found: 2021/01/01 12:01:01

  • Use your original CP/M Plus system disk set to Boot CP/M Plus.
  • Use the provided HDMGR.COM utility in order to format the disk image or partition and transfer the .EMS file to the reserved track. Change the start-up drive letter to that of your first CP/M hard disk.
  • Reset your AMSTRAD and boot CP/M from the hard disk with the command |HDCPM. The Boot loader will check your image file(s) against fragmentation and correct size and boot the system to the CP/M command prompt. If the first image file is fragmented or has the wrong length the system will not boot. All other image files will be ignored if found to be fragmented or have the wrong length.
  • In case you don't use CP/M image files just boot the system with |HDCPM or |HDCPMT
  • Copy the files from your CP/M system floppy disks to the first hard disk.
  • Copy any other needed application etc. to your CP/M hard disk(s).
  • You are ready to go.

Using the binary

  • Plug in your mass storage interface and attach the proper mass storage device.
  • Use your original CP/M Plus system disk set to Boot CP/M Plus.
  • Use the provided HDMGR.COM utility in order to format the disk image or partition and transfer the .EMS file to the reserved track. Change the start-up drive letter to that of your first CP/M hard disk.
  • Reset your AMSTRAD and insert the HDCPM floppy disk. If using a FAT aware DOS you can copy HDCPM.BIN to your mass storage device.
  • You are ready to go.

ROM commands

HDCPM ROM booting on USIfAC II
  • |HDCPM mounts the hard disks and boots CP/M Plus. If USIfAC II is used enable the USB disk with the |USB command first.
  • |HDCPMT works like |HDCPM but also utilizes the RTC.
  • |HDDPB shows the Disk Parameter Block.
  • |HDDEF shows the diskdefs entry for CP/M tools and the file system size.
  • |DATE displays the current date.
  • |TIME displays the current time. If M4 Board is used |DATE and |TIME will be redirected to M4 |TIME.

The HDCPM binary file

  • If USIfAC II is used, use your PC to copy HDCPM.BIN to your USB flash disk. Then insert it to your USIfAC II power up your Amstrad and enable the USB disk with the |USB command.
  • Execute the file from the floppy disk or from your mass storage device with RUN"HDCPM". HDCPM will detect your mass storage interface and you will see the initialization message: CP/M+ Hard Disk boot loader v1.04 Then it will mount any available hard disk images and boot CP/M Plus.
  • M4 Board and USIfAC II use their own FAT aware DOS so you can run HDCPM.BIN directly from their mass storage device. For all the other interfaces you will need to have a FAT aware DOS, like CubeMDOS or UniDOS, installed.

The MAKEIMG.BAS and MAKEIMG.EXE utilities

MAKEIMG.BAS

Although this utility should not be your first option, you can use it to make a new empty CP/M disk image file.
In case you decide to use it make sure you have a FAT aware DOS installed in your system. MAKEIMG makes use of the firmware calls CAS_OUT_OPEN, CAS_OUT_CLOSE and CAS_OUT_CHAR so your DOS must support them.
Copy the files MAKEIMG.BAS and MAKEIMG.BIN to the root directory of your FAT formatted hard disk and make it your current drive. Run the utility with RUN"MAKEIMG" and don't hold your breath!
Making an image file this way takes more than 1.5 hour for an 8MB file so literally... don't hold your breath.
Here is a small tutorial on how to setup and use a CP/M image file: https://youtu.be/GMWsRzNhQTM

MAKEIMG.EXE

This utility is a SymbOS application.
Use this utility to create your CP/M hard disk images from within SymbOS. It is a bit faster than its Basic counterpart. It takes between 25 and 60 (or more) minutes for your image file to be created, depending on the characteristics of your media. Disable your screen saver before using it in order to gain some speed.
MAKEIMG.EXE has been developed with Quigs for SymbOS.

MAKEIMG.EXE in action

The HDMGR.COM utility

This is the Hard Disk Manager utility.
You can use this utility to get information about your hard disk geometry, disk image files, partitions and boot sector. You have to use this utility to format a hard disk, disk image file or partition to CP/M format or manipulate the boot sector of the hard disk and/or transfer an .EMS system file to the reserved track of the hard disk.
The boot sector contains information about the CP/M disk drive letters, start-up drive and console colour scheme. All those properties can be changed with HDMGR.COM.
HDMGR will perform a fragmentation test of the discovered CP/M hard disk image files uppon execution (not for Albireo).
You can't use this utility to re-partition your hard disk or make a new CP/M image file or manipulate a file system other than CP/M.
The HDMGR.COM utility is self explanatory. Just run it from the CP/M command prompt.

HDMGR main menu
HDMGR Hardware information
HDMGR Partition information
HDMGR CP/M disk image information
HDMGR Boot sector information
HDMGR Log disk
HDMGR Manage boot sector
HDMGR Transfer CP/M to disk

The RTC.COM utility

You can make use of the RTC.COM utility in order to keep CP/M date and time updated.
You can synchronize the date and time of CP/M Plus with the RTC by running RTC -G manually or via your PROFILE.SUB.
You can also set your RTC to the current CP/M date and time by running RTC -S (not for M4 board)
You can see the detected RTC interface type by running RTC -I
Currently RTC.COM works with the RTC found in Symbiface II, Symbiface III, M4 board (read only) and Nova.
DATE.COM, DIR.COM and SHOW.COM commands, patched for Year 2000 compatibility can be downloaded from the CP/M source archive - Digital Research Binary files section .

The MOUNT.COM utility

You can use the MOUNT.COM utility in order to list the mounted CP/M disks, list the available CP/M disks in your mass storage medium and mount a new disk in one of the four available mount points.
You can get a list of the already mounted CP/M disks by running MOUNT without any parameters.
You can get a list of the available CP/M disk images or partitions by running MOUNT -L
You can mount one of the available CP/M disk images or partitions by running MOUNT <mount point>,<hard disk> where <mount point> is a number from 1 to 4 indicating the HDCPM disk number and <hard disk> is a two digit number from 00 to 99 for CPMDSK00.IMG to CPMDSK99.IMG respectively, or P1 to P4 for partition 1 to partition 4 respectively.

MOUNT Help
MOUNT Display mounted disks
MOUNT List available disks

Error messages

ROM checksum error

  • *** HDCPM ROM checksum error ***

The ROM has failed the checksum test. The contents are probably corrupted. The ROM will not be initialized.

Hard disk errors

  • *** No mass storage found ***

No compatible mass storage interface can be found.

  • ERROR: DISK I/O

I/O error occurred during the last read/write operation. Your hard disk might be defect or the USB disk is not enabled.

  • ERROR: INVALID BOOT SECTOR

No FAT or CP/M boot sector was found in a not partitioned hard disk.

  • ERROR: INVALID FILE SYSTEM

The first partition in a partitioned hard disk is not a FAT or CP/M-80 one.

  • ERROR: INVALID SECTOR SIZE

The hard disk used has a sector size not equal to 512 bytes.

  • ERROR: CPMDSK01.IMG NOT FOUND

The CP/M image file named CPMDSK01.IMG can't be found in the FAT formatted hard disk or partition.

  • ERROR: CP/M SYSTEM FILE NOT FOUND

The .EMS CP/M system file can't be found in the system track of your CP/M partition or image file.

  • ERROR: CPMDSK01.IMG IS FRAGMENTED

The first CP/M image file is fragmented, the system won't mount it.

  • ERROR: CPMDSK01.IMG HAS WRONG LENGTH

The first CP/M image file has wrong length, the system won't mount it.

  • ERROR: CPMDSK01.IMG IS NOT FORMATTED

The first CP/M image file is not formatted to CP/M-80 format, the system won't mount it. Use the HDMGR.COM utility to format it.

  • ERROR: INCOMPATIBLE EMS FILE

The .EMS system file that was loaded from the system track is not compatible with HDCPM.

RTC errors

  • *** Battery depleted ***

The RTC battery is depleted. The RTC driver will continue to operate normally but the readings are not reliable. Replace the RTC battery.

Release info & download

Version Changes Download
v1.00 December 2021 Initial release hdcpm100.dsk
v1.01 January 2022 HDCPM.ROM, HDMGR.COM: code optimization.

HDCPM.ROM, HDMGR.COM: (bug fix) fragmented file detection was not working properly unless the file was CPMDSK01.IMG
HDCPM.ROM, HDMGR.COM: (bug fix) unformatted image file detection was not working properly. New error message added.
HDCPM.ROM: (bug fix) CP/M drive table wasn't patched properly.
HDCPM.ROM: (bug fix) initialization of floppy drive(s) was corrupted due to misplaced code.
HDCPM.ROM: added .EMS file compatibility check. New error message added.
HDCPM.ROM: added support for Dobbertin RAM disk driver.
HDCPM.ROM: added compatibility with Dobbertin HD20 Harddisc
MAKEIMG.EXE: added utility for creating an image file from within SYMBOS.
HDCPM.DOC: various additions and corrections.

hdcpm101.dsk
v1.02 March 2022 HDCPM.ROM, HDMGR.COM: added support for M4 board.

HDCPM.ROM, HDMGR.COM: added support for uIDE-16 interface.
HDCPM.ROM, HDMGR.COM: code optimization.
HDCPM.ROM: (bug fix) the ROM was initialized even if no compatible interface was found.
HDCPM.ROM, HDMGR.COM: error message change.
HDCPM.ROM: option "F" has been removed. HDCPM will always do a disk fragmentation test during boot.
HDCPM.ROM: power up message changed in order to provide information about the type of the detected interface.
HDCPM.ROM: two bytes of RAM will be reserved by the ROM for storing the interface type and M4 ROM number.
HDCPM.DOC: various additions and corrections.

hdcpm102.dsk
v1.03 April 2022 HDCPM.ROM, HDMGR.COM: added support for USIfAC II.

HDCPM.ROM: (bug fix) uIDE-16 detection was broken.
HDCPM.DOC: various additions and corrections.

hdcpm103.dsk
v1.04 June 2022 HDCPM.BIN: added executable binary file version of HDCPM.

HDCPM.DOC: various additions and corrections.
HDCPM.ROM: code optimization.

hdcpm104.dsk
v1.05 July 2022 HDCPM.ROM, HDCPM.BIN, HDMGR.COM: added support for Symbiface III.

HDCPM.ROM, HDCPM.BIN: code optimization.
HDMGR.COM: Hardware info added for USIfAC II
HDMGR.COM: (bug fix) the 'Select boot file' menu was garbled if there were 8 or more .EMS files present.
HDCPM.DOC: various additions and corrections.

hdcpm105.dsk
v1.06 January 2023 HDCPM.ROM, HDCPM.BIN, HDMGR.COM: added support for Albireo.

RTC.COM: added support for M4 Board (r/o) and Symbiface 3.
HDCPM.ROM, HDCPM.BIN: (bug fix) CPC was freezing after mounting the CP/M disk(s) with incompatible .EMS file.
HDMGR.COM: (bug fix) the Stack was overflowed in some rare cases.
HDCPM.DOC: various additions and corrections.

hdcpm106.dsk
v1.10 September 2023 HDCPM.ROM, HDCPM.BIN: added support for CPC464 with &C3 mode compatible RAM expansion card.

HDCPM.ROM, HDCPM.BIN: can now boot CP/M Plus on a CPC that has no or faulty Floppy Disc Controller present.
HDCPM.ROM: ROM checksum test and new error message added.
HDCPM.ROM: removed blank line from ROM initialization message.
HDCPM.ROM, HDCPM.BIN, HDMGR.COM: code optimization.
HDCPM.ROM, HDCPM.BIN: (bug fix) incorrect patching would corrupt the Dobbertin RAM drive on CP/M Plus v1.1
HDCPM.ROM: (bug fix) |HDDPB was displaying wrong values
HDMGR.COM: (bug fix) a corruption of the MBR of USB/SD card occured in some rare cases.
HDCPM.DOC: various additions and corrections.

hdcpm110.dsk
v1.11 April 2024 HDCPM.ROM, HDCPM.BIN: CP/M (virtual) disks are now treated as removable.

HDCPM.ROM, HDCPM.BIN, HDMGR.COM: code optimization.
HDCPM.ROM, HDCPM.BIN: (bug fix) uIDE driver was corrupted.
HDMGR.COM: (bug fix) CP/M disk image information could skip an image file.
HDMGR.COM: More than 8 .EMS files can be displayed and selected.
RTC.COM: added support for NOVA, added option to display the RTC interface type.
MOUNT.COM: added utility to list and mount CP/M (virtual) disks.
HDCPM.DOC: various additions and corrections.

hdcpm111.dsk

Other downloads

  • CP/M disk images - CPMDSK01.IMG is bootable and contains all the files of the 3 CP/M Plus system disks and year 2000 compliant binaries downloaded from the Digital Research Binary Files. CPMDSK02.IMG is empty and can also be used as a template.
  • ZPM3+ZCCP disk image part 1 , ZPM3+ZCCP disk image part 2 - The Amstrad BDOS and CCP have been replaced with their counterparts ZPM3 and ZCCP written by Simeon Cran and Randy Winchester respectively. It is Z-system, Z3Plus compatible and contains the Z3Plus system files, all the files of the 3 CP/M Plus system disks, year 2000 compliant binaries and also contains some useful tools, help files and manuals.
  • EMS Files - CPMDSK04.IMG contains a collection of HDCPM compatible EMS files (see table below) and the latest HDMGR.COM
EMS file BDOS CCP BIOS Extras Description
C10CPM3.EMS Digital Research Digital Research Amstrad v1.0 - Original Amstrad CP/M Plus for CPC
C11CPM3.EMS Digital Research Digital Research Amstrad v1.1 - Original Amstrad CP/M Plus for CPC
C10ZPM3.EMS ZPM3 by Simeon Cran Digital Research Amstrad v1.0 - The BDOS has been replaced by ZPM3 written in Z80 assembly
C11ZPM3.EMS ZPM3 by Simeon Cran Digital Research Amstrad v1.1 - The BDOS has been replaced by ZPM3 written in Z80 assembly
CPM3SEMI.EMS Digital Research Digital Research Amstrad v1.0 Dk'tronics RAM drive Patched with Dk'tronics memory expansion driver
ZPM3SEMI.EMS ZPM3 by Simeon Cran Digital Research Amstrad v1.0 Dk'tronics RAM drive Patched with Dk'tronics memory expansion driver and ZPM3
C10ZCPR3.EMS ZPM3 by Simeon Cran ZCCP by Randy Winchester Amstrad v1.0 - The BDOS has been replaced by ZPM3 and the CCP has been replaced by ZCCP, both written in Z80 assembly. Z-system/Z3Plus compatible. Strartup and default drive must be drive A: (use HDMGR.COM to change). Also several Z-system files must be present (read ZCCP.TXT)
ZCPR3SEM.EMS ZPM3 by Simeon Cran ZCCP by Randy Winchester Amstrad v1.0 Dk'tronics RAM drive The BDOS has been replaced by ZPM3 and the CCP has been replaced by ZCCP, both written in Z80 assembly. Z-system/Z3Plus compatible. Patched with Dk'tronics memory expansion driver. Strartup and default drive must be drive A: (use HDMGR.COM to change). Also several Z-system files must be present (read ZCCP.TXT)
D10CPM3.EMS Digital Research Digital Research Amstrad v1.0 Dobbertin RAM Drive Patched with Dobbertin memory expansion driver
D11CPM3.EMS Digital Research Digital Research Amstrad v1.1 Dobbertin RAM Drive Patched with Dobbertin memory expansion driver
DX10CPM3.EMS Digital Research Digital Research Amstrad v1.0 Dobbertin RAM Drive, Vortex format drive B: Patched with Dobbertin memory expansion driver. Supports Vortex formatted, 80 track, double side floppies, in drive B:
DX11CPM3.EMS Digital Research Digital Research Amstrad v1.1 Dobbertin RAM Drive, Vortex format drive B: Patched with Dobbertin memory expansion driver. Supports Vortex formatted, 80 track, double side floppies, in drive B:

Videos