Dumas - USB + Ethernet + mapped RAM for MSX computers

DUMAS

USB + Ethernet + mapped RAM for MSX computers

[ En español aquí ]   [ Back to Konamiman's MSX page ]

Hardware design by Daniel Berdugo - dberdugo1 (AT) yahoo (DOT) es
Software & this web by Néstor Soriano - konamiman (AT) konamiman (DOT) com


Welcome to the Dumas project page. Dumas is (will be) a combo cartridge that allows any MSX computer to use USB devices and to be connected to an Ethernet network, providing also 512KBytes of standard mapped RAM.

This page provides information about Dumas features, especially the USB controller, which is the most complex component. If you have any question not answered in this page, please feel free to ask us at any of the e-mail addresses shown above.


General information about Dumas

What is Dumas?

Dumas is a cartridge for MSX computers that implements three components:

  • USB 1.1 host controller, which allows the usage of USB devices. It is intended mainly for storage devices, but any other type of device can be used if the appropriate software is written.
  • Ethernet controller, which allows connection to an Ethernet network or an ADSL router. TCP/IP software will be supplied (InterNestor Lite).
  • RAM expansion, 512K of standard mapped RAM which require no special software to work.

How can three components work in one single cartridge?

Internally, Dumas implements slot expander circuitry, so what the MSX sees when Dumas is connected is actually three different cartridges, each in one sepparate subslot. This implies that Dumas must be plugged in a primary (not expanded) slot.

Is there any scheduled release date or price for Dumas?

Not yet, as both software and hardware development are complex and time-consuming tasks. All we can say at this moment is that the project advances and a lot of work has been already done; for example, most of the USBorne features explained below have been already implemented. But there is still a lot of work to do.

How will be Dumas packaged? Will it have a case?

Dumas will be delivered with professional-quality case, package and user manual, as well as with a diskette containing utility software.

Why the name Dumas?

Alexandre Dumas was the author of the novel The Three Musketeers. The motto of the musketeers was one for all and all for one, which reflects the main idea beyond the design of the cartridge.

[ Top ]


USBorne

USBorne is the name of the USB controller integrated in Dumas. This section provides some details about the main features and behavior of this controller.

Features overview

USborne is an USB 1.1 host controller. This means that it provides the MSX with the ability to manage USB 1.1 compliant devices. Note that almost all USB 2.0 devices will work without problems on a USB 1.1 host, altough at a lower speed (maximum data transfer speed is 450Mbps for USB 2.0 and 12Mbps for USB 1.1).

USB 1.1 has been choosen instead of USB 2.0 mainly for two reasons. First, the USB host controller silicon used, choosen by its simplicity (in both hardware and software) and low price, supports USB 1.1 only. And second, USB 2.0 provides no real benefits to MSX computers compared to USB 1.1.

Any type of USB device can be used with USBorne, as long as appropriate software is written; USBorne BIOS provides user functions for generic communication and data exchange with any USB device. However, the primary intended use for USBorne is the massive storage. Therefore, its BIOS integrates the MSX-DOS 2 kernel and automatically recognizes and manages standard USB massive storage devices when they are plugged, so that the FAT12 partitions present in these devices (also FAT16 partitions if the FAT16 driver is installed) can be mapped to standard DOS drives. MegaSCSI style floppy disk emulation is also supported.

USBorne will provide one single physical USB port, therefore only one USB device can be plugged at once. However, this device can be an USB hub, so that additional devices can be plugged and used. This way, USBorne can handle up to seven USB devices at the same time. No additional hubs can be connected to the main hub, this is a design limitation intended to make the BIOS software simpler and faster.

USBorne is fully plug-and-play capable, this means that USB devices can be plugged and unplugged at any time and these changes will be detected and managed in real time (the computer will only hang for some tenths of seconds) by USBorne BIOS, as long as interrupts are enabled. Of course, it is not advisable to unplug storage devices while data transfer is in progress or there are open files, since data loss can occur.

Besides of the mentioned user functions, USBorne BIOS provides some extra utility applications available from the BASIC prompt via CALL commands. These applications allow the user to perform some basic tasks, like: display a list of connected devices, register or unregister devices (this will be explained later), assign disk partitions to DOS drives, partition a storage device, or even copy the DOS system files (MSXDOS2.SYS and COMMAND2.COM) to any DOS drive. Of course, standard disk applicatins that perform the same tasks will also be provided. But these built-in applications will be useful for people that has no disk drive on the computer, so that in any case it is possible to immediately get started with an USB storage device.

Device addresses and device registration

The USB protocol is similar to the SCSI protocol in that each device connected to the USB bus has an unique address assigned, which allows the host to select the device with which it communicates at a given moment. An USB address can be any number in the range 1-127; in the case of USBorne, devices have addresses in the range 1-7.

However there is an important difference. The address of a SCSI device is fixed in hardware (usually selectable via a switch or a jumper), so the user must be careful to not connect two devices with the same address to the SCSI bus. In the USB world, however, devices have no fixed address. Instead, the host dynamically assigns addresses to the devices when they are plugged. This means that the same device can have different addresses if it is unplugged and plugged again to the host.

For some tasks, however, it is desirable that a given device have a fixed address; for example for disk partition assigment. For this reason, USBorne allows the user to register devices. A registered device has, concerning to USBorne BIOS, some features that unregistered devices have not:

  • It will always have the same USB address, no matter how many times the device is unplugged or plugged.
  • If it is a storage device, assignments of disk partitions to DOS drives are persistent, that is, these assignments are stored in non-volatile memory and still existing the next time the computer is switched on.
  • Assignment of extended drives to disk image files (necessary for the disk emulation feature) is only possible on registered storage devices.

In summary, a registered storage device acts like a SCSI device in regard to device addresses and disk partitions. It is recommended to register those devices that will be used on a regular basis.

Storage devices and drive assignation

USBorne will automatically detect any standard storage device and manage it as such, allowing the user to assign existing disk partitions to DOS drives. A "standard storage device" is one that complies the USB Mass Storage Class Specification, and whose transport protocol is either Bulk-Only Transport or Control/Bulk/Interrupt Protocol. Most of the modern USB storage devices stick to these standards. Devices whose package says "Works on Windows/Linux without drivers" have many chances to be standard.

Unfortunately, as usual there are good devices, fair devices and completely crappy devices around there. Some USB storage devices claim to be standard, but violate the specifications in such a way that render them unusable by USBorne. Therefore it is impossible for us to guarantee that a given device will work with USBorne. However, in the future we will open a web page in which USBorne users will be able to tell their experiences with their particular devices, information that can be useful for other users.

On the other hand, there are devices that act the opposite way: they are standard but claim to be not (usually declaring a device type of "vendor-specific"). USBorne can manage these devices as long as they are registered as camouflaged storage devices. When a device is registered as such, USBorne will store in non-volatile memory the vendor and product identifiers, so that when it is plugged, it will be treated as a storage device even when it claims not to be so.

Regarding DOS drives, USBorne can have, as any other standard DiskROM, from zero to eight drives reserved for itself (this number is easily changeable). These drives can be on any of these states:

  1. Unassigned
  2. Reserved for dynamic assignment
  3. Assigned to a partition on an unregistered device
  4. Assigned to a partition on a registered device

Drive assignations can be easily changed by the user. An interisting state is reserved for dynamic assignment. It works as follows: when an unregistered storage device is plugged to USBorne, BIOS will automatically assign the first drive on this state to the first partition on the device (state 3). When the device is unplugged, the drive will become reserved for dynamic assignment (state 2) again. This is useful when temporarily plugging a device just to transfer some files; if these files are in the first partition of the device, the user needs not to bother about making the device visible on a drive.

By the way, the FAT16 driver made by Okei works in USBorne without need for any modification.

Floppy emulation

USBorne supports floppy disk emulation. This feature allows the execution of programs (usually games) that were released in disks that have no defined filesystem (data is retrieved by directly reading disk sectors), or do not work in MSX-DOS 2.

The method used is similar to the one used by MegaSCSI. The floppies to be emulated are dumped to disk image files in a DOS drive assigned to an USB storage device (the device must be registered). These image files are then assigned to extended drives by using a special program; USBorne provides 16 extended drives. The computer is then reset in emulation mode, DOS will boot with one single drive assigned to USBorne, and the contents of the first extended drive (that is, the contents of the disk image file assigned to that drive) will be read whenever DOS requests sector data. With two keystrokes it is possible to change the extended drive (the disk image file) from which data will be read.

Extended drives can be read or written (by direct sector access) at any time, even when the computer is not in floppy emulation mode. The standard DiskROM routine DSKIO has been extended so that when the drive number passed has bit 7 set, it means that it refers to an extended drive number.

Hubs and power topology

The term power topology refers to the way the electrical power is distributed on the USB bus. It is important because not all devices can be connected to all hubs, as will be explained now.

The USB bus works at a fixed voltage of 5V. Regarding to the power supply, a device can be bus-powered or self-powered. A bus-powered device takes all the power it needs from the USB bus, and is allowed to drain up to 500mA of current this way. A self-powered device has its own external power supply, and is allowed to drain up to 100mA from the USB bus (so that basic communication with the host is possible even when the power supply fails).

An USB hub is a device which has itself USB ports so that additional devices can be connected to the bus. According to the USB specification, hubs can be chained so that up to 127 devices can be connected simultaneously to the USB bus. In the case of USBorne, however, only one level is allowed: a hub can be connected to the USBorne root port, but no additional hubs can be connected to this hub. It has been designed this way to make BIOS simpler and faster. In addition, the maximum number of devices that USBorne BIOS will handle at once is seven (not including the hub itself). In the rare event that a hub with more than seven ports is connected to USBorne, only the first seven ports will be useable.

As any other USB device, hubs can be bus-powered or self-powered. There are important differences between both:

  • A bus-powered hub can have up to four ports, and can provide up to 100mA to each port.
  • A self-powered hub can theorically have up to 255 ports (but actually they have usually no more than seven ports), and can provide up to 500mA to each port.

This implies that bus-powered hubs have an important limitation: only self-powered devices can be connected to their ports (or bus-powered devices with an extremely low power consumption). This excludes devices like pendrives, small hard disks or multimedia card readers.

Note also, that the source of power of the hub is the MSX power source itself. A bus-powered hub will take 500mA from MSX, while a self-powered hub will take only 100mA.

For these reasons, here is a strong recommendation: Do NOT use bus-powered hubs with USBorne. Use only self-powered hubs.

On the other hand, there are self-powered hubs whose power supply does not provide the power required according to the number of ports of the hub (500mA per port). This causes that when all the ports are filled with bus-powered devices, some of them will not work.

Therefore, when buying a self-powered hub, look at its power supply and check that it complies the following rule: The power supply of a N-port hub must provide at least N/2 A of current to the hub. This means for example, 2A for a 4 port hub, and 3.5A for a 7 port hub. With lower current, the hub will not work properly when all its ports have devices plugged in. (Note that you should check this rule when buying a hub for your PC as well!)

BIOS function calls

USBorne BIOS provide function calls for programmers, so that they can write software than interacts with USB devices or with USBorne itself. These function calls allow programmers to:

  • Execute an USB device request over a control endpoint
  • Perform an USB data transfer over a bulk or interrupt endpoint
  • Execute an SCSI command on a storage device (USB storage devices are handled via SCSI commands)
  • Obtain an USB string descriptor in ASCII format (original format is unicode)
  • Reset an USB device
  • Modify the number of DOS drives reserved to USBorne
  • Set or cancel the floppy disk emulation mode
  • Obtain the physical start sector of a disk partition on an USB storage device
  • Set the device and start sector of a DOS or extended drive
  • Read or write sectors from a DOS or extended drive
  • Register or unregister a device, or a camouflaged storage device
  • Obtain various status information, like connected devices (with their available endpoints), detected storage devices, drives, registered devices, or state of the hub ports
  • Change the keys used to disable USBorne when botting, disable floppy emulation mode when booting, or changing the disk image to be accessed in emulation mode
  • Clear non-volatile memory (information about registered devices and drive assignments is lost)

These function calls can be used from any assembler program via a simple interslot call, or even from BASIC programs (see below).

BASIC extended commands

USBorne BIOS provides some BASIC extended commands (that is, commands that are used from the MSX BASIC prompt via the CALL command) that will hopefully be useful for the user. This section briefly explains these commands.

  • CALL USBBIOS(<registers data address>)

This command allow the usage of all the USBorne BIOS functions from BASIC programs. Registers data address is the address of a 8 byte memory area where the user must set the values of the Z80 registers that will be passed to the function (A is the function number; BC, DE, HL are parameters); the value of the registers after the call (A is an error code; BC, DE, HL are results) will be stored in the same memory area.

For example, the header of the function that retrieves a string descriptor from an USB device is as follows:

Function 4: Obtain an USB string descriptor, converting characters to ASCII
	    and trimming trailing and ending spaces
Input:  A  = 4
        E  = Device address
        C  = String descriptor index
        HL = Destination address for the string
Output: A  = Error code
        HL preserved
        BC = Lentgth of the string, not including the terminating zero

The following BASIC program will then retrieve and display an USB string descriptor:

10 CLEAR 200,&HC000: DEFINT A-Z: DIM R(4)
20 INPUT "Device address (1-7)";DA
30 INPUT "String index (1-255)";SI
40 R(0)=4	'Register A
50 R(1)=SI	'Registers BC
60 R(2)=DA	'Registers DE
70 R(3)=&HC000	'Registers HL
80 CALL USBBIOS(VARPTR(R(0)))
90 IF R(0)<>0 THEN PRINT "*** Error:";R(0): END
100 PRINT "String contents:"
110 FOR K=1 TO R(1): PRINT CHR$(PEEK(&HBFFF+K));: NEXT K: PRINT
  • CALL USBLIST

This command will show a summarized list of all the devices currently connected to USBorne. The same list appears when the computer boots. Only the device address and the manufacturer and product names (when they are available) are shown.


Sample output of CALL USBLIST


Note that if a device has not an assigned USB address, it will not appear on the list. A device may not have an address for a number of reasons; for more detailed information, use the USBMENU utility and check the state of the hub ports (see below).

  • CALL USBMENU

This command will start a program that allows the user to perform some useful maintenance tasks, namely:

  • Display a list of all connected USB devices. Device and product name, serial number, and device type are shown.
  • Register and unregister devices, as well as camouflaged storage devices. A list of the currently registered devices can also be displayed.
  • Reset a device.
  • Clear non-volatile memory.
  • Show the status of the hub ports.
  • Change DOS drives assignations.

Screenshot of USBMENU


  • CALL USBFDISK

This command will start a program that allows the user to physically format a storage device, and to create FAT12 and FAT16 partitions. This program is very simple, a more complex utility will be supplied on disk.


Screenshot of USBFDISK


  • CALL USBSYS(<drive letter>)

This command will create the system files COMMAND2.COM and MSXDOS2.SYS on the root directory of the specified drive (it needs not to be an USBorne drive, any existing drive can be specified). Used together with USBFDISK, can be useful to create a bootable disk partition.

[ Top ]


ObsoNET

ObsoNET is the name of the 10Base-T Ethernet controller integrated in Dumas. It allows to connect the MSX to an Ethernet network or to an ADSL router.

ObsoNET has its own verion of InterNestor Lite, a TCP/IP stack for MSX computers. A Telnet client and an FTP client are supplied as well, but additional software can be developed by using the user functions provided by the stack.

For those willing a lower-level access to the network, ObsoNET BIOS provides also some useful function calls, that allow the programmer to:

  • Initialize the card
  • Obtain the ROM version
  • Obtain the Ethernet address of the card
  • Test whether the card is plugged to a network or not
  • Activate or deactivate the card (when inactive, incoming packets will not be cached)
  • Configure the reception parameters (whether to accept or not multicast packets, broadcast packets, or any incoming packet)
  • Configure the multicast mask
  • Check if there are incoming packets available and obtain its size
  • Obtain or discard the oldest incoming packet
  • Send a packet, optionally waiting until the transmission finishes
  • Test the packet sending status (sending, sent OK, aborted due to excessive collisions or aborted due to carrier loss)

ObsoNET was manufactured as a standalone card in the past, but now it is exclusively one of the components of Dumas.


[ Top ]

[Last updated: 20-4-2005]