• Please review our updated Terms and Rules here

CP/M on HP-86B

gslick

Veteran Member
Joined
Dec 30, 2010
Messages
2,112
Location
Seattle, WA
Ok, I finally got most of this working. I must have done something wrong when I created a new CP/M floppy on my HP-86B and then dumped the sectors to take a look. I think I used the 3.5-inch drive on my 9133H and maybe that ended up creating a double sided floppy and I only dumped the sectors from one side assuming the physical format would be the same as with the 9121 3.5-inch format. Maybe that's why I couldn't find the CP/M directory when I dumped the raw sectors.

I went back to the original Teledisk image format I downloaded from hpmuseum.net HP87CPM.TD0. Then I used ImageDisk TD02IMD.COM to convert that to HP87CPM.IMD.

C:\ImageDisk\TD02IMD.COM HP87CPM.TD0
TD 1.5 5.25-96 LD MFM D-step, 2 sides 29/10/2003 11:46:21
HP87 CP/M SYSTEM
32/1: CRC error (bad sector)
33/1: Duplicate sector numbers
33/1: CRC error (bad sector)
34/1: CRC error (bad sector)
72 tracks, 1134 sectors converted.

Then I used ImageDisk IMDU.COM to convert the ImageDisk format image file to a raw sector file, while excluding the extra two tracks which I don't believe contain valid data. This resulted in a 270,336 byte HP87CPM.DSK image file.

C:\ImageDisk\IMDU.COM HP87CPM.IMD HP87CPM.DSK /B X=33,34
IMageDisk Utility 1.18 / Mar 07 2012
IMD TD 1.5 5.25-96 LD MFM D-step, 2 sides 29/10/2003 11:46:21
HP87 CP/M SYSTEM
Assuming 1:1 for Binary output
0/0 250 kbps DD 16x256
33/1 250 kbps DD 31x256
34/0 250 kbps DD 16x256
34/1 250 kbps DD 15x256
70 tracks(35/35), 1134 sectors (907 Compressed, 4 Bad)

Then with that HP87CPM.DSK disk image file I could use Cpmtools 2.9 http://www.cpm8680.com/cpmtools/index.htm to access the contents of the CP/M file system contained in that disk image file.

Here is a new entry I added in my local copy of cpmtools diskdefs. I think these values are correct for the HP 86B CP/M:

diskdef hp87cpm
seclen 256
tracks 66
sectrk 16
blocksize 1024
maxdir 128
skew 0
boottrk 3
os 2.2
end

C:\cpmtools>cpmls -f hp87cpm -l HP87CPM.DSK
0:
-rwxrwxrwx 8192 Dec 31 1969 asm.com
-rwxrwxrwx 4864 Dec 31 1969 ddt.com
-rw-rw-rw- 4224 Dec 31 1969 dump.asm
-rwxrwxrwx 512 Dec 31 1969 dump.com
-rwxrwxrwx 6656 Dec 31 1969 ed.com
-rwxrwxrwx 2944 Dec 31 1969 format.com
-rwxrwxrwx 1792 Dec 31 1969 load.com
-rwxrwxrwx 7424 Dec 31 1969 pip.com
-rwxrwxrwx 5248 Dec 31 1969 stat.com
-rwxrwxrwx 1280 Dec 31 1969 submit.com
-rwxrwxrwx 768 Dec 31 1969 xsub.com

You can use cpmcp to copy files from and to the disk image.

C:\cpmtools>cpmcp -f hp87cpm HP87CPM.DSK 0:dump.asm dump.asm

C:\cpmtools>type dump.asm
; FILE DUMP PROGRAM, READS AN INPUT FILE AND PRINTS IN HEX
;
; COPYRIGHT (C) 1975, 1976, 1977, 1978
; DIGITAL RESEARCH
; BOX 579, PACIFIC GROVE
; CALIFORNIA, 93950
;

I also finally got an old Windows XP system setup with HPDrive to emulate HPIB disks and was able to boot the HP 86B CP/M from the HP87CPM.DSK file loaded in a emulated drive.

