MSCP(Mass Storage Control Protocol) was invented by DEC to interface
CPU and "mass storage"(disks and tapes). The protocol was implemented
for MFM, DSSI, SDI, SCSI, and other hard disks. As MFM, DSSI and SDI
drives become hard to find, more and more people are considering MSCP
SCSI controllers. However, new MSCP SCSI controllers are very expensive
and there is demand for inexpensive, flexible, open source MSCP SCSI
controllers.
The MSCP protocol is very flexible and equally complicated,
thus a microcontroller is needed to process the protocol. I design and
build an MSCP SCSI controller based on 80C188XL microcontroller, 53C90A
SCSI controller, and ALTERA MAX II CPLD. The software is based on Bob
Supnik's SimH and the BSD unix source code.
The controller has a QBUS interface unit, a busmaster DMA unit, a
microprocesser, RAM, ROM, a SCSI controller, and software. The current
plan is with QBUS and SCSI. Possible future developments include to
integrate the SCSI controller, the serial port, and even the
microcontroller into CPLD/FPGA, and to extend support to UNIBUS, IDE,
etc.
Both Rev. 0 and Rev. 1 are working. Rev. 0 is built with TTL
logic and Xilinx CPLD. It is controlled by PC through ISA bus. Rev.1 is
built with Altera CPLD EPM1270 and 80C188XL microcontroller.
Status
I am working on Rev. 2. I re-designed the CPLD code and am cleaning
up the software.
Revision 1
REV. 1 has envolved into Rev. 1.2.
Facts,
Supports
The following DMA modes, single shot, burst mode, block mode, adaptive aggressive block mode.
Overlapped pipeline excution of MSCP commands
On board RS232 port for diagnostic purpose
Provides necessary functions to support the following features later
non-512Byte/block CDROMs
SCSI disconnect/reselect
TMSCP
Speed is faster than CMD CQD220 and slower than CQD220A
Write speed 1.2MB/s
Read speed 1.45MB/s
On board CPU bus is accessible so that you can
Run Simh on PC and access SCSI disk from within simh (programming needed)
Debug/develop the 80C188XL firmware on a PC
Use the board as 80C188XL single board computer
Control the board with your favorite CPU module
Development software
Borland Turbo C 2.01 (Free to download)
OpenWatcom C (Open Source)
Altera Quartus II Web Edition (Free to download, free to obtain license)
gEDA schematic editor, PCB (Open Source)
Paradigm Locator (not free). I have tried several free locators but none of them meets my needs.
EPROM/EEPROM programmer (not free)
The following issues may be resolved before version 2.0,
The support of MSCP commands "Erase" and "Compare" is not debugged
or enabled. NetBSD does not use those commands anyway. I have no
experience with other PDP11 or VAX operation systems. Depending on how
widely these functions are used by variate operation systems, I may or
may not enable them.
I am working on a small FIFO to speed up the transition of the MSCP
commands and reports. I will compare the speed of my board with some
commercial controllers when the FIFO is done.
May have trouble to detect some odd SCSI HD's. This is totally a software issue and I expect users to resolve this problem.
Revision 0
Rev. 0 features
The r/w speed is slow, around 53kB/s.
The reasons are, first, the direct link between QBUS and SCSI
is not enabled, so that data passes ISA bus twice; second, I use 8 bit
mode of the ISA bus; third, the size of data I move each time is only
1KB. They will all be corrected in Rev. 1.
Tests
In the following tests, VAX3900 talks to the host
computer (386 16MHz with ISA bus) through the MSCP SCSI controller, and
the host computer talks to the SCSI HD and CDROM drives through the
53C90A chip on the controller.
The SA register bug. It was caused by a hardware design flaw. I found a software work_around. I corrected it in Rev. 1.
The
reset bug. The hardware or software is not properly reset when VAX
aborts some activities abnormally. For example, "shutdown -r now" can
not bring up the system without resetting the controller program. The
reason was that I did not monitor the QBUS QINIT line.
Tips
To install NetBSD/vax 1.5.2, download the vaxcd.iso from
a NetBSD mirror site. Burn the image to a blank CD. Place the CD in the
CDROM (ra1 as seen by vax). Run the PC program. Then turn on vax, run
"boot dua1". Install to ra0. When the installer asks for binary
directory, type 'Ctrl-Z' to suspend the installer. Run "mount -t cd9660
/dev/ra1a /mnt2". Type "fg" to resume. Tell the installer the directory
is "/mnt2/vax/binary/sets". After rebooting, run "boot dua0".
To
do busmaster DMA test to the main memory, I need to enable the vax
memory to Q22bus mapping first. The only thing I need to do is to run
"Deposit /P/W 20001f40 0020" on my vax3900 to set the LM EAE bit of the
interprocessor communication register after power up.
SA and IP write/read are all word aligned, single mode, and in I/O
space. The target address of my card is 1772150/1772152, or 20001468/2000146A.
Compile
NetBSD/vax kernel. Burn syssrc.tar to a CDROM. place the CDROM in CDROM
drive ID=1. "boot dua0", "mount -t cd9660 /dev/ra1a /mnt", "cd/", "tar
xvf /mnt/syssrc.tar", "cd /usr/src/sys/arch/vax/conf", "config
GENERIC", "cd ../compile/GENERIC", "make depend", "make". Wait 8 hours
(on VAX3900). "mv /netbsd /netbsd.old", "cp netbsd /.", "shutdown -h
now". Restart the PC program(because of the reset bug). "boot dua0"
Altera Quartus II version 5 has a bug. When it compiles for the MAXII CPLD, the follow code might not be compiled correctly:
If A='0' then
B<='1';
elsif CLOCK'event and CLOCK='1' then
B<= whatever
endif
It failed to set B<='1'when A='0'. The tip is to always reset registers to '0' other than '1'.
NetBSD will override the disk size information provided by the controller with disk size information written on disk.
Set 8237 DMA counter to N-1 but set 80C188XL DMA counter to N.
Engineering Package
This section is under construction. I will release the source code of
everything within 1 year after I announce the availableness of the
board.
FAQ
1. Why SCSI other than IDE?
Because I want to avoid bad block forwarding. IDE is not too difficult if people choose to build their own controllers.
2. UNIBUS plan? IDE plan?
I have no such plans at this point.
3. Why microcontroller with 8 bit bus other than that with 16 bit?
This is not critical. There is a direct link between SCSI controller
and DMA busmaster thus DMA speed is not affected (only overhead speed
is affected).
4. What storage devices are supported?
SCSI 1 & 2 disk drives and CDROM drives are currently
supported. Supported CDROM drives include those with 512 bytes/block,
and those that can be set to 512 bytes/block mode. CDROM drivers with
2048 or other number of bytes/block might be supported (depending on my
time). However, people will be able to add the support by themselves if
they like programming.
5. Why 53C90A? Hard to found.
53C94 and 53C96 are supported too.
6. Raw disk or with file system?
Raw disk at this point to simplify the design. User can add file
system to the disk and treat the PDP11/VAX disk image as an ordinary
file if they like. They can even load firmware from the file system.
Those are possible with the Rev. 1 hardware but programming is needed.
Speed might be affected (because of smaller DMA blocks).
7. OS on board?
With Rev. 0, I always have an OS (DOS). With Rev. 1, it is possible with the hardware. Programming is needed.
8. What is the serial port for?
Sending out diagnostic information. People can use the port to
configure the board in the future, if they add the code and enable
flash memory support in the EPM1270 CPLD. This is possible with the
Rev. 1 hardware but programming is needed.
9. Q22 or Q18?
Q22 currently. To support Q18, I don't know whether the software needs to be altered or not.