PDA

View Full Version : My SD Card Hard Drive Emulator



codeman
August 24th, 2014, 04:18 PM
My Adapter emulates the WD1002 but plugs into the 50 pin expansion header . Does not need the extra board like in the Kaypro 10.
Using only a STM32F4 MCU and a SD card .
Works with TurboROM and stock Kaypro ROM have to make a few fixes for KayPLUS ROM.
right now its running off a ST dev board going to do a full layout in the next few days .
some pics running on my Kaypro 1
20099
20098
ken

Chuck(G)
August 24th, 2014, 05:52 PM
Nice job! I suspect that this will appeal to the TRS-80 crowd as well. Perhaps some of the other CP/M systems, such as Televideo.

This requires no CBIOS changes, right? So if I wanted to run Xenix on my TRS-80 Model 16, this would be perfect...

codeman
August 24th, 2014, 06:03 PM
No bios changes support all the WD1002 commands . 4 drive images also .
i have the TRS-80 connector on there just have not set it up yet .

ken

codeman
August 24th, 2014, 06:46 PM
Have it booting with the KayPLUS Rom now .
40mb image with 6 drives .
20104
Really need a better camera .
ken

jaquinn
August 25th, 2014, 01:48 AM
Nice. Is this a clean sheet design or did you port the FreHD code from the PIC to the STM32F4?

codeman
August 25th, 2014, 05:36 AM
Completely new only reference was WD Data Sheets.
ken

deramp5113
August 25th, 2014, 10:14 AM
Nice work! I may need to do something like this one day for my Kaypro 10.

Mike

codeman
August 30th, 2014, 09:57 PM
Also the images are compatible with CPMTOOLS .

Got all the bugs ironed out using the KayPlus BIOS .
20179

Created a 40mb drive under TurboROM
20180

Started the PCB Design today .
should turn out to be 3"x3" so same as a post-it note .
Will also make a Z80 shim board for systems that done have the 50pin header .

20181
Now on to the TRS-80 :)
ken

tingo
August 31st, 2014, 02:47 PM
Nice! Are you using FAT as the filesystem of the card? (you talk about images...)

codeman
August 31st, 2014, 03:06 PM
Yes it uses Fat Files as drive images .
So you an get a lot of drive images on a 2gb sd card .
There is a simple boot.txt file on the sd card that tells the controller what files to use where .

#
#
#boot.txt
#image filename, sector size, cylinders, heads, sectors per track
drive0 = hd0.img, 1024, 305, 4, 9
drive1 = turboromhd1.img, 1024, 305, 4, 9
drive2 = turboromhd2.img, 1024, 305, 4, 9
drive3 = hd3.img, 1024, 305, 4, 9



ken

tingo
August 31st, 2014, 03:08 PM
Very nice!
I really like systems which are made so that they are easy and simple to configure.
Great job!

codeman
August 31st, 2014, 03:31 PM
Working on a utility running under CP/M where you can create new images and read write files from the SD Card to CP/M.
ken

codeman
September 7th, 2014, 11:04 AM
Finalized the board . just need to double check it all and will have some prototypes made about 10 or so .
Will be looking for about 8 beta testers .
the Kaypro and WD1002 interface is very solid . still working on the TRS-80 side .
So if you would like to help and beta test PM me with what hardware you have to test it on.
Also did a adapter to plug in between the Z80 so it can be used on the Kaypro 83's just need the TurboROM image to test .
If anyone has the TurboROM for the 83's send me a bin file .
20337
ken

JonB
September 8th, 2014, 01:18 AM
Would this work on an Intertec Superbrain, by any chance?

codeman
September 9th, 2014, 06:39 AM
Sure you could make a cable to connect it to the Intertec Superbrain, but you would have to build a bios with support for it .
Look here http://www.retroarchive.org/maslin/disks/kaypro/ for k10tkit.zip its the source for the Kaypro10 bios .
its well commented and will give you an idea of what you need to do to boot .
ken

