News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_d_kef

HDCPM - boot and run CP/M plus from hard disk

Started by d_kef, 16:48, 30 December 21

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

cpcoldie

@d_kef
I hope you are well and healthy!

Best wishes!
CPC6128, PCW, PPC512, ...

d_kef

Quote from: cpcoldie on 21:43, 16 March 24Very strange!

With this diskdefs the cpmtools work as expected (at least cpmls and fsck.cpm):

###############
# HDCPM Test
diskdef hdcpmtest1
  seclen 512
  tracks 65
  sectrk 256
  blocksize 8192
  maxdir 1024
  skew 0
  boottrk 5
  os 3                             
end

I found this out with the fsed.cpm.
It counts the tracks not in the way as from the track size expected.
It displays the right offset (131072 (0x00020000)) but jumps to some different location.
And at the directory start it shows:
                                                          Directory area

Byte  655360 (0x000a0000)  Sector  1 (physical  1)  Offset    0  Track    5

e5 e5 e5 e5 e5 e5 e5 e5  e5 e5 e5 e5 e5 e5 e5 e5  ................
e5 e5 e5 e5 e5 e5 e5 e5  e5 e5 e5 e5 e5 e5 e5 e5  ................
e5 e5 e5 e5 e5 e5 e5 e5  e5 e5 e5 e5 e5 e5 e5 e5  ................
e5 e5 e5 e5 e5 e5 e5 e5  e5 e5 e5 e5 e5 e5 e5 e5  ................
e5 e5 e5 e5 e5 e5 e5 e5  e5 e5 e5 e5 e5 e5 e5 e5  ................
e5 e5 e5 e5 e5 e5 e5 e5  e5 e5 e5 e5 e5 e5 e5 e5  ................
e5 e5 e5 e5 e5 e5 e5 e5  e5 e5 e5 e5 e5 e5 e5 e5  ................
e5 e5 e5 e5 e5 e5 e5 e5  e5 e5 e5 e5 e5 e5 e5 e5  ................

Entry  0: Free

Name: eeeeeeee Extension: eee
Extent: 1889 (low: 229, high: 229)
Last extent record count: 229
Last record byte count: 229
Data blocks: 58853 58853 58853 58853 58853 58853 58853 58853

Hmmmmm....
I would say this is a bug in cpmtools...
...but is this bug in amsdos cpm too?
Or is for sectrk just 1 byte reserved?
Just verified the diskdefs entry and the image files from the wiki page.

They are both OK, as expected.

The correct diskdefs record is (as found in the wiki page or by running |HDDEF with the HDCPM ROM installed):
      diskdef hdcpm
         seclen 512
         tracks 65
         sectrk 256
         blocksize 8192
         maxdir 1024
         skew 0
         boottrk 1
         os 3
      end