HPDrive uses 286,720 byte files for this floppy disk size so I added back 16KB of 0xDB fill bytes to the end of the 270,336 byte HP87CPM.DSK image file to make up for the 2 tracks that I stripped off earlier.

I was also able to use cpmcp to copy a file into the disk image and then with that image loaded in HPDrive the new file showed up as expected when accessing that emulated disk from the real HP 86B system.

I wasn't able to use the format command on the HP 86B system to create a new CP/M disk on an emulated HPDrive disk. Something doesn't seem quite right with the emulated formatting operations on the HPDrive system and it fails with an error. The plain HP 86B INITIALIZE command also fails on an emulated HPDrive disk.

-Glen
 

leeb

Veteran Member
Joined
Jan 21, 2009
Messages
709
Location
Palm Springs CA
Havent used imagedisk that much but it still looks like youre creating 2-sided images...
The only question is, does it go to the end track and change sides, or
does it write sectors 1-16 THEN change sides, THEN change tracks...
???

Not sure that XP (or 7/vista,etc) will allow 'low-level' access like that... which is why I use ME or older...

Sounds like lots of work. :rolleyes:
But if it ends up working, THATs whats important!

Youze guise got the toyz... Im just playing in the sandbox! :p

:D
 

gslick

Veteran Member
Joined
Dec 30, 2010
Messages
2,112
Location
Seattle, WA
I waa just using ImageDisk utilities to manipulate the original Teledisk disk image file, not to actually access a physical floppy the second time around. You've right, you cannot directly access a physical floppy with ImageDisk while running inside Windows XP. I waa just manipulating image files.

The ImageDisk sector order in a raw image file is track 0, side 0 then track 0, side 1 before advancing to track 1.

-Glen
 

leeb

Veteran Member
Joined
Jan 21, 2009
Messages
709
Location
Palm Springs CA
Some musings...

Some musings...

I believe I now understand how/why 22disk was able to access and view/modify/delete files on this format disk...

(referring to 66 tracks as 0-65)
The format itself specifies that tracks 0-1 designate the HP-part of the configuration...
Tracks 2 and 3 are the CP/M 'boot tracks'... as they normally would be as 0 and 1.
Track 4 is the CP/M directory and 5-63 are data areas.

22disk has been told that 0-1 are 'skipped', so it simply ignores them and recognizes the rest of the disk (minus tracks 64 & 65) as if they didnt exist. Thus, although the HP portion is told that 'file CP/MSYS starts at t2s1', that is irrelevant UNLESS one were to attempt to 'change the size' (add/remove tracks/sectors) of the CP/M 'filesystem area'...

I suspect it also means that, when I formatted a disk last nite (in 22disk) and put some files on it, that the first (and last) 2 tracks are (likely) 'empty'... and the HP FORMAT program would need to be used to generate the 'missing' 4 tracks... or a program that makes an image of those tracks and 'inserts' them after the fact. Until that happened, I believe that HP would consider this disk 'empty'... without even knowledge of the 'CP/MSYS'...

SMP should soon be able to tell us if the disk I modified is useable, and if so, he has a reliable way to transfer programs/files in/out of the CP/M disks.

Long-term would be the development of the HP-IB serial port 'driver' for CP/M to allow it to directly work with the (9600-baud max!) serial port... as I doubt it is built into the 'cpm binary/interface', and would be far more difficult to disassemble than the CP/M parts.
:D
 

smp

Veteran Member
Joined
Oct 4, 2011
Messages
1,677
Location
Bedford, NH, USA
Hi guys,

All I can say at this point is thank you so much for your continuing assistance.

I have spent a considerable amount of time this weekend being frustrated in attempting to replicate Glen's results. I thought to myself, why not try to replicate Glen's results using Parallels on my Mac? That way I can get familiar with these PC tools and gain a better understanding about what you guys are discovering first hand. Well, after many hours of effort, I have 3 different virtual machines, one with Windows XP, another with Windows 98, and a third with MS-DOS 6.21. Each of them is capable of doing some of what has been reported by Glen, but none of them actually works all the way through.

