SD-Cart JR is a PCjr cartridge which makes it possible to use MMC (or compatible) memory cards under DOS.
- Supports MMC and compatible cards (2GB SD cards or smaller)
- Easy to use. Just add sdcart.sys to your config.sys and the cards you insert will
be accessible as drive c: (or another letter if you have a hard drive)
- Cards are treated as removable media and can be removed or replaced without rebooting.
- An experimental boot ROM is also available, making it possible to start your system using a memory
card as if it were a hard drive.
Current performance: Reads at 33 kB/s, writes at 22 kB/s. Already faster than floppies (10 kB/s), but there
is still room for improvement. The driver may gain a few kB/s in performance in the future.
Quite a few signals from the PCjr BUS are available on the cartridge slot, but there is no write signal. Still,
this does not mean the cartridge slot cannot send information, since the address being read is in itself outgoing
data! So I divided the cartridge memory space and arranged so that reading from certain address ranges would have
specific side effects. (Select/Deselect the card, load a value to transmit, etc).
Since the cards communicate serially (SPI), I used a pair of shift registers (one for transmitting to the card and
another for receiving) to performe parallel/serial conversion in the hope of getting better performance by
exchanging full bytes with the PCjr...
The cartridge uses the CS2 signal from the slot and is therefore visible from D0000 to D7FFF.
- Reading from D6000-D60FF loads the 74ls165 shift register with next byte to be transmitted. The value
loaded corresponds to address bits A0-A7. The read returns the last byte received by the other shift
register (the 74ls164).
- Reading from anywhere in the D6100-D61FF range generates a clock pulse which causes one bit to be shifted
to/from the shift registers and the card.
- Reading from D6200 deselects the card.
- Reading from D6300 selects the card.
- The optional ROM is accessble from D0000 to D5FFF (24 kB)
Schematic, page 1 - PCjr Cartridge, address decoding and ROM
Schematic, page 2 - Shift Registers, card interface (voltage regulator and level converters)
Before making a PCB, I tested everything on a breadboard, but not entirely without soldering. To access the
cartridge signals, I soldered wires between one of my cartridge PCBs
and the DIP components on the breadboad. For the card slot, I used a small Adafruit PCB which came with its own
regulator, level converter and microsd slot.
My test setup
Wires soldered to a cartridge PCB
Once I got everything working correctly, I designed an equivalent PCB, but changed a few things.
First, instead of using an Adafruit microsd module, I decided to use a large card slot for MMC and "normal" SD cards
instead of microsd only. Considering the practical limits regarding disk space (i.e, What DOS supports and if one does not want to wait an
eternity when available disk space is being computed), I wanted to support and use old low capacity cards from my parts
bin instead of modern cards with excessively large capacities.
Next, I also wanted the circuit to fit in a cartridge shell, so I used surface mount components to save space. The resulting
PCB can fit in a cartridge shell, provided you cut some plastic here and there...
And the final addition, a footprint for installing a ROM for booting directly on the card, as if it were a hard drive.
My requirements for the software were:
- I want to run stuff on the card, so its contents must be accessible as if it were a floppy or hard drive. In other words, it must
have a drive letter, such as c:
- Moving the card to another (modern) machine to exchange files with my PCjr must be possible.
- I would like to be able to boot on the card, as if it were a hard drive, without using floppies.
For the second requirement above, it was easy. Memory cards are normally partionned like hard disks are,
using a partition table in the MBR, and normally the first (and only) partition covers all the available
spacce. And this partition normally contains a FAT (FAT12, FAT16, FAT32..) file system, depending
on the available space. Very standard and well supported by DOS, Linux, Windows, Mac OS... Still, some limitations
must be considered, such as what your PCjr DOS version supports. For instance, DOS 2.10 does not know FAT16, DOS 3.3 does
not support FAT16B... Creating a smaller partition and reformatting may be necessary.
The sdcart.sys device driver
I coded a simple device driver for DOS which scans the card to find the first partition and renders it available as a
DOS drive. Installation is a simple matter of adding
The card contents will be made available through the first free drive letter at the time the driver was installed. Changing
the card without restarting is supported. The driver detects removed or replaced cards and lets DOS know about it.
If you already have a hard drive, possibly jrIDE
, or do not
wish to boot on a card (reqirement 3), the sdcard.txt device driver is all you need.
System booted on an 64MB MMC card
I also created a Boot ROM for PCjr which replaces int 13h (The BIOS disk services) to make it possible to use a card
for booting as if it were a hard drive. When using this ROM, sdcard.sys is not necessary, DOS supports the card
as a hard drive. Fdisk and format can even be used normally.
At the moment, this ROM is experimental and incomplete, but still functional. Current implementation:
- The reported disk geometry (Int 13h AH=08h) is hardcoded (16 heads, 63 sectors per track, 142 cylinders)
instead of being adjusted according to the card capacity. One must therefore take care when using fdisk on a
low capacity card, since fdisk may offer to create a partition larger than the card!
- Also implemented: Int13h AH=00(reset), 01(get status), 02(read sectors), 03(write sectors), 05(format track)
- Does nothing: Int13h AH=04(verify), 18(set media type - likely not applicable anyway)
- All other AH values are not implemented. If they are encountered, a panic message will be displayed (please report this)
Also, since I do not have a jrIDE yet, I'm not sure if my boot ROM plays well with it. But I think it should, in theory
the card will be installed as secondary (81h) disk drive.
sdpart.com showing card informations
Fdisk does not support devices accessed trough a drivers such as sdcart.sys, and therefore cannot be used
to display partition information. Memory cards also contain additional data stored in registers (such as CID
and CSD) including the manufacturer, model and serial numbers...
The sdpart.com tool can display and partly decodes the contents of those registers and show how
a card is partitioned. There is also basic functionality for creating a new MBR and a partition up to 32M. The
name "sdpart" implies that this should be a full partitioning tool for memory cards. In the long run it may
become so, but right now, it is extremely limited. Still, it is a good tool to test if a card is compatible or
it may help understand why things are not working.
The format command included with DOS has a similar limitation in that it cannot format the sdcart.sys drive. Maybe
one day I will write an sdformat tool, but meanwhile cards must be formatted under another OS, or using the
November 17, 2020 (Tuesday)
sdcjr01.zip (9.8 KB)
Ready to use, tested PCBs are available from my online store:
I cannot be held responsible for any damages that could occur to you
or your equipment while following the procedures present on this page.
Also, I GIVE ABSOLUTELY NO WARRANTY on the correctness and usability
of the informations on this page. Please note, however, that the procedures
above have worked in my case without any damages or problems.
Now you cannot say that I did not warn you :)