The output of the command "cpmls -f hdcpm -l CPMDSK01.IMG", when I run it on my PC, is:
0:
-rwxrwxrwx    1024 Jan 01 1970  amsdos.com
-rwxrwxrwx    8192 Jan 01 1970  asm.com
-rw-rw-rw-     256 Jan 01 1970  assign.sys
-rw-rw-rw-     896 Jan 01 1970  bankman.bas
-rw-rw-rw-    1536 Jan 01 1970  bankman.bin
-rw-rw-rw-   25600 Jan 01 1970  c10cpm3.ems
-rwxrwxrwx    2944 Jan 01 1970  date.com
-rw-rw-rw-   12416 Jan 01 1970  dd-dmp1.prl
-rw-rw-rw-   12288 Jan 01 1970  ddfxlr7.prl
-rw-rw-rw-   11008 Jan 01 1970  ddhp7470.prl
-rw-rw-rw-    3072 Jan 01 1970  ddmode0.prl
-rw-rw-rw-    3072 Jan 01 1970  ddmode1.prl
-rw-rw-rw-    3072 Jan 01 1970  ddmode2.prl
-rw-rw-rw-   12288 Jan 01 1970  ddshinwa.prl
-rwxrwxrwx    7424 Jan 01 1970  device.com
-rwxrwxrwx   14592 Jan 01 1970  dir.com
-rwxrwxrwx    6144 Jan 01 1970  disckit3.com
-rw-rw-rw-    1024 Jan 01 1970  drivers.gsx
-rwxrwxrwx    1024 Jan 01 1970  dump.com
-rwxrwxrwx    9344 Jan 01 1970  ed.com
-rwxrwxrwx    3712 Jan 01 1970  erase.com
-rwxrwxrwx   14848 Jan 01 1970  gencom.com
-rwxrwxrwx    1536 Jan 01 1970  gengraf.com
-rwxrwxrwx    6528 Jan 01 1970  get.com
-rw-rw-rw-    1408 Jan 01 1970  gsx.sys
-rwxrwxrwx    7168 Jan 01 1970  help.com
-rw-rw-rw-   76800 Jan 01 1970  help.hlp
-rwxrwxrwx    1152 Jan 01 1970  hexcom.com
-rw-rw-rw-    1280 Jan 01 1970  hist.utl
-rwxrwxrwx   32000 Jan 01 1970  initdir.com
-rw-rw-rw-     384 Jan 01 1970  keys.ccp
-rw-rw-rw-     256 Jan 01 1970  keys.drl
-rw-rw-rw-     384 Jan 01 1970  keys.wp
-rwxrwxrwx    1024 Jan 01 1970  language.com
-rwxrwxrwx    7168 Jan 01 1970  lib.com
-rwxrwxrwx   15744 Jan 01 1970  link.com
-rwxrwxrwx   49792 Jan 01 1970  logo3.com
-rw-rw-rw-     128 Jan 01 1970  logo3.sub
-rwxrwxrwx   11776 Jan 01 1970  mac.com
-rwxrwxrwx    1024 Jan 01 1970  palette.com
-rwxrwxrwx    2560 Jan 01 1970  patch.com
-rwxrwxrwx    8704 Jan 01 1970  pip.com
-rw-rw-rw-     128 Jan 01 1970  profile.eng
-rwxrwxrwx    7040 Jan 01 1970  put.com
-rwxrwxrwx    2944 Jan 01 1970  rename.com
-rwxrwxrwx   13568 Jan 01 1970  rmac.com
-rwxrwxrwx    1792 Jan 01 1970  save.com
-rwxrwxrwx   10368 Jan 01 1970  set.com
-rwxrwxrwx    1024 Jan 01 1970  set24x80.com
-rwxrwxrwx    4096 Jan 01 1970  setdef.com
-rwxrwxrwx    2048 Jan 01 1970  setkeys.com
-rwxrwxrwx    2048 Jan 01 1970  setlst.com
-rwxrwxrwx    2048 Jan 01 1970  setsio.com
-rwxrwxrwx    8448 Jan 01 1970  show.com
-rwxrwxrwx    8064 Jan 01 1970  sid.com
-rwxrwxrwx    5376 Jan 01 1970  submit.com
-rw-rw-rw-    1280 Jan 01 1970  trace.utl
-rwxrwxrwx    3072 Jan 01 1970  type.com
-rwxrwxrwx   15488 Jan 01 1970  xref.com

fsed.cpm output:
                                                                                  System area

Byte        0 (0x00000000)  Physical sector   1  Offset     0  Track     0

18 28 00 43 50 2f 4d 20  43 50 43 00 02 10 00 04  .(.CP/M CPC.....
06 3f 03 ff 03 ff 03 f0  00 00 80 01 00 02 03 33  .?.............3
3f 01 43 41 42 43 44 45  46 4d c9 00 00 00 00 00  ?.CABCDEFM......
00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................

                                                                                 Directory area

Byte   131072 (0x00020000)  Sector   1 (physical   1)  Offset     0  Track     1

00 43 31 30 43 50 4d 33  20 45 4d 53 01 00 00 48  .C10CPM3 EMS...H
04 00 05 00 06 00 07 00  00 00 00 00 00 00 00 00  ................
00 42 41 4e 4b 4d 41 4e  20 42 41 53 00 00 00 07  .BANKMAN BAS....
08 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
00 50 52 4f 46 49 4c 45  20 45 4e 47 00 00 00 01  .PROFILE ENG....
09 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
00 53 45 54 4b 45 59 53  20 43 4f 4d 00 00 00 10  .SETKEYS COM....
0a 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................

Entry   0: Directory entry

User:  0 Name: C10CPM3  Extension: EMS
Extent:   0 (low:  1, high:  0)
Last extent record count:  72
Last record byte count:   0
Data blocks:     4     5     6     7     0     0     0     0

So, you must be doing something wrong...


Quote from: cpcoldie on 16:21, 19 March 24Hi d_kef,

I,m a little bit confused.
Wherefrom come the addresses 0x1848,  0x182b, 0x1833, 0x1886 and 0x180d ?
Can't found any references about it.
I would have expected somewhere at 0x05ba, 0x05c5 and 0x061c .


Real_uIDE_Init:
    push de            ;064d
    ld de,CF_BASE        ;064e
    ld (01848h),de        ;0651
    ld de,CF_COMMAND        ;0655
    ld (0182bh),de        ;0658
    ld (01833h),de        ;065c
    ld (01868h),de        ;0660
    ld (01886h),de        ;0664
    ld de,CF_SECCOUNT        ;0668
    ld (0180dh),de        ;066b
    ld de,CF_BASE        ;066f
    ld (00632h),de        ;0672
    ld (00641h),de        ;0676
    ld de,CF_COMMAND        ;067a
    ld (005d7h),de        ;067d
    ld (005f5h),de        ;0681
    ld (005fdh),de        ;0685
    ld (00612h),de        ;0689
    ld de,CF_HEAD        ;068d
    ld (IDE_SetHeadTrkSecSecnt+1),de        ;0690
    pop de            ;0694
    ret            ;0695


You might have found something there. The addresses #18xx should realy be #7Cxx. It seems that one of my equates got messed-up at some point.
I'll sent you a new HDCPM.BIN to test.

d_kef
  


cpcoldie

Yeah, this was the trick!!!

Very cool!  8)

