-
Notifications
You must be signed in to change notification settings - Fork 5
Home
This page seeks to collect information on RaSCSI and the Sharp X68000, for which RaSCSI was originally conceived to be used with. It has also been tested working on other Japanese home computer platforms such as Fujitsu FM TOWNS and NEC PC-98. This material is adapted from translations of the Japanese documentation that can be found under doc/.
RaSCSI was originally developed using the SCSI controller code of the X68000 emulator XM6 TypeG, and tested on a X68000 PRO with internal SASI and a genuine SCSI board, internal X68030 SCSI, and XVI Compact internal SCSI. It works also with Mach-2.
Other users have reported it working on a first gen X68000, ACE, EXPERT, XVI, PRO2, SUPER, etc. It is safe to say that it works well on the X68000 platform. The SCSI interface of a SUPER or later is recommended. Multiple SCSI interfaces in one system work well too.
RaSCSI support only SASI drives on the first gen X68000, ACE, EXPERT, PRO etc. Only cursory testing has been carried out on SxSI, so it is unknown if it is fully functional there. By the way, since parity is not used, it is not necessary to add a parity circuit.
In addition, it has been reported working on other Japanese retro computers such as the FM TOWNS series, and MSX (with MEGA-SCSI). The PC-98 platform is a mixed bag: It works with some SCSI boards, but not with others. The author tested it with a PC9821Ce with some success.
Human68k 3.02 is recommended to use all functions, because the Ethernet function and the remote drive function are provided only by the Human68k device driver. If you are using only SCSI storage, it is no problem to use NetBSD etc.
RaSCSI implements a virtual SCSI device called the Host Bridge in order to bridge the Raspberry Pi host system and the X68000. The Host Bridge together with the following X68000 specific drivers enables a range of features.
There are two special drivers for the X68000 that enable these features.
- RASDRV.SYS -- Host Drive driver
- RASETHER.SYS -- Ethernet driver
Provides equivalent networking functionality of a Neptune-X Ethernet adapter, which is an Ethernet box that's connected over the SCSI bus. It uses a TAP device on the Raspberry Pi to translate network traffic. Similar to Ether+.
It was developed while referencing Shi-MAD's ether_ne.sys ver0.03 +M01 +1 +L12 driver which itself is a modified version of the ether_ne.sys driver for the ISA bus bridge Ethernet adapter Neptune-X. Its use shall therefore be governed by the terms & conditions of those drivers.
It is also possible to use the original Neptune-X driver with RaSCSI.
Source code available at /~https://github.com/rdmark/RASCSI-X68k/tree/main/src/x68k/RASETHER
Provides a similar functionality as WindrvXM, which has become the de-facto standard on X68000 emulators. This makes it possible to mount the Raspberry Pi file system as a remote drive by connecting the X68000 to the host using a Host Bridge device.
You can attach the Host Bridge device to RaSCSI just like any other device, either by passing 'bridge' as the file parameter, or using the 'scbr' device type.
sudo ./rascsi -ID6 bridge
Source code available at /~https://github.com/rdmark/RASCSI-X68k/tree/main/src/x68k/RASDRV
Similarly to rasctl for RaSCSI on the host side, a similar utility has been implemented in a Human68k executable called RASCTL.X which enables you to attach, detach, change media, set protection flags, stop rascsi, and shut down the Raspberry Pi from the X68000 system.
Usage is very similar to rasctl, so refer to its documentation.
The C source code can be found under /~https://github.com/rdmark/RASCSI-X68k/tree/main/src/x68k/RASCTL
Initiator mode is the ability to control the SCSI device from the host. This enables you to dump and restore the data off of SCSI drives that are connected to the bus. Initiator mode can be used directly or through a connector board.
The Ethernet driver (RASETHER.SYS) attaches to the Bridge device to send and receive packets.
In the following example, the TAP interface on the Raspberry Pi is assigned IP address 192.168.68.1, while the X68000 is configured with 192.168.68.3.
RASETHER.SYS is simply a retooled version of the Neptune-X driver, so the usage is exactly the same. You need to configure the X68000 environment for network access, for which there are instructions elsewhere on the Web.
Below are excerpts from actual CONFIG.SYS and AUTOEXEC.BAT files:
[CONFIG.SYS excerpt]
PROCESS = 3 10 10
DEVICE = \NETWORK\RASETHER.SYS
[AUTOEXEC.BAT excerpt]
SET SYSROOT=A:/NETWORK/
SET temp=A:\
SET tmp=A:\
SET HOME=A:/NETWORK/ETC/
SET HOST=X68000
XIP.X
IFCONFIG.X lp0 up
IFCONFIG.X en0 192.168.68.3 netmask 255.255.255.0 up
INETDCONF.X +router 192.168.68.1 -rip
INETDCONF.X
The following options can be passed to the driver.
-tx [x is a number] : Specify a trap where x is a number between 0 and 6.
However, if the specified trap number is in use,
it will autodetect another available number starting at 0.
-n : Don't use trap with the API
Extended options for RASETHER
-px [x is a number] : Receive packet polling interval. 1 is default.
1 means a polling interval of about 16ms.
Max setting is 8. Each increment adds about 16ms to the interval.
-ix [x is a number] : The interrupt approach that polling will use.
Default is 0 which uses MFP FPIP interrupt (V-DISP).
1 means Timer-A interrupt.
We will be using a TAP interface, so we need to enable it. It may already be enabled on your system by default. Check for the existence of /dev/net/tun on your system.
Create the TAP interface like this, for example:
[Add to your startup script, such as /etc/rc.local]
ip tuntap add ras0 mode tap user root
ip link set ras0 up
ifconfig ras0 inet 192.168.68.1/8 up
route add -net 192.168.68.0 netmask 255.255.255.0 dev ras0
This enables a network connection between the Raspberry Pi on 192.168.68.1 and X68000 on 192.168.68.3.
Additional configuration may be required depending on your environment. In the case of WiFi, a simple network bridge is not possible, so using packet forwarding and NAT becomes mandatory.
RaSCSI provides similar functionality to Windrv and WindrvXM that are commonly used with X68000 emulators XM6/XM6 Kai/TypeG. Using the RASDRV.SYS driver you can mount and access the Raspberry Pi file system from your X68000 and carry out any file operations.
Registering the device driver is simple. F.e. add this to latter part of CONFIG.SYS:
DEVICE = \SYS\RASDRV.SYS
By default, the Raspberry Pi's root directory gets mounted. When the device driver gets loaded, it will indicate which drive is getting mounted. To mount other directories aside from root, specify the the file system path. For instance, to mount /home/pi and /home/pi/data :
DEVICE = \SYS\RASDRV.SYS /home/pi/app /home/pi/data
By specifying multiple directories, each of them gets mounted as a separate drive.
If you're using SUSIE, please configure RASDRV.SYS to be loaded before SUSIE. It has been reported that it does not get detected if loaded afterwards.
For other options, refer to the documentation for WindrvXM.
The X68000 can use generic SCSI hard drive images, MO and CD-ROM images, which are documented elsewhere on this wiki. It also uses SASI images that are more or less unique to this platform.
Disk images that were created by the X68000 emulator XM6 TypeG can be mounted by RaSCSI and used on a real X68000.
SASI images use the 'hdf' file extension. Recommended image sizes are 10441728 bytes, 20748288 bytes, or 41496576 bytes (corresponding to 10MB / 20MB / 40MB hard drives). You can also mount images between 10M to 512MB in size, as long as they are multiples of 256 bytes.
SASI support was introduced in RaSCSI 1.24, and as of RaSCSI version 1.46, a unique disk image size of 22437888 bytes will be recognized as a special 20MB drive to be used only with MZ-2500/MZ-2800/MZ-1F23 systems (unique block size of 1024).
MOS file format (extension '.mos'). On the X68000 platform, the MO image size should be one of the following 4 types.
- 128MB type (127,398,912 bytes)
- 230MB type (228,518,400 bytes)
- 540MB type (533,248,000 bytes)
- 640MB type (635,600,896 bytes)
Note that on other platforms, the size / block size of MO drives are not limited to these values.
ISO file format (extension '.iso', ISO9660 standard). Mode 1 (2048 bytes/sector) supports both files that store only data and files that are recorded in RAW format.
RaSCSI itself is an offshoot of the X68000 emulator known as XM6 TypeG. As such, you can use the disk image creation functionality under the "Tools" menu of XM6 TypeG. In addition, by following the file format specifications outlined elsewhere, you can create an empty image file with a command like this:
dd if=/dev/zero of=HARDDISK.HDS bs=512 count=204800
In SCSI, 5V is divided into 220Ω and 330Ω at the TTL level (in the case of a passive terminator), and a condition in which a voltage of less than 3V is applied to each signal line is in a steady state (the signal is negated). When the initiator side or the target side tries to assert the signal (=0V), a total current of 5000 / 220 * 2 = 45mA flows from the terminators on both ends (see the data sheet for the X68000 SCSI controller MB89352). As you can see, the sink current is Iol 48mA.
The Raspberry Pi GPIO cannot absorb such a large sink current. To make an electrically safe connection, it is necessary to make a conversion board with a general-purpose logic IC. A general-purpose logic IC that can withstand a sink current of 48 mA uses an open collector such as 74LS06 or 07 with a high power type.
The author performed basic SCSI direction control with 74HC541 x3, 74HC126 x1, 74HC04 x1 and further assembled a circuit for driving the bus using 74LS07 x3, and confirmed that it operated without problems. If you use 74LS641-1 which is a derivative of 74LS641, the circuit will be simpler. Unlike the original product, the sink current is compatible with 48mA, so there is no need to use the 74LS07. But availability of this IC is not so good.
This is the interface board schematic to use with SCSI target mode, your only use cases are hard drives, CD-ROM, and magneto-optical drives, this is the right choice for building your board. This is the solution that uses the least GPIO pins.
Use with the RaSCSI software compiled with the STANDARD profile.
This is the interface board schematic to use with SCSI target mode and initiator mode. All four 74LS641-1 ICs are used to control the direction of the SCSI bus, so all except 3 GPIO pins are used.
When customizing the pin assignment, for each of PIN_TAD, PIN_IND, PIN_DTD, configure 6, 7, 8 at compile time. Refer to the pin assignment customization section below.
The GPIO pin assignment logic is defined in gpiobus.h.
Example customization definitions for two variants of the original RaSCSI connector board, Aibom and GAMERnium, are available in the source code.
- RaSCSI startup message:
- CONNECT_DESC
- Signal control mode selection:
- SIGNAL_CONTROL_MODE
0: SCSI Logic Specification
The original interface board using 74LS641-1
Assert: 0V
Negate: Open connector output (disconnected from the bus)
1: Active-low Specification (Active-low -> SCSI logic interface board)
At the time of writing, this interface board does not exist.
Assert: 0V -> (CONVERT) -> 0V
Negate: 3.3V -> (CONVERT) -> Open connector output
2: Active-high Specification (Active-high -> SCSI logic interface board)
RaSCSI Adapter Rev.C @132sync, etc.
Assert: 3.3V -> (CONVERT) -> 0V
Negate: 0V -> (CONVERT) -> Open connector output
- PIN_ACT: The pin that indicates the state of processing a SCSI command
- PIN_ENB: The pin that indicates validity from startup to shutdown
- PIN_TAD: The pin that indicates the I/O direction of target signals (BSY, IO, CD, MSG, REG)
- PIN_IND: The pin that indicates the I/O direction of initiator signals (SEL, ATN, RST, ACK)
- PIN_DTD: The pin that indicates the I/O direction of data signals (DT0...DT7, DP)
Defined as: 0V: FALSE, 3.3V: TRUE
- ACT_ON: PIN_ACT signal logic
- ENB_ON: PIN_ENB signal logic
- TAD_IN: PIN_TAD input logic
- IND_IN: PIN_ENB input logic
- DTD_IN: PIN_ENB input logic
PIN_DT0 ~ PIN_SEL are the SCSI signal pins.
Warning: Direct connection is risky due to the difference in electrical specifications between GPIO and SCSI. A conversion board must be used to make the electrically safe connection. If you don't understand this risk, give up. Your X68000 is probably ok, but the Raspberry Pi is unpredictable. The unexpected load is the sink current explained in the Interface Board section. If it is directly connected, there is no terminator, so a sink current of about 22mA will be generated, but since it exceeds the maximum drive capacity of GPIO, the sink current is too small to drive to around 0V.
At the same time, the author been running RaSCSI for several months in this configuration, but so far it has not failed. And since it is the Raspberry Pi that is in danger, you may consider it a consumable item.
Raspberry Pi (GPIO) <=> Connection (conversion) cable <=> (external SCSI connector) X68000
You gain the most stability if you pull out as many GND as possible on the SCSI connector side (8 if possible) and connect it to the GND on the Raspberry Pi side.
The material used was a 40-pin MIL connector, Centronics 50-pin male, and flat cable. It is recommended to keep the flat cable within 30 cm (the length is longer than this and there is no actual result). The SCSI connector will be half size male (ribbon type) for X68030 and XVI Compact, and full size male for other SCSI machines. You can also use a conversion adapter as shown in the photo. GPIO pins aren't lined up neatly, and I'm using different pins to make the app, so I'm worried about which way to adjust the connection. I usually soldered the SCSI connector side and crimped while checking the connections one by one on the MIL side.
- The X68000 can use all SCSI IDs 0-7 freely. However, normally when the computer itself is the initiator, it gets assigned one of the SCSI IDs, so in reality only up to 7 devices can be connected.
- It is possible to boot the X68000 system from a RaSCSI drive.
- Performance tests by DSKBENCH suggests that R/W performance is at least at par with a physical drive (at least SCSI1.)
RaSCSI supports emulation of several hard drive image formats specifically for the NEC PC-98 platform.
The image file extension 'hdn' enables emulation of a genuine NEC 55 Board (PC-9801-55) hard drive for the PC-98 platform. The difference lies with data in responses to INQUIRY as well as MODE SENSE size.
The image file extensions 'hdi' and 'nhd' simulates the SCSI proprietary hard disk image formats of PC-98 emulators Anex86 and T98Next, respectively. They contain special boot sectors to control how a PC-98 system reads data on the disk. The hdi format seems to be commonly used as a container image for self-booting PC-98 software, in lieu of regular floppy images to bypass floppy switching. As for nhd, the T98Next emulation software itself is capable of generating this image format on the fly.