View Full Version : 68k Minix big-endian filesystems and *NIX

April 10th, 2007, 06:54 PM

I'm trying to extract the source code for Atari/Amiga/Macintosh Minix from the disk images without luck. They're in big endian format and everything I've tried mounting it on (Linux, NetBSD/i386, NetBSD/vax) doesn't read it.

I wrote a small program, then found dd can do the same thing, which swaps each byte around. The disk image was then reported as a Minix filesystem but the letters in the filenames were swapped too. Seems I need to make a specific program to convert only the binary sections of the disk.

I've also tried an Atari ST emulator with Minix, it works, but there's no easy way to transfer the source files from the emulator to the host system. I tried the printer interface but they're compressed binaries and the lp driver inserts line feeds. My modern system, in its wisdom, only has one serial port. So I can't loop two serial ports together with a null modem lead and transfer the files with kermit. Unless I set up another machine.

Does anyone have any ideas? Better still, does anyone know of a source tree for 68k Minix?


April 10th, 2007, 07:52 PM
The byte swap only happens on 16 and 32 bit quantities. (I am assuming that there are only 8, 16, and 32 bit quantities. If there are longer binary numbers, swap the appropriate number of bytes.) The 8 bit values don't get swapped, because a byte is in the correct order no matter what the platform.

As far as the filesystem is concerned, if you modify the filesystem code to do the correct ntohs and ntohl (or htons and htonl) calls on the 16 and 32 bit integer values used to manage the filesystem, it will be readable. Then the issue will be the data in the files. Before you can think about byte swapping those, you need to know which bytes actually need swapping. That's were file format/type becomes important.

ASCII text never needs swapping. Binary numbers stored as such do.

April 16th, 2007, 12:54 PM
You can install two virtual COM ports and connect them together via a virtual null-modem cable. This would eliminate the need for two serial ports.
Another idea, of course, would be to use another computer which has two serial ports. :-)