JonB
September 10th, 2014, 02:23 AM
I guess that'll be KBIOS.MAC, which appears to have all the disk I/O stuff in it (at first glance). Not sure I have the knowledge to work it out - and I haven't found a commented listing of the Superbrain BIOS, so I'd be going by a disassembly of it (even trickier..). That said, loading the boot code does not seem that difficult, looking at it. Just seek to track 0 sector 0 and grab the contents into memory, then jump to it. But I'm a novice when it comes to this stuff..

Back to the hardware - I assume with your Z80 shim card you would plug the shim into the Z80 socket, then the Z80 and HDD emulator into the shim? Sounds pretty good to me - how about configuring the IO port addresses (I assume the WD1002 interface sits on one or more Z80 I/O ports), can it be done? I would have to adjust this for the Superbrain before attempting to alter the BIOS. Failing that, a cable from the Z-80 expansion port (which is internal on the Superbrain - can you post a pinout of the WD1002 port on the card (I assume I'd use that) please?

lowen
September 10th, 2014, 06:12 AM
While the Superbrain is a bit different from what I'm going to describe to you, you can use the code I'm going to mention as a template of sorts of what a WD1000-compatible bootloader would look like.

First, the TRS-80 model 4p has code to boot from WD1000; see http://fjkraan.home.xs4all.nl/comp/trs80-4p/bootRom.asm for a commented disassembly of the 4P boot ROM. The disk I/O routines start at location 08B5H. On the TRS-80 4P, the WD1000 registers start at port C8H (C0H-C7H are for other hardware on the TRS-80-specific boards) and run through CFH, so look through this code for OUT's to those ports and IN's from those ports. The 4P is an interrupt mode 1 machine, and this is how disk I/O is done on such a machine.

Likewise, the TRS-80 Models 2 and 12 use the WD1000; see http://fjkraan.home.xs4all.nl/comp/trs80m2/trs80m2boot.zip for a zip file of a commented boot ROM 're-engineering' by Eric Smith for the M2 and M12, in several versions. The TRS-80 Models 2, 12, 16, 16B, and Tandy 6000 are interrupt mode 2 machines with the typical Z80 chipset of Z80DMA, Z80PIO, and Z80CTC chips, so this will give you an example of HDC I/O in an IM2 setting.

While none of this is Superbrain-specific, it should give you a couple of good examples of how a Z80 machine (capable of booting CP/M, incidentally, as well as the Tandy-proprietary TRSDOS and the LSI/Misosys LS-DOS operating systems) programs and uses a WD1002-05 (or in the case of the Tandys, the WD1000-TB1) for booting.

JonB
September 10th, 2014, 06:27 AM
Thanks for that; I'm actually fitting an "El Cheapo" IDE interface to my Model IV when it arrives and I'd read all that thread (especially the stuff about the drivers). Which makes me wonder if it wouldn't be easier using one of those on the Superbrain; unless one of the Superbrain HDD BIOSes already has code for the WD1002 controller chip. I'm not able to ascertain that right now, because Superbrain information is sparse on the web, but I am sure the Intertec built-in HDD solution uses the S100 adapter and a HDD card of unknown type (I also believe you lose a floppy drive to mount the Winchester disk).

lowen
September 10th, 2014, 06:45 AM
A bit more info, including photos, of the WD1002-05 board is at http://fjkraan.home.xs4all.nl/comp/wd1002/index.html

A photo of the WD100-TB1 can be found on http://fjkraan.home.xs4all.nl/comp/trs80m2/ModelIIBusCardZoo.html under the heading 'WD1010-based hard disk controller #3' (and I echo the thanks to Ian Mavric for the photo). The difference, again, is that the -TB1 implements the Tandy-specific write protect and presence registers that the -05 does not (as mentioned in the Cheap-O IDE thread that I've also read through.....).

And the reason the El Cheapo interface works at all is that the original IBM PC AT hard disk controller used essentially the same register set and mappings as the WD1002-05 (and the upper eight ports of the WD1000-TB1, and even fairly close to Western Digital's 8X300 CPU emulation boards prior to that). The IDE/ATA drives then takes the same software interface.

This project that codeman is doing is more akin to FreHD than to the Cheapo IDE, in that the disk images are stored as files, instead of exposing the raw device to the host computer (and I like that a lot, myself). A Z80 shim would make it possible to take a TRS-80 Model 12 without card cage and get it to boot from hard disk (a new boot ROM and software drivers would be needed, since the Model 12's hard disk interface has more than just an interface to the WD1000-TB1 on it).

lowen
September 10th, 2014, 01:44 PM
...because Superbrain information is sparse on the web, but I am sure the Intertec built-in HDD solution uses the S100 adapter and a HDD card of unknown type (I also believe you lose a floppy drive to mount the Winchester disk).

You can find some more information in the Don Maslin archives; see: http://www.gaby.de/sysdisk.htm (Thanks to Al Kossow for doing the restoration). The archive is 215MB, but I see in there some Intertec Superbrain files.

jharre
September 10th, 2014, 07:19 PM
Hmmm, wonder if this might work for my TeleVideo TS-802 that won't boot from floppy. Hadn't thought about trying to boot it from a 'hard drive'. It might need to work shimmed under the Z80. What a cool idea!

codeman
September 20th, 2014, 10:05 AM
Have the TRS-80 Model 4 up and going now .
setup as 2 15mb drives so 4 drives in cp/m .

20550

ken

lowen
September 20th, 2014, 11:41 AM
Very cool. Looking forward to seeing this available, and trying out LS-DOS 6 on it on the TRS-80 4P......

giobbi
October 14th, 2014, 06:04 AM
Cool, really!
Does/Will it work with Osborne-1 too?

shirsch
November 30th, 2014, 10:24 AM
Any further news? I'm very interested in building one of these.

cellarcat
November 18th, 2015, 07:19 PM
I see it has been almost exactly a year since the last post. This is a fascinating project. Have you got it to the point where boards might be available or enough info to build one?

frankras
March 25th, 2018, 04:11 AM
Hi Ken

I was looking for a way to replace the WD1002-HD0 and disk for my home made CP/M machine, the disk itself is not working anymore. Then I saw Your project :-) it is exactly what I am looking for.

I know this thread is a bit old - just hope You still look at messages from the site. I would like to buy one of those converters - if You want to sell one ?


Best regards
Frank

JonB
March 25th, 2018, 10:50 PM
At the risk of shamelessly plugging..

..you might try one of these:

http://www.cpcwiki.eu/index.php/UIDE_Universal_IDE_adapter_cards_for_Z-80_computers

SteveH
March 26th, 2018, 07:01 AM
Frank, I'm happy to say JonB's UIDE adapters work great, even in non PCW equipment. Here's a couple of link to my ancient CP/M computer with a UIDE 8-bit adapter installed.

http://www.cpcwiki.eu/forum/nc100-nc200-pcw-pda600/who-wants-ide-drives-on-the-pcw/msg143156/#msg143156

https://goo.gl/3GQTmN

It currently runs CP/M 2.2 with ZCPR and even autoboots from the UIDE.

JonB
March 28th, 2018, 04:41 AM
Steve's being a bit modest here - he wrote the drivers for his machine, which you'll have to do if you use a device like uIDE. However, I thought you'd not struggle with this as you said your CP/M machine was home made.

VERAULT
March 28th, 2018, 05:07 AM
My Adapter emulates the WD1002 but plugs into the 50 pin expansion header . Does not need the extra board like in the Kaypro 10.
Using only a STM32F4 MCU and a SD card .
Works with TurboROM and stock Kaypro ROM have to make a few fixes for KayPLUS ROM.
right now its running off a ST dev board going to do a full layout in the next few days .
some pics running on my Kaypro 1
20099
20098
ken

What versions of the kaypro will this work in? Will it work in my kaypro 4/84 with 50 pin header?