July 2, 2021 at 3:22 pm #971
If you are interested in running CP/M with a REAL BIOS on your Z80 Playground, then visit https://github.com/gotaproblem/Z80Playground
This is a ROM, so you will have to write over your existing EEPROM or purchase another EEPROM.
The four disk images need to be written to the USB Memory Sticks root directory.
You can transfer CP/M files in via XMODEM protocol. Note, teraterm XMODEM does not work for some reason – it did once upon a time. I’m using extraPutty as my terminal emulator which also has XMODEM.
Drive A: has NZCOM configured if you are interested. NZCOM is a Z-System, offering a lot more than standard CP/M 2.2. You can peek and poke memory. You can even read/write IO ports
A0> port c
will read port $0c – expect 8
A0> port c 9
will write port $0c the value 9 – in this case you should see your User LED turn on
Drive C: has a range of CP/M utilities installed that I use, including WordMaster. WMVT100.COM is patched and runs with teraterm and extraPutty/Putty
I am looking to write a CP/M programme which will read FAT files and convert them to CP/M, but that’s a work-in-progress.
I hope you take the time to look. Feel free to ask questions.
Regards to all and stay safe
SteveJuly 3, 2021 at 10:07 am #972
Hi Steve, just taking a look at your alternative “Real” CP/M. Looks very interesting. My board is a self designed /built board inspired by the Z80 -PG so I have a few amends to make as my UART and CH376 IO addresses are different as is my ROM switching. All this looks do-able, however…
I have successfully compiled CPM22.ASM, but when trying to compile CBIOS.ASM I get an error complaining the ch376s_driver.asm file can’t be found.
Looking at CBIOS.ASM, at the end of the listing around line 753 there is an include “ch376s_driver.asm” line. I don’t appear to have this file in the github bundle I downloaded and I can’t see it in the file listing on your github portal.
Hopefully the file got missed in the upload, alternatively can you point me to an alternative source I can download the ch376s_driver.asm from?
Many thanks in anticipation and for sharing your hard work,
Glyn.July 4, 2021 at 4:06 am #973
Sorry about that. Missing file addedJuly 4, 2021 at 8:17 am #974
Many thanks, File downloaded and have an initial compile success. I now need to modify my I/O addresses before blowing to EEPROM and testing.
For a bit of feedback. I think it may be my compiler (ZASM), however it complained about a byte value out of range in initialise.asm line 53 – setting 1200 baud rate. The value is set in vars.asm line 69 which is set to a value of 384. My assembler balked at the idea of setting the value to more than 255. I don’t need to go this slow, so have simply commented out the references to 1200 baud. Now compiles but with a few syntax issues I will sort out. ZASM is a bit pedantic about “.” and “:”
As a side question. How do I create “raw” .DSK files? i.e. if starting from scratch without downloading one of your supplied A-D.DSK files. Do I just create an empty, say, C.DSK file, then use the format tool to format the empty C.DSK?
I guess once I get your CP/M up and running over the next few days I should just give format a try… 😉
Glyn.July 4, 2021 at 9:41 am #975
Thanks for the feedback. My assembler didn’t pick that up lol. Commenting out will not be a problem. Good find. My own dev board has a clock of 1.78xxx MHz, and I’ve ported this all over from that. So had to change all UART vars as a result. Just missed that one.
There are various ways to create the .DSK images. I use a Windows programme called “HxD Hex Editor”. Or simply copying an existing image on the memory stick. Note formatting an 8MB image takes five or six minutes – there’s a LOT going on.
I have found a bug in that adding a file to an empty 8MB image causes corruption. So I’m working on a fix for it. So for now it may be best to copy C.DSK to D.DSK and manually ERAse the files you don’t want, BUT leave at least one on there.
If you are using the same UART and USB module , then just two files should be modified with your port addresses – vars.asm for the UART and ch376s_driver.asm for the USB module
SteveJuly 4, 2021 at 3:24 pm #976
Thanks for the pointers. And Luck I need! Looking in main.asm I see the default is to load CP/M from within the ROM. Sadly my board doesn’t do John’s neat trick of overlaying ROM on RAM, so until I get CP/M fired up I am quite short on RAM space. I will need to juggle ROM into RAM above $8000 and get CP/M in the correct place and sort out the zero page vars. Its a nice juggling act, but I manged to get John’s system running in the same constraints.
I will take a close look at where things are being moved currently and see if it will work as is. If not I can always sort out a hybrid between your method and John’s. I look forward to getting CP/M to boot off the A: drive in the future 🙂
Yes I have the same UART and CH376 – v3. By good luck my UART also does flow control.
Glyn.July 4, 2021 at 9:41 pm #977
Yes! finally got my A>: prompt. For my board – not applicable to the real deal Z80 Playground, I had to do a tiny code copy into RAM in commands.asm in the area that cpm is actually loaded and then it was only the page zero and the ROM disable bit that needed moving.
The bit that caused me no end of angst was the USB initialisation. This may well affect a proper Z80 Playground. For some reason, maybe only on my board, it takes a long time for the CH376 hardware to settle after rest_all.
My solution. In ch376s_driver.asm under the ch376s_init: bit around line 250 there is a call hw_pause. Although the CH376 data sheet states 35ms, I found I couldn’t get the pause long enough using your hw_pause call. In the end I instigated my own wait and is similar to the code John uses in the original uart.asm long_wait. Set to a max length of $FFFF in BC and called twice, it is then sufficient for my CH376 to settle and finish the initialisation. After that the USB drive works a treat.
Happy to provide more detailed info. if needed.
So onward and upward!
Many thanks again Steve for sharing.July 5, 2021 at 3:04 am #979
That’s great news. In initialise.asm, I have a longer wait of a few hundred milli-seconds at power on to allow the UART to settle. Did you include that? The CH376S datasheet implies the parallel interface only needs 1ms to initialise. However, I put in a 35ms delay because the document suggests that would be the longest delay needed.
What speed is your CPU clock? My code has been tailored to a 10MHz part.
Oh BTW – I have resolved the C: and D: drive corruption problem I found. I will update the Git repository later today hopefully. The C.DSK and D.DSK Disk Images will need to be reformatted though unfortunately. You could copy any files you have on them to your A: and B: though (before the update), assuming there is enough disk space on them.
Thanks for letting me know of your progress
July 5, 2021 at 7:43 pm #983
- This reply was modified 6 months, 2 weeks ago by Steve.
Thanks for the support. I’m probably being a bit slow this evening, but I don’t see any delays in initialise.asm, happy to be led by the nose if you have a moment.
Totally correct with the specs on the CH376S, which is why it took so much screen gazing and the loss of my remaining hair. Code looked right, specs where spot on but I just couldn’t get the module to init. With nothing else to try, I thought give the thing masses of time to settle. Off it went and now I’ve had some playtime seems totally stable in use.
My clock speed is 7.3Mhz – I purchased two xtals one for the UART the other for the CPU. I do intend to up the CPU clock speed to 10Mhz in the future. My CPU is rated to I think 20Mhz.
I will apply the update once I spot the update on Git if not already there.
More good news, I can confirm SUBMIT works on this implementation of CP/M. I think Kevin, one of the forum posters, was enquiring.
Last thing, I noticed in Initialise.asm, you commented out the FIFO flow control due to issues with TeraTerm. Does this just effect TT? I have reinstated the code snippet as my UART can handle flow control, but I am having difficulty with Xmodem. I will look into Xmodem at a later date, but just wondered.July 6, 2021 at 4:59 am #984
Doh! It’s actually in main.asm under Initialise Hardware.
I haven’t had time to check everything is working with the fix yet. Maybe later today.
If you are using Teraterm, XModem only seems to work for text files, not binary. So I use ExtraPutty as my terminal emulator, plus I think it has a slicker interface for XModem :). I also had problems with flow control using Teraterm, that’s why I have commented the code out.July 6, 2021 at 7:26 pm #988
Glad its not just me!
I’ve added some aesthetics to your/my cbios I thought may be useful to share. I like to see if there is any disk activity as an indicator the system is doing something when there is no screen prompting. Picking up on John’s idea or using the UART OPT output to an LED. I’ve added a bit of code to switch OPT2 on /OFF and plumbed this into the drive_seek routine.
On entering drive_seek I do a call drive_on (LED on), then just under _seek, I call drive_off. Bit raw but seems to work as expected. Will make minimal difference to disk access times?
Happy to show my working if helpful.
I have downloaded your latest CBIOS.ASM from your github portal, compiled and now running it. For the moment I have only formatted D.DSK to see how things go. First format was a bit meh – probably me, so repeated the format and copied over some files. All seems OKJuly 6, 2021 at 8:04 pm #989
Glad to hear it’s all coming together for you. I removed disk activity light simply because I wanted to optimise r/w performance. I’m still looking to improve a little more. And of course it was initially my project for my own home brew setup 🙂 As a matter of interest, how long did your format take? Initially, I was seeing five or six minutes for the 8MB drives, but I formatted this afternoon and it took about twelve minutes. Did you see any “USB TIMEOUTS”?July 6, 2021 at 8:30 pm #990
Just re-formatted a recopied to USB D.DSK, and it took my 7Mhz clocked CPU ~7mins to format D: – with my little flashy led 🙂
Also test copied several files to the newly formated D: using PIP. Copied fine, so I must have done something daft on the first test.
No “USB TIMEOUTS”. Format screen looks nice with the track count.July 8, 2021 at 10:28 am #991
Hi Steve, I had a go at compiling filetransfer.asm to make getting files in /out of the DSK image easier, but hit a snag. The compiler couldn’t compile throwing an error about a missing memorystick_small.asm file.
Checking filetransfer.asm file I see there is an include “memorystick_small.asm”, but I cant find it in the repository.
Any chance of uploading it onto you Github site when you have a mo?
I have raised an “issue” on your github portal, but happy to raise them
here if you prefer?
All the best,
Glyn.July 9, 2021 at 3:12 am #992
This programme does not work yet. I don’t have that much time at the moment, so it could be a week or two before it is updated.
- You must be logged in to reply to this topic.