Thank you!

BTW cpmtools: No, I made no mistakes, except compiling the tools with libDSK and I'm pretty sure the "bug" is there.
CPC6128, PCW, PPC512, ...

d_kef

Quote from: cpcoldie on 23:56, 21 March 24Yeah, this was the trick!!!

Very cool!  8)

Thank you!

BTW cpmtools: No, I made no mistakes, except compiling the tools with libDSK and I'm pretty sure the "bug" is there.


I'm glad it worked.
Many thanks for taking the time to reverse engineer my code and find the problem.
I'll add the fix to the new HDCPM release.

d_kef

cpcoldie

Quote from: d_kef on 00:15, 22 March 24Many thanks for taking the time to reverse engineer my code and find the problem.
Thats the point of forums like this. :)

Thanks again!
CPC6128, PCW, PPC512, ...

pollito

Quote from: d_kef on 22:57, 03 January 24True! My bad  :picard:
I'm attaching a CP/M disk image ready to use.
You can also use the Z3Plus disk image from the HDCPM wiki page.

d_kef

You cannot view this attachment.

@d_kef would it be possible for you to update the version of the CP/M disk images ZIP on the HDCPM wiki page to include this version of CPMDSK01.IMG, so my 464 bretheren will suffer no more?  ;)

d_kef

HDCPM v1.11 is here!

The new features are:
  • You can mount up to 100 different .IMG files and up to 4 Partitions to the 4 available mount points. As a consequence, CP/M (virtual) hard disks are now treated as removable. Use the new utility MOUNT.COM to list your available hard disks and mount them. So you can make your library of up to about 800MB of programs and data in mountable image files.
  • RTC.COM now supports the NOVA interface.
  • A couple of bugs were fixed.

As always, you can download the new release at the HDCPM wiki page.
There you can also find a new .IMG containing many .EMS system files to try.

Quote from: pollito on 20:35, 23 March 24d_kef would it be possible for you to update the version of the CP/M disk images ZIP on the HDCPM wiki page to include this version of CPMDSK01.IMG, so my 464 bretheren will suffer no more?  ;)
That's also been included.

d_kef

GUNHED

http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

zhulien

Fantastic! Especially the device mounting.

HAL6128

Interesting! I don't know, but has been CP/M prepared in the past for such kind of things (mounting activities) or did you change something?
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

cpcoldie

@d_kef

I've tinkered a "rom-box" and can confirm the rom version works.
But I have not tested the new extra functionalities. Hope soon...

Very impressive work!
Thank you!

Cheers
CPC6128, PCW, PPC512, ...

GUNHED

Quote from: HAL6128 on 20:26, 07 May 24Interesting! I don't know, but has been CP/M prepared in the past for such kind of things (mounting activities) or did you change something?
CP/M Plus natively supports devices up to 16 MB. In addition it's the only native CPC OS which allows to use the full power of the Z80 - means use 2nd register set. This can speed up applications up to 30%-40% compared to a Z80 which does waste the 2nd register set for f.e. interrupt handling like the native OS (you see, they worked on 8080 before). Since CP/M 2.2 is using the Firmware as BIOS it also doesn't allow to use the genius 2nd register set sadly.
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

