Giter Club home page Giter Club logo

minix2's Introduction

Minix QD

Introduction

This is a very quick-and-dirty distribution of the old Minix 1 and 2 operating systems by Andrew Tanenbaum. It's not official in any way.

What is Minix QD?

Minix is a pedagogical operating system designed for teaching an OS course, first developed in the 1990s. Despite being restricted in scope and suitable for understanding by students, it's actually a surprisingly powerful and thoroughly usable Unix clone; older versions will run in tiny amounts of RAM. Their entire distribution, source code and C compiler included, will fit in about 40MB of disk and it'll recompile its own kernel and userspace in 1MB of RAM. (Slowly.) They'll run entirely off floppy disk. They'll even boot on an original IBM PC with 512kB of RAM, although they're a bit cramped.

There are three versions. The current one is Minix 3, which is still under active development; look there if you're interested.

Minix QD is my quick-and-dirty distribution of the old, obsolete versions of Minix. There are two:

Minix 1 is the older version. You get: multiuser logins, all the standard Unix tools, a full Bourne shell, an ANSI C89 C compiler, a Modula-2 compiler, a vi clone, an emacs clone, a pico clone, source for nearly everything, awk, bc, games, all the man pages, and huge amounts of other stuff. It's (almost) completely self-hosted --- you can hack Minix on Minix. The maximum supported amount of RAM is 16MB.

Minix 2 gives you all of the above, plus: a better interactive shell, a richer API, TCP/IP networking, swap, and lots of other stuff I haven't discovered yet (there isn't a changelog). The maximum supported amount of RAM is 64MB.

Apart from being interesting simply as works of software art, they work so well they're actually useful on really old hardware; so, this distribution.

I don't care about instructions, I just want something I can run!

Go to the release page; download one of the img.gz files; decompress it and write it to the appropriate media; then boot it in something.

What's here?

What you will find here is the contents of the last Minix 1 and 2 releases, 1.7.5 and 2.0.4, extracted and massaged so that they'll live in a standard user directory, plus a set of scripts that will take the distributions and turn it into a bootable Minix hard drive images. Minix is self-hosting, so we need to bootstrap a Minix somehow to build it on.

You won't find all the source here, because Minix came with most source, but not all; the C compiler is ACKPACK, a special version of the Amsterdam Compiler Kit, carefully cut down and modified to run on Minix. Back when this was released, this wasn't open source.

Note: this is Minix i86. The largest binaries can get is 64kB+64kB. This is restrictive compared to Minix i386, but it'll also build and run on machines with as little as 1MB of RAM, which is the main case I'm interested in.

Instructions

You will need a Linux machine and qemu-system-i386 and rsync.

Building and booting

Do:

$ ./mkall

This will rebuild all the installation images from the files in fs for both versions. (Alternatively, you can download these from the release page.)

  • combo-1440kB.img.gz, combo-1200kB.img.gz: combined root/usr floppy disk images. These contain a single filesystem with no division into root and usr. You can boot these. By default, the disk image will be loaded into a ramdisk to free up the floppy disk drive, but if you have less than about 3MB of RAM you should mount them directly; at the boot monitor prompt. hit ESC, then type rootdev=fd0, then boot.

  • hd-64MB.img.gz: is a bootable hard drive image containing absolutely everything; compilers, games, all the source code, the lot. Don't be put off by the size. Use this if you want to run Minix in a virtual machine.

  • root-720kB.img.gz, usr-720kB.img.gz: split root and usr floppy disk images. A 720kB floppy isn't big enough for the combined disk, so you need to boot the root disk, let it load itself into a ramdisk, and then it'll prompt you to replace the floppy with the usr image. It'll ask for a device; you want /dev/fd0.

Installing onto a hard drive

Once you have a floppy based system booted, you want to copy Minix onto your computer's hard drive.

The detailed instructions are long and complicated, but the tl;dr version for Minix 2 is to log in as root, and then:

$ part

...is the partition editor; the Minix partition type is 81. If you have less than 4MB RAM, create a swap partition (of about 4MB). You'll probably want to reboot (Minix sometimes forgets to reload the partition table). I'm going to assume you have the swap in /dev/c0d0p0 and your filesystem in /dev/c0d0p1. Don't make your filesystem too big; 64MB is probably as large as you want.

To mount the swap:

# mkswap /dev/c0d0p0  # controller 0, drive 0, partition 0
# mount -s /dev/c0d0p0

To create the filesystem and copy all the data:

# mkfs /dev/c0d0p1
# mount /dev/c0d0p1 /mnt
# cpdir -vx / /mnt/
# cpdir -vx /usr/ /mnt/usr/   # only if you're using the usr-720kB floppy
# echo "root=c0d0p1" > /mnt/etc/fstab
# echo "swap=c0d0p0" >> /mnt/etc/fstab   # vi is also available
# umount /dev/c0d0p1   # note that you use a device name here, not a path

To make the hard drive bootable:

# installboot -m /dev/c0d0 /usr/mdec/masterboot
# installboot -d /dev/c0d0p1 /usr/mdec/bootblock boot
# edparams /dev/c0d0p1
c0d0p1> rootdev=c0d0p1
c0d0p1> save
c0d0p1> exit
# shutdown -h now

...then reboot. Hopefully your new system will boot.

Installing Minix 1 is exactly the same, except:

  • there's no swap, so ignore that bit

  • devices are named differently; /dev/c0d0 => /dev/hd0; /dev/c0d0p0 => /dev/hd1; /dev/c0d0p3 => /dev/hd4; /dev/c0d1 => /dev/hd5; etc.

Hacking it

If you just want to fiddle with it, or do builds, then do this:

$ ./setversion minix-2.0  # or minix-1.7
$ ./pack

...and it will create an hd.img file, similar to the hd-64MB.img.gz one above. It's also lightly massaged for use as a build box, so when it boots it'll take you straight to a shell, etc. This then allows you to then do:

$ ./runqemu

That will run QEMU and you should see Minix boot. It'll take about a second.

Once you've finished working with Minix, exit the shell with ^D. It'll shut down cleanly. Then you kill the qemu window (sorry, Minix doesn't know how to tell qemu to shut down!) and then you can do:

$ ./unpack

...and your changes will be copied out of the image into the fs directory where you and the VCS can see them. (If you unpack from the wrong version, weird things will happen. Don't do that.)

References

License

Minix 1 and 2, and all my scripts, are BSD 3-clause. See the LICENSE.

minix2's People

Contributors

davidgiven avatar dtrg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minix2's Issues

Problems loading RAM disk when booting from floppies on QEMU

Hey David, I'm trying to run your floppy images on QEMU and having some issues (I have the same/similar issues with the MINIX 1.7/2.0.4 images here):

For all of the floppy images, I can get to the boot monitor, but after typing "=" to start up I receive several "Unrecoverable disk error on device 2/0, block xxx" errors while the RAM disk is being loaded.

The specific errors after that are slightly different for each image (built with mkall):
(command: qemu-system-i386 -fda minix-x.0-combo-xxxxkB.img. )
-minix-2.0-combo-1440kB.img: reaches the login prompt, but typing "root" to log in fails silently and returns me to the "noname login" prompt.
-minix-2.0-combo-1200kB.img: never reaches the login prompt. After the "Ram disk loaded" message, it repeatedly prints out "init: console: Not a directory" and "init: ttyc1: Not a directory."
-minix-1.7-combo-1440kB.img: has a bunch of unrecoverable disk errors, but does allow me to login as root and cd around. As far as I can tell, all of the files from _root.manifest, _usr.manifest, and _core.manifest are there intact.
-minix-1.7-combo-1200kB.img: same as ^

qemu-system-i386 -version prints out:
QEMU emulator version 4.2.1 (Debian 1:4.2-3ubuntu6.24) on my Intel machine (but I've tried it with the latest QEMU 7.2.0 too, and it doesn't seem to work - I haven't managed to get an older version of QEMU to build yet).

I've stepped through the bootloader code with GDB, and weird things happen: when you get to the first int 13, ah=00 instruction, eip jumps to 0xd415 (a bunch of empty memory). To my understanding this isn't supposed to happen - I believe ah=00 means that the disk controller should be reset, which shouldn't (?) have an effect on eip? (Edit: realized this was because I was stepping into the interrupt service routine instead of over it, see David's response for the actual issue).

I've also tried specifying the controller drive type manually using:

qemu-system-x86_64 -M q35 -drive if=none,id=f0,file=minix-2.0-combo-1440kB.img,format=raw -device isa-fdc,driveA=f0,bootindexA=1,fdtypeA=144 (the -M q35 is necessary due to the note here: https://www.spinics.net/linux/fedora/libvir/msg216157.html).

I also have checked the md5sums of the 2.0.4 images that I downloaded from the minix3.org site, and they match. The images also mount on my Linux machine.

I would like to know the QEMU command and version of QEMU you have used to run the floppy images (if you haven't been running them on hardware). From searching the comp.os.minix mailing list, I am pretty confident that some people have managed to do so in the past.

I have sent you a video of the errors I am experiencing to help clarify.

install on ibm thinkpad 770z

any chance there is a way for me to build and run minix 2. specifically 2 on this old ibm thinkpad 770z i found somewhere. because I want to follow along with the book.

any basic pointers would be greatly appreciated.

USB Booting Support?

Hello!

I am interested in MINIX and I was wondering if you could use the combo to boot MINIX from a USB Stick?

Win

Boot Stalls on readclock for Book 8088

The 64MB disk image of Minix 2 stalls at readclock. Message is:
`readclock: Machine ID unknown.
Machine ID byte = fe

Please enter date: MMDDYYhhmmss. Then hit the RETURN key.``

So I tried to enter the time and... It doesn't take any input from the keyboard. The only thing that works is CTRL+ALT+Delete.

BIOS is the revised BIOS by Skiselev. Processor is the stock V20 that comes with it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.