I knew from your posts that Windows XP would only be good for playing around with disk images, and not for actually creating real physical floppy disks, but I never got that far, anyway. In my Windows XP setup, I can do the first 2 steps of what Glen reported. I can use the Image Disk tools to create the .IMG file from the original .TD0 file, and I can create the .DSK file from the .IMG file. However, when I try to use the CPM Tools, I get an error that the PATH cannot be found. Consequently, when I try to use cpmls, I get an "unknown format" error, even though I have updated the diskdefs file. Apparently, not being able to trace the path makes it so cpmls cannot see the updated diskdefs, even though they are right in the same directory?

On to Windows 98. I keep hearing that folks use Windows ME or earlier, so since I have acquired a pristine original OEM package of Windows 98 along with its installation key, I figured that I'd be golden. No way, Jose! Parallels installs Windows 98, but leaves so many drivers in a bad state that I cannot get a network connection and I have a significantly bad time attempting to transfer files in via a floppy disk. So much for that. I have been successful with using the Image Disk tool here, too, so at least I did have that much success with Windows 98.

Lastly, on to MS-DOS 6.21. Well, actually MS-DOS 5.0, and then upgrade to DOS 6.21, because I had a real installation copy of MS-DOS 5, but only upgrade disks for DOS 6.21. After an eternity trying to noodle out how to get DOS installed as a virtual machine at all, I finally got that all going, and voila! I can successfully use the Image Disk tools to replicate the first 2 steps of what Glen did (just like in Windows XP), but when I tried to use cpm tools, I get an error message that these tools cannot be used in DOS mode. Seems they must be run under some version of Windows. I tried to find a copy to download that does not require Windows, but I have not been successful so far.

This Microsoft OS stuff is really, really difficult to deal with! I know I am not doing myself any favors trying to use these things in virtual machines, but I thought that I'd be able to get things to go and get some experience before I have to deal with some older PC and whatever might be wrong with it, too.

SIGH!!!

I got some experience alright, but mostly negative experience so far. I guess that I'll just have to acquire some more hardware...

I will let you know when the disks arrive, Lee. We will see how successful you have been with putting additional files onto them.

Thanks for listening.

smp
 

gslick

Veteran Member
Joined
Dec 30, 2010
Messages
2,112
Location
Seattle, WA
For best results copy the contents of the cpmtools zip file into a c:\cpmtools directory and then I think things should just work. That's what I did. I think there is an environment variable you could set if the files are located somewhere else. I didn't try that.

-Glen
 

smp

Veteran Member
Joined
Oct 4, 2011
Messages
1,677
Location
Bedford, NH, USA
Hi Glen,

Well, I did what you said, and I copied my cpmtools folder to the top of my C: drive, and I named the folder cpmtools.

That has eliminated the complaint about not finding the path. I also checked, and \cpmtools is properly being inserted at the beginning of the path as directed by cpmtools.bat.

However, I still am getting the "cpmls: unknown format hp87cpm" error. I have checked and re-checked that I have edited your definition ito the diskdefs file (as the very first entry). For the record, I cannot use cpmls on the example file, either:

C:\cpmtools>cpmls -f apple-do EXMPLCPM.dsk
cpmls: unknown format apple-do

C:\cpmtools>


Oh, well, it's probably something involving the Parallels virtual machine setup, and I'm too tired to do much more.

Thanks again for all your attention.

smp
 
Last edited:

leeb

Veteran Member
Joined
Jan 21, 2009
Messages
709
Location
Palm Springs CA
Hi Glen,

Well, I did what you said, and I copied my cpmtools folder to the top of my C: drive, and I named the folder cpmtools.

That has eliminated the complaint about not finding the path. I also checked, and \cpmtools is properly being inserted at the beginning of the path as directed by cpmtools.bat.

However, I still am getting the "cpmls: unknown format hp87cpm" error. I have checked and re-checked that I have edited your definition ito the diskdefs file (as the very first entry). For the record, I cannot use cpmls on the example file, either:

C:\cpmtools>cpmls -f apple-do EXMPLCPM.dsk
cpmls: unknown format apple-do

C:\cpmtools>


Oh, well, it's probably something involving the Parallels virtual machine setup, and I'm too tired to do much more.

Thanks again for all your attention.

smp

Well, if you have a 6.21 virtual DOS working, then all you will need to do is copy the 22disk DIRECTORY and cpmx.bat to your C drive and run cpmx.bat from there...

I think you will be happy with what you see... unless the virtual DOS doesnt allow low-level control of the drive... then you will likely not get ANYTHING to work correctly.
I have never used the cpmtools utilit(ies) glen mentions... but inside the 22disk directory is a file called tmp.txt (I believe). it is a TEXT version of the disk definitions it is capable of using, and you will find HP1 and HP2 (the one I modified from HP1 for 3.5-SSDDs) there.

Or...
You could put the data disk in the HP and see if it can still read it... then see if you see the files I put on it.

Or both. :p
:D
EDIT:
I just took a look at the wiki on Parallels...
If youre running a 64-bit version it may be responsible for your issues with 98... which would likely balk at the 64-bit setup. Particularly if it is 'forced' onto 98 and not 'self-demoting', dropping back to 32-bit mode. Or perhaps telling Parallels to default to 32 bit would make it happier...

Just a few pennies-worth.. :p
 
Last edited:

gslick

Veteran Member
Joined
Dec 30, 2010
Messages
2,112
Location
Seattle, WA
However, I still am getting the "cpmls: unknown format hp87cpm" error. I have checked and re-checked that I have edited your definition ito the diskdefs file (as the very first entry). For the record, I cannot use cpmls on the example file, either:

C:\cpmtools>cpmls -f apple-do EXMPLCPM.dsk
cpmls: unknown format apple-do

C:\cpmtools>

What did you use to edit the diskdefs file? Do you see something like this:

Code:
C:\cpmtools>debug diskdefs
-d
0AE3:0100  64 69 73 6B 64 65 66 20-68 70 38 37 63 70 6D 0A   diskdef hp87cpm.
0AE3:0110  20 20 73 65 63 6C 65 6E-20 32 35 36 0A 20 20 74     seclen 256.  t
0AE3:0120  72 61 63 6B 73 20 36 36-0A 20 20 73 65 63 74 72   racks 66.  sectr
0AE3:0130  6B 20 31 36 0A 20 20 62-6C 6F 63 6B 73 69 7A 65   k 16.  blocksize
0AE3:0140  20 31 30 32 34 0A 20 20-6D 61 78 64 69 72 20 31    1024.  maxdir 1
0AE3:0150  32 38 0A 20 20 73 6B 65-77 20 30 0A 20 20 62 6F   28.  skew 0.  bo
0AE3:0160  6F 74 74 72 6B 20 33 0A-20 20 6F 73 20 32 2E 32   ottrk 3.  os 2.2
0AE3:0170  0A 65 6E 64 0A 0A 64 69-73 6B 64 65 66 20 69 62   .end..diskdef ib
-q

Or something like this:

Code:
C:\cpmtools>debug diskdefs.dos
-d
0AE3:0100  64 69 73 6B 64 65 66 20-68 70 38 37 63 70 6D 0D   diskdef hp87cpm.
0AE3:0110  0A 20 20 73 65 63 6C 65-6E 20 32 35 36 0D 0A 20   .  seclen 256..
0AE3:0120  20 74 72 61 63 6B 73 20-36 36 0D 0A 20 20 73 65    tracks 66..  se
0AE3:0130  63 74 72 6B 20 31 36 0D-0A 20 20 62 6C 6F 63 6B   ctrk 16..  block
0AE3:0140  73 69 7A 65 20 31 30 32-34 0D 0A 20 20 6D 61 78   size 1024..  max
0AE3:0150  64 69 72 20 31 32 38 0D-0A 20 20 73 6B 65 77 20   dir 128..  skew
0AE3:0160  30 0D 0A 20 20 62 6F 6F-74 74 72 6B 20 33 0D 0A   0..  boottrk 3..
0AE3:0170  20 20 6F 73 20 32 2E 32-0D 0A 65 6E 64 0D 0A 0D     os 2.2..end...
-q

