[logo]     Exchanging Data with Other Operating Systems [logo]

Exchanging Data with Other Operating Systems

If you use two or more operating systems you probably will want to exchange data between them at some point. If they are on separate computers and the computers are networked, you can use programs like ftp(1) (available for most, if not all, operating systems) or (between Unix-like systems) rcp(1) . Between nonnetworked computers you can use kermit(9) (also available for most, if not all, operating systems) to transfer data via modem or over a serial line connection.

Exchange of data between different operating systems running at different times on the same computer (or at the same time using a virtual or emulated machine such as provided by VMWare and Bochs) or on two computers that can't communicate by wire requires arranging for one system or the other to read and write "foreign" floppy disks or hard disk partitions. With floppy disks the only problem is to interpret the data structures used by the foreign file system. With hard disk partitions there may be another problem to be solved first: although all operating systems that use the same hardware platform must use the method of defining primary disk partitions that is supported by the system's ROM boot code, operating system designers have devised various ways of further dividing primary partitions into subpartitions. This document deals with the problem of interpreting foreign file systems; see the file on partition compatibility for information on the subpartition problem.

MINIX's primary purpose is to illustrate operating system principles. Keeping MINIX small enough to fit into a student's head during a semester- or year-long course has required keeping it simple. In particular, the MINIX file system supports mounting only media containing MINIX file systems.

MINIX Access to Foreign File Systems

In the Unix world mounting a file system has a definite meaning: a mounted file system is part of a single directory tree with / at its root. But just because MINIX cannot mount foreign file systems doesn't mean they can't be accessed. The standard MINIX distribution contains utility programs to allow reading and writing files and directories in MS-DOS and Windows file systems, and for reading files and directories in ISO-9660 file systems, as found on CD-ROMs. These programs are the dos* utilities, mtools, and the iso* utilities.

Accessing MS/DOS and Windows file systems from MINIX:

  • The old way (before MINIX 2.0.3) is the MINIX dosdir/dosread/doswrite utilities. These can handle floppy disks and relatively small FAT partitions.

    If your native Windows file system can't be handled by the dos* tools, one way around the problem is make an extra small Windows FAT partition that the MINIX tools can handle to use as a staging area for files to be transferred between the OSs.

  • The new way is the mtools command. Unfortunately, as of the MINIX 2.0.3 release there is no man page for mtools. However, use is simple. Mtools takes as its first argument a standard DOS command line command, such as copy, dir, etc. Additional arguments are DOS and MINIX paths. The MINIX path is expressed in standard MINIX syntax. The DOS path is expressed with the MINIX device, a colon (':'), and the path with Unix type forward-slash separators. For example:

    # mtools copy /dev/fd0:/dir1/file1.txt /usr/local/doc

    Mtools contains its own help facility, type "mtools -?". Mtools does have a downside, it is greedy for memory. By default it is chmem-ed to use more than 10 Mbytes. But most systems with disk partitions too large for the dosread family of utilities have lots of memory.

  • Also, see the article on using DOS-MINIX as a bridge between MINIX and Windows.

Accessing ISO-9660 (CD-ROM) files from MINIX:

Of course, to use the iso* tools you need to know the MINIX device that corresponds to your CD-ROM. It will most like be /dev/c0d1 or /dev/c0d2 on a typical computer with one hard drive and one CD-ROM drive. (That's for MINIX 2.0.3 or later, for earlier versions try /dev/hd5 or /dev/hd10). You can use the part command or experiment with isoinfo with different arguments to identify the CD-ROM drive.

Accessing files in Linux ext2 file systems from MINIX:

Terry McConnell ported a package called ext2tools, originally written for MS-DOS, to MINIX. As originally written by Claus Tondering, this package provided tools for accessing a Linux ext2 filesystem from MS-DOS. The port provides the same functionality for accessing Linux files from MINIX. The following programs are included:

  • e2cp: copy a file from an ext2 filesystem.
  • e2cat: list a file from an ext2 filesystem.
  • e2ls: give directory listings for directories on an ext2 filesystem.

Of course, as of 2003 Linux has moved on, and ext2 is no longer the most widely used Linux file system. One way to deal with this is similar to what was suggested above for Windows: make an extra Linux partition that uses ext2, or perhaps even the Linux minix file system, and use this as a staging point for files to be transferred.

MS-DOS and Windows Access to MINIX File Systems

Terry McConnell has extended a package originally called MinDOS to make mintools, which gives access to MINIX files from an MS-DOS prompt.

Linux Access to MINIX File Systems

This category is a no-brainer. Linus used the then-current MINIX file system as the basis for Linux , and although Linux hard drives usually use the Linux ext3 or another newer file system now, support for the MINIX file system is usually included if floppy disk access is required -- newer file systems are not suited for floppy disks, and the MINIX fs is used for floppy disks by default. Just be sure when you configure Linux that you include support for the MINIX file system.

File Transfers between Guest and Host OS on Virtual or Emulated Systems

With a virtual or emulated host platform, as provided by Bochs or VMWare, one frequently needs to transfer data from the host OS to the guest OS or vice versa. Depending on the capabilities of the two systems, there may be several ways to do this.

  • Network connection: If both the host and the guest are network-capable, then file transfers are easy. With MINIX on Bochs on a Windows host the host can use ftp to get and put files into the file space of the MINIX guest. I believe this will also work with MINIX on VMWare on Windows, but MINIX support for the type of emulated ethernet card presented by VMWare to a guest OS isn't yet part of the standard MINIX distribution. If a direct network connection between the guest and the host isn't possible, transfer of files through the file space of another machine on the network might be the easiest way.
  • Floppy disks: If the guest OS can write to physical floppy disks, these can be used to transfer files. MINIX can use mtools or the dosread and doswrite programs to access an MS-DOS formatted floppy disk. From the Windows host side mintools can be used to access MINIX disks. For files too big to fit on a floppy disk the fdvol utility provided in the dosutils directory on MINIX download sites can be used on the Windows host side to write to multiple disks that the MINIX guest can read with the vol command. From the MINIX side dd can be used to break a large file into smaller chunks that doswrite or mtools can write to MS-DOS floppy disks, and on the Windows side the MS-DOS copy command can be used to concatenate smaller files to a larger file.
  • Virtual disks: With Bochs on Windows 98 access to physical floppy disks from a guest OS is not supported, so only files used as virtual disks can be read and written by the guest OS. But in many cases virtual disks are easier to use than physical floppy disks anyway, especially since access to floppy disks from Bochs is very slow. Fortunately, unlike a virtual hard disk, new virtual floppy disks can be created while running Bochs, and multiple virtual floppy disks can be accessed during a single session. Also, mtools can be used to format a virtual floppy disk with an MS-DOS FAT file system, and on the Windows side there is a free program, DiskExplorer, that can transfer files back and forth between the virtual disk and the Windows host file system.
  • Things unknown ... As I write this section most of my own experience with virtual and emulated systems has been with VMWare and Bochs on Windows. I would like to add to this section more information about file transfers between MINIX guest systems on VMWare or Bochs on Linux and Unix systems, as well as with MINIX as a guest on Bochs on the Mac OS. Information from readers would be appreciated.
Virtual and emulated system links: Here are sources of more information about some of the topics mentioned in this section.