Hack the M20
About this site
Transferring files and discs from/to the M20
The disc format used by the Olivetti M20 is rather peculiar. The differencies between the PCOS format and the MS-DOS one makes rather cumbersome to share file and data between the two systems. Anyway, in the mid-80 and more recently, several authors have written software able to read and write PCOS disks from a MS-DOS machine with a 360kB drive. For technical reasons, 1.2MB drives do not work.
rdm20.com and wrm20.com
The first solution is proposed by Dwight K. Elvey, who wrote two programs, rdm20.com and wrm20.com, which read and write a disk image of a 160kB and 320kB PCOS disk on a MS-DOS based computer. 640kB disks cannot be copied with this program. The main problem is that the PCOS formats the track 0 probably as 128bit/sector using MF. This is a format which can not be used by standard controllers present in IBM compatibles. The other tracks are formatted as 256bit/sector with MFM and can be treated by PC drives. Dwight's programs simply skip the first track, which is used somewhat by the M20 to identify a PCOS formatted disk, but does not contain data. To write a disk image with wrm20.com, you should use a new disk, but formatted by M20.
Data in disk images can be modified using the Chris Groessler's m20floppy utility, which is able to understand the PCOS filesystem, list and modify the content of an image.
Carlo Merlano describes his experiences in using Dwight's utilities:
The computer on which I could use the programs is an 8086 based assembly, with 640kB of RAM, a 8087 mathematical coprocessor (I believe it is unnecessary for this operation), a 720kB drive (A:), a 360kB drive, a MFM 20MB hard disk and MS-DOS version 3.3 plus. It is not a general rule, but often 360kB disk drives are black.
You can find the detailed description in Carlo's pages
PCOSFILE.BAS and FILE-DOS.BAS(Many thanks to Luigi Serrantoni and Ettore Migliori)
A second solution was a program written by Ettore Migliori in GWBASIC, which ran on a M24 with a 360kB disc drive and a 20MB hard disc, and was prepared in order to read PCOS 1.1a floppies. You can download it here. Ettore wrote two tools:
PCOSFILE.BAS reads a disc with a PCOS filesystem and create a file named PCOS.DAT, containing the disc image. The sector access of the disc was made using some lines in assembly language. The default drive is A: and all the work was inspired by Peter Norton's books. With the M24, the conversion was done in 20-25 minutes.
FILE-DOS.BAS is instead dedicated to the extraction of files contained in the disc image PCOS.DAT. As PCOS and MS-DOS used different file naming conventions, the auxiliary file PCOS.DIR is created, containing the PCOS file listing and other informations. For space and speed reason, the program can extract up to 112 files, which was the limit of old versions of MS-DOS.
Deleted files are extracted and their name begins with @.
The author has tried using this programs on newer machines. On a Pentium 200 PC, with a TX mainboard and with a 360kB floppy, he has confirmed the possibility to run these programs, using the Windows 95 DOS prompt and the GWBASIC 2.0. FILE-DOS.BAS is compatable with the QBASIC.EXE you can find in the installation CD of Windows 95. PCOSFILE.BAS does not work with QBASIC, as the assembler calling convention has changed from GWBASIC.
Transfer via RS232 and XMODEMThe Olivetti M20 has a RS232 interface mounted on the motherboard. RS232 is a standard used to set up a serial communication between a wide range of devices. A lot of modern PC include a RS232 interface, even if recently it becomes to be superseded in favor of USB. Anyway, cheap USB/RS232 adaptors are available for PC and Macintosh computer.
It is interesting to create a cable to use the interface to communicate with an another system. Expanded M20's could mount 2 additional RS232 interfaces, here we refer only to the first one.
This is the pinout of the serial connector you can see on the back of the M20 (the leftmost connector on the lower row). This image is taken from the Olivetti M20 hardware description manual.
This is the pinout of a DB9 connector you most likely can find on the back of your PC. This image has been found in the Internet thanks to google images :-)
Once you fabricated a cable, you need a program to implement a protocol to transfer files between the Olivetti M20 and another system. I choose the XMODEM, which is a simple transmission protocol in which the files are transmitted in 128 bytes long packets, with a checksum and a simple software handshake system.On the PC (or Macintosh) side, you have to find a program able to understand the XMODEM protocol. In my case, I used a laptop PC running Linux and Minicom, which is a menu driven terminal emulation program.
On the M20, I did not have a terminal emulation program, so I decided to write one of my own. Unfortunately, I was not able in BASIC to transfer correctly a bynary file (problems with the ASCII 0 character). Anyway, this method should work very well with BASIC files.
You first have to load and make resident the routines needed to use the serial port. To do this, type at the PCOS prompt:
You then must configure and open the serial port on the M20. I choose a 9600 baud, 8N1 protocol without XON/XOFF and hardware handshake and a buffer of 256 bytes. To select it, you should type on the PCOS prompt:
sc com:, 9600, none, 0,8,half,off,256
Remember to use the same port configuration on your PC running the XMODEM uploader. On an unexpanded M20, you should reconfigure the BASIC interpreter to use less memory to leave the space for the resident RS232 routines:
You can now start the Basic interpreter with:
and open the communication port with the command:
You can now load or type on the M20 xreceive.bas, which implements the XMODEM downloader. You start the transmission on the uploader. After you run xreceive.bas, you are asked the name to be given to the file that will be downloaded. After that, the download will begin.
You find BASIC files to download in the corresponding section of the site.
Olivetti is a registered trademark of Telecom Italia