The key difference I am trying to point out here is the end of line termination, 0x0A (LF) only or 0x0D and 0x0A (CR and LF).

The MS-DOS convention is CR and LF while the Unix convention is LF only.

The Win32 Cpmtools 2.9 binaries appear to only work with a Unix convention version of the diskdefs file. If you edited the file with an editor that saved the file using the MS-DOS convention then that is a problem and would cause the "unknown format" error message.

-Glen
 

smp

Veteran Member
Joined
Oct 4, 2011
Messages
1,677
Location
Bedford, NH, USA
Hi Lee,

OK! 22DISK it will be next. No time right now, but I'll get to it later this week.

I have not yet received your diskettes, but I'll let you know about them when they arrive.

Thanks,
smp
 

smp

Veteran Member
Joined
Oct 4, 2011
Messages
1,677
Location
Bedford, NH, USA
Hi Glen,

Who knew? I just used EDIT in the DOS window. So, now I have probably corrupted the entire DISKDEFS file.
Oh, well, thanks very much for letting me know this. I suppose the next time I can edit the file on my Mac and transfer that over to the virtual machine.
Like I said to Lee, I don't have time right now, but I'll be back at it later this week.

Thanks!
smp
 

smp

Veteran Member
Joined
Oct 4, 2011
Messages
1,677
Location
Bedford, NH, USA
Hi Lee!

The disks arrived today, and I think I can report success:

I see 2 additional files on the HP DATA disk: X10.SRC and TIME.PAS

I can also TYPE both files.

X10.SRC starts with:

; Code snippet... X/10 and X*10
; Orig date unk
; modified 8-3-:0 mlb
;

then there's some source code,

and the file ends with:

RowCol * 21 ;
Col * 05 ;

I'm not certain if that's all that is supposed to be there, or not.


TIME.PAS starts with:

program TIME;
{ version 1.0 12-9-08
version 1.1a 1-1-09
stable version
version 1.2a 7-24-09

then goes on...

the file ends with:

else showhow;
end;
end.


Hopefully, I have gotten everything you put into the CP/MSYS file for me to find?

I am feeling pretty excited about this!

Thanks!

smp

EDIT: I'm sorry, but the message editor shows the proper indenting and stuff, but then strips off the leading spaces when I posted the message...
 

smp

Veteran Member
Joined
Oct 4, 2011
Messages
1,677
Location
Bedford, NH, USA
Hi again, Lee,

I will now be perusing the DOS disk that you sent, and try to get the files into my virtual MS-DOS machine.

Thanks a million! I will probably be asking for specific, details on the steps to take with the 22DISK program(s) to do the same thing for myself.

Thanks again for all your patience and attention.

smp
 

smp

Veteran Member
Joined
Oct 4, 2011
Messages
1,677
Location
Bedford, NH, USA
OK!!!

I read your MS-DOS disk, and I copied the 22DSK directory and the cpmx.bat file onto my MS-DOS virtual machine. Running cpmx.bat starts up 22DISK, and I see the 22DISK main menu as I should. I also see the line under the menu announcing that it is prepared to read disks of type = HP2 and all the details that are on that line.

I can select item 6, Display a CP/M Directory, but unfortunately (but totally expected) I cannot actually read a HP CP/M disk that I inserted into my floppy drive. I really didn't expect that this old program would actually be able to reach out of the virtual machine, through my Mac, through the USB port and read the floppy. That would have been a real miracle. It does try to do its job, but then I get an "Error reading diskette A ... Drive not Ready." However, I think we are in the middle of proving that we can get this done, if I get (yet another) computer working.

Maybe I can get that old PC that I just purchased off eBay to run as an HP-Drive, like Glen did. If nothing else, maybe I can simply use these programs to make some disks. It certainly sounds like I have some new work to get to.

Thanks!
smp
 
Last edited:

leeb

Veteran Member
Joined
Jan 21, 2009
Messages
709
Location
Palm Springs CA
Yes, Im afraid the problem is the emulator...
If you can get the 'old PC' to RUN... that DOS disk has a WORKING 6.22 ON IT.
It WILL WORK with TRUE drive access...

If I have to, I'll send you the 3800hd to prove it.

He11, it will likely work on the old 1500hd too... and Id have no problem at all giving that one away!
:D
 

smp

Veteran Member
Joined
Oct 4, 2011
Messages
1,677
Location
Bedford, NH, USA
Hi Lee,

So, you didn't answer my question from a few posts up - did I see the 2 files you put on the disk correctly?

Thanks!
smp
 

leeb

Veteran Member
Joined
Jan 21, 2009
Messages
709
Location
Palm Springs CA
Hi Lee,

So, you didn't answer my question from a few posts up - did I see the 2 files you put on the disk correctly?

Thanks!
smp

Sorry... didnt think to look for any 'unreads'...

Yes, those are it!
... and the Pascal file is pretty long, so if it ended with 'end.' as you showed, then you were able to read it correctly! :cool:

Your only problem now is the emulator.
:D
 

smp

Veteran Member
Joined
Oct 4, 2011
Messages
1,677
Location
Bedford, NH, USA
WHOO HOO! I did it!

WHOO HOO! I did it!

Hi Lee and Glen!

I have achieved some success!

I fired up the old Pentium computer I got from eBay a couple of weeks ago - it came up in Windows 98, but there were a number of funky things going on, so I reformatted the disk drive and loaded MS-DOS 5, then upgraded to MS-DOS 6.21.

I loaded the 22DISK programs and cpmx.bat onto drive C:, just like I did in my virtual machine exercise. Voila! 22DISK was able to read my HP-87 CP/M data disk that Lee sent back to me.

I struggled a bit to get the FIGFORTH.ASM source code text file out of my Mac and onto a MS-DOS data disk, but I finally managed it. I copied that file onto my C:drive, and I was able to use 22DISK to copy the DOS file onto my HP CP/M disk.

On my HP-86B, in CP/M, I have now been able to go through the FIGFORTH.ASM file, and edit out the documented errors that I know. I have been able to assemble the file, LOAD it and I can run the resulting FIGFORTH.COM file. I am now in the midst of scouring the documentation that I have to set variables in the source file correctly, so I will be able to save Forth screens to disk and be able to retrieve them again. This is the method that Forth uses to save and load one's Forth programs. It looks like I may have to dig up the Forth code for the Forth Editor, but this is where I want to be - working with Forth, in CP/M, on my HP-86B!

WHEW!

Thank you very much, Lee, for experimenting and figuring out how to use 22DISK to get this done. This is a big first step.

Thank you, Glen, for setting up your HP Drive, and letting me know that this is also a viable option. I intend to go on and load Windows 98 onto that old computer I have and then I will be able to use the CPMTOOLS program that you suggest. As well, I will then also be able to attempt to set up my own HP Drive.

Thanks a million, you guys. I would not have been able to get here without your assistance. This is a wonderful community here on the Vintage Computer Forums. I hope that over time I can give back a little of what I have received.

I will continue to post about my progress, and I will certainly be asking more questions in the future. I just wanted you guys to know right away that I am achieving success, and thank you both for all your help.

smp
 

leeb

Veteran Member
Joined
Jan 21, 2009
Messages
709
Location
Palm Springs CA
The IMPORTANT thing...

Can the HP(CPM) read what I sent to you?
Oh wait...
nevermind. :rolleyes:

I didnt see anything in the book about video 'emulation' of the CP/M... what does it use to clear the screen? <ctrl> L perhaps?

If we can determine what/how to move around the screen, we can get a working copy of Wordstar to you for code editing... FAR superior to ED.
Hell... beating a wooden log with 2 sticks is better than ED. :rolleyes:

Now... howzabout a copy of Pascal MT+?
:p
 
Last edited:
Top