davidgiven / cpmish

An open source sort-of CP/M 2.2 distribution.
http://cowlark.com/cpmish
Other
344 stars 37 forks source link

Boot cpmish without a floppy or SRAM card? #54

Open theshinyknight opened 1 year ago

theshinyknight commented 1 year ago

Is there a way to boot cpmish on a PCMCIA 32 mb card without a floppy or SRAM card?

My NC200 has a dead floppy and could not find a ram card for less than 200 USD; so I was hoping there is a way to bootstrap cpmish as you do with the floppy disk, like using the onboard basic or a command via serial port? If so, how would that be possible? Thanks

davidgiven commented 1 year ago

Technically yes, but it'd be a miserable experience. You'd need to transfer the boot loader via serial port into a Basic program, run it, have it relocate itself to the right place, and proceed from there... every time you want to boot! So I haven't done it.

(Although there might be a load-and-execute feature in the built-in serial terminal. I haven't investigated it yet.)

(Also, my NC200 also has a dead floppy drive --- my own fault, I undid the wrong screw and ruined the calibration...)

theshinyknight commented 1 year ago

So the OS wouldn't be in memory when you power down the device? I assumed that it would work fine without the need to push again the bootloader unless you remove the batteries.

It would be also a problem if you want to go back to the original rom software, but at that point you leave it as CPM machine most of the time. Almost tempted to get a microcontroller and put the bootloader on it to be pushed as serial as permanent addition to the NC200; not sure if it would work but that would remove the need to connect to a computer via serial since the micro would push the code via serial every time you boot it (and use the standard rom when you do not boot the micro). Would that be feasible?

(sorry to hear about your floppy; the issue with these machines is that without a drive they are basically a bulky NC100. Isn't there a way to re-calibrate the heads? Maybe my floppy also has misalligned heads, since it make noise but does not read anything in the end and error out; which seems to be a common problem on the NC200 floppy drives)

davidgiven commented 1 year ago

The issue is that the NC200 doesn't have a deep sleep mode --- when it powers down, it actually powers off the CPU (although the RAM is left powered). So, when it powers on again, it reboots through the ROM, which looks at certain locations in RAM to determine the Amstrad OS system state and if they're not present does a hard reset. Alan Cox did some work on Fuzix to preserve enough state to trick the Amstrad OS into resuming Fuzix but by the time I killed my floppy drive I hadn't done that. Also, I don't run mine with batteries so it was never a possibility.

If you want to build hardware, I'd actually suggest replacing the NC200 system ROM. It's easily accessible via a hatch on the bottom. I've no idea what kind it is but you should be able to get a compatible EEPROM. That'd let you boot CP/M almost instantly from it; plus there'd be enough space left over for a ROM drive, if you wanted one. The only question is whether any of the hardware needs initialisation, such as the LCD controller.

Re your floppy drive: does it need a replacement belt? That's what happened to mine. I was trying to open it up to replace it when I removed the wrong bit.

theshinyknight commented 1 year ago

I see, so when you put to sleep the NC it is "rebooting" behind the scene and restoring the state if you have that option set.

I have experience with the NC100 used with ZCN, and that approach did work in terms of saving states, so I didn't realize that in fact what I saw was not a saved state.

I would love to build a ROM in hardware but I have no skills on that side; I can dabble with microcontrollers/SPI/I2C but that's the extent of what I can do. I was just thinking to push the code via UART port from the micro, as I would do on my USB to DB9 connection to get cpm started, but I would love a ROM that has that already in; maybe allowing to retain the NC OS side and the CPM and with space to have different disks for data and applications. Not sure how many people are in the NC community with enough skill and info to get the task done, but I suspect that there is a lot of missing parts that would make that task quite challenging.

About the drive: the belt was replaced by the previous owner, the drive seems to work but it is unable to either read disks formatted from Dos, nor is able to complete formatting, failing every time with a "disk damaged" error message (the disks are fine, I tested them on windows and other retro devices and they work fine. Did a troubleshooting on the connections between the drive and the main board and everything seems fine, so I guess the issue may be the heads at this point.