• Please review our updated Terms and Rules here

My SD Card Hard Drive Emulator

codeman

Experienced Member
Joined
Oct 18, 2011
Messages
146
Location
Huntington Beach CA
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
DSCF2283.jpg
DSCF2276.jpg
ken
 
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...
 
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
 
Also the images are compatible with CPMTOOLS .

Got all the bugs ironed out using the KayPlus BIOS .
IMG_1203.jpg

Created a 40mb drive under TurboROM
IMG_1202.jpg

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 .

sdboard.jpg
Now on to the TRS-80 :)
ken
 
Last edited:
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
 
Very nice!
I really like systems which are made so that they are easy and simple to configure.
Great job!
 
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 .
wd1002+.jpg
ken
 
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?
 
Last edited:
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.
 
Last edited:
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).
 
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).
 
Last edited:
...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.
 
Back
Top