cpcoldie

Quote from: cpcoldie on 22:52, 07 May 24I've tinkered a "rom-box" and can confirm the rom version works.
I forgot to mention: "...for the uIDE interface".
CPC6128, PCW, PPC512, ...

HAL6128

Quote from: GUNHED on 13:45, 08 May 24
Quote from: HAL6128 on 20:26, 07 May 24Interesting! I don't know, but has been CP/M prepared in the past for such kind of things (mounting activities) or did you change something?
CP/M Plus natively supports devices up to 16 MB. In addition it's the only native CPC OS which allows to use the full power of the Z80 - means use 2nd register set. This can speed up applications up to 30%-40% compared to a Z80 which does waste the 2nd register set for f.e. interrupt handling like the native OS (you see, they worked on 8080 before). Since CP/M 2.2 is using the Firmware as BIOS it also doesn't allow to use the genius 2nd register set sadly.
I was thinking more about "mounting" a device during runtime. I understand that a floppy or drive will be recognized and mounted by CP/M during the boot process, but it seems that is also possible after that process; some kind of "hot-plug-in". Tables / internal device lists have to be adapted... ? (It's obviously that I don't understand the CP/M system architecture :) )
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

pollito

#239
@d_kef I have just swapped out the 1.10 ROM with the 1.11 ROM on my 464 (same config as before) but it just causes the machine to reset over and over again on power up before loading the new ROM. Any ideas?

EDIT: To clarify, I used CP/M Image File Explorer (image type cpcdata) to open Hdcpm111.dsk, then copied the hdcpm.rom file to my hard drive, and replaced the existing HDCPM ROM in the M4 slot with the new one. Maybe the file didn't copy correctly (although I did try again)? Is there a checksum I can compare it against?

Maybe it would be a good idea to put the ROM file itself on the download page, as I think this would be easier for many people.

d_kef

Quote from: pollito on 12:45, 11 May 24@d_kef I have just swapped out the 1.10 ROM with the 1.11 ROM on my 464 (same config as before) but it just causes the machine to reset over and over again on power up before loading the new ROM. Any ideas?

EDIT: To clarify, I used CP/M Image File Explorer (image type cpcdata) to open Hdcpm111.dsk, then copied the hdcpm.rom file to my hard drive, and replaced the existing HDCPM ROM in the M4 slot with the new one. Maybe the file didn't copy correctly (although I did try again)? Is there a checksum I can compare it against?

Maybe it would be a good idea to put the ROM file itself on the download page, as I think this would be easier for many people.
Just tested the ROM and BIN with my 464, M4 and revaldinho's Universal 512K RAM.
It works without any restarts or any other strange behaviour.
The ROM itself does a checksum test during boot (since v1.10), so it will display an error message in case of data corruption.

Anyway I'm attaching the ROM here just in case.

d_kef

d_kef

Quote from: HAL6128 on 19:30, 08 May 24
Quote from: GUNHED on 13:45, 08 May 24
Quote from: HAL6128 on 20:26, 07 May 24Interesting! I don't know, but has been CP/M prepared in the past for such kind of things (mounting activities) or did you change something?
CP/M Plus natively supports devices up to 16 MB. In addition it's the only native CPC OS which allows to use the full power of the Z80 - means use 2nd register set. This can speed up applications up to 30%-40% compared to a Z80 which does waste the 2nd register set for f.e. interrupt handling like the native OS (you see, they worked on 8080 before). Since CP/M 2.2 is using the Firmware as BIOS it also doesn't allow to use the genius 2nd register set sadly.
I was thinking more about "mounting" a device during runtime. I understand that a floppy or drive will be recognized and mounted by CP/M during the boot process, but it seems that is also possible after that process; some kind of "hot-plug-in". Tables / internal device lists have to be adapted... ? (It's obviously that I don't understand the CP/M system architecture :) )
You can change a disk as long as the DPB of the new one is the same to the old one.
In that case the partition or image is treated exactly like a floppy disc.
CP/M Plus can tell if the disk is fixed or removable by examining the CKS property of the DPB and re-initializes the directory allocation table etc. after the disk change.
The trick with the MOUNT.COM is that you can mount a new image (or partition) only if the mount point has been initialized/used during boot time. So if you mount CPMDSK01.IMG and CPMDSK03.IMG during boot, then you can only use mount points 1 and 3 with MOUNT.COM

d_kef

pollito

Quote from: d_kef on 15:56, 11 May 24
Quote from: pollito on 12:45, 11 May 24@d_kef I have just swapped out the 1.10 ROM with the 1.11 ROM on my 464 (same config as before) but it just causes the machine to reset over and over again on power up before loading the new ROM. Any ideas?

EDIT: To clarify, I used CP/M Image File Explorer (image type cpcdata) to open Hdcpm111.dsk, then copied the hdcpm.rom file to my hard drive, and replaced the existing HDCPM ROM in the M4 slot with the new one. Maybe the file didn't copy correctly (although I did try again)? Is there a checksum I can compare it against?

Maybe it would be a good idea to put the ROM file itself on the download page, as I think this would be easier for many people.
Just tested the ROM and BIN with my 464, M4 and revaldinho's Universal 512K RAM.
It works without any restarts or any other strange behaviour.
The ROM itself does a checksum test during boot (since v1.10), so it will display an error message in case of data corruption.

Anyway I'm attaching the ROM here just in case.

d_kef

I used the version you attached, and everything is now good, so many thanks! Something must be happening when I extract the ROM from the DSK image.

What is the correct process for extracting the ROM from the DSK image on the CPC itself? I tried the |COPYF and |FCP to copy it to the root of the SD card but, failed with both, and SymbOS doesn't seem to be able to mount DSK images.

d_kef

I use WinAPE for developing HDCPM, so I also use it for building the distribution DSK file.
It has a nice DSK editor. You can use it to insert or extract files to/from a DSK image.

d_kef

ikonsgr

#244
Ok, after A LOT of work, i finally manage to implement the C3 ram configuration mode correctly , with a revised/dev board of ULIfAC (duke's c3 ram test pass without problems, and also phortem demo, which uses heavily c3 mode, runs perfect on my cpc 464).
 HDCPM works perfect on a cpc6128 using ULIfAC board, but until now, it didn't work on CPC464 (due to incomplete implementation of c3 mode, as i thought)
Now that i finally made c3 mode to work correctly, i tried HDCPM on CPC464 using the revised ULIfAC board and dual ram/rom mode (with all 3 roms of cpc 6128 mounted), but still, after initial loading:

You cannot view this attachment.

I still get the same error message:

You cannot view this attachment.

Does anyone knows, what exactly this message means? Or maybe, what code is executed and under what conditions, gives this specific error?
I'm really run out of options on how to deal with this...  ::)


GUNHED

Wish you the very best success!!!  :) :) :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

d_kef

@ikonsgr you use a realy old version of HDCPM. Please download and test the latest one v1.11 from the HDCPM wiki page. Also use the CP/M disk images from the "Other downloads" section, as they contain a system file that doesn't check for the 6128 ROM.
Let me know if it works. 

@Gryzor please remove the old releases files from the first post and also the sentence "Latest release: v1.05 July 2022". They're really misleading.

d_kef

ikonsgr

#247
AT LAST:

You cannot view this attachment.

Yes... it's a CPC464 running cp/m plus!  :D

Many thanks @d_kef for the notification to try the latest version (and i also confirm that it doesn't check for 6128 roms, i manage to load cp/m plus even using  cpc 464 roms too ;-)  )!
Now, can you also suggest a few more ways to test cp/m plus (and c3 mode) more thoroughly? For example, are there any cpm plus utilities/demos/games that i can use for that purpose?
Btw, with the new ULIfAC board, symbos, pinball dreams and a couple of demos (that previously didn't work on cpc 464), are finally running on CPC464 without problems too!

d_kef

Good job mate!!!
#C3 or CP/M page 2, contains a copy of the CCP, disk hash tables and data buffers. So it is paged in and out every time you run a program. The user programs are loaded and run in RAM mode #C2 or CP/M page 1, where the TPA resides.
So whatever program you run, if it goes back to the command prompt when it finishes executing, that's an indication that #C3 RAM mode works just fine.

d_kef

Gryzor

Quote from: d_kef on 21:52, 25 June 24@ikonsgr you use a realy old version of HDCPM. Please download and test the latest one v1.11 from the HDCPM wiki page. Also use the CP/M disk images from the "Other downloads" section, as they contain a system file that doesn't check for the 6128 ROM.
Let me know if it works.

@Gryzor please remove the old releases files from the first post and also the sentence "Latest release: v1.05 July 2022". They're really misleading.

d_kef
Done.

Powered by SMFPacks Menu Editor Mod