Tuesday, June 27, 2006

Git port updated

I've updated the Minix 3 Git port so retrieval of remote repositories via HTTP work. This requires the recent Curl port.

Once installed you'll be able to retrieve directly from the Minix Git repository hosted here with something like:
git clone http://www.minixtips.com/repos/minix-git.git/ minix-git

Updated source here: minix-git-1.4.0a.tar.gz.

Categories: ,

Curl ported to Minix 3

The following files provide a port of Curl for Minix 3:

The source can be built and installed with:
$ gmake
$ su
<...root password...>
# gmake install

Curl is a command line utility for transferring files via protocols like HTTP, FTP, etc. It's used by the Git version control system to access remote repositories which is why I ported it.

Categories: ,

Preliminary Git port for Minix 3

[ Updated 2006-06-27: Now includes HTTP support using the Minix Curl port ]

I've done a first cut at a port of the Git version control system. This is the system currently used for managing the Linux kernel. It's a distributed version control system, similar in manner to the way 'darcs' and 'arch' work.

I've not got everything working yet. The 'git' protocol requires a program to be running on the server hosting the repository, which I haven't ported yet. Still, the port is useful as it is. You can publish repositories using HTTP for example and you can retrieve remote repositories using 'git' or 'http'.

You can get the buildable distribution from minix-git-1.4.0a.tar.gz. It's about 850KB in size. To build you'll need your path setup as:
/usr/gnu/i386-pc-minix/bin:/usr/gnu/bin:/usr/gnu/bin:$PATH

You'll need bash, as well as a variety of the GNU tools. I installed everything off 'packman'.

To build just do:
make
make install
chmem =25000000 ~/bin/*

This will do a 'local install' into a $HOME/bin directory. Add this to your path and it should work. A quick tutorial is available here

The Git repository for the changes I've made is here: http://www.minixtips.com/repos/minix-git.git/

You can retrieve it with git:
git clone http://www.minixtips.com/repos/minix-git.git/ minix-git

Once you have the repository it will default to the 'master' branch. To build from the repository you'll want the 'minix_1_4_0' branch - this is the one that contains my Minix changes. You can change to it with:
git clone http://www.minixtips.com/repos/minix-git.git/ minix-git
cd minix-git
git checkout minix_1_4_0

The 'git' protocol works for retrieving remote repositories too. For example, to retrieve the original Git repository:
git clone git://git.kernel.org/pub/scm/git/git.git

Be aware that this is an 'in-progress' port so will very likely have bugs. I wouldn't use it on your only copy of your important source just yet!

Categories: ,

Monday, June 26, 2006

How to add more virtual consoles to Minix

Matej Kosik emailed me a neat tip today, showing how to add more virtual consoles to Minix. The virtual consoles can be accessed by pressing ALT+F1, ALT+F2, etc. By default there are four consoles available. As an example, here's how Matej described adding four more:

In /etc/ttytab add these lines:
       ttyc4   minix   getty
ttyc5 minix getty
ttyc6 minix getty
ttyc7 minix getty
In directory '/dev' perform:
       mknod ttyc4 c 4 4
mknod ttyc5 c 4 5
mknod ttyc6 c 4 6
mknod ttyc7 c 4 7
In file '/usr/src/include/minix/config.h' change line:
#define NR_CONS            4
To:
#define NR_CONS            8
Go to '/usr/src/tools' and perform:
make hdboot

Reboot Minix and in boot menu:
       1. Start Minix 3
2. Start Small Minix 3
3. Start Custom Minix 3
choose option 3.

Categories: ,

Scheme48 ported to Minix 3

I've ported Scheme48 to Minix 3. The source is available in minix-scheme48-1.3-src.tar.bz2 (~2MB) and the binaries in minix-scheme48-1.3-bin.tar.bz2 (~1MB).

To compile make sure you have the GNU tools in your PATH and have set 'bash' to have the appropriate memory. Then do:
$ ./configure
$ gmake
$ gmake install


You'll need to do the 'gmake install' step as root. To run:
 $ scheme48
Welcome to Scheme 48 1.3 (made by chris on Mon Jun 26 18:36:43 GMT 2006)
Copyright (c) 1993-2005 by Richard Kelsey and Jonathan Rees.
Please report bugs to scheme-48-bugs@s48.org.
Get more information at http://www.s48.org/.
Type ,? (comma question-mark) for help.
>

This build includes socket support and lightweight threads. It's only lightly tested and the source has some workarounds for some things that I had difficulty porting to Minix (millisecond level timers for example). All feedback welcome of course. I'll make a newer version when I've fixed up some of the workarounds and send a patch to the S48 maintainers.

Categories: ,

'configure' fails when compiling some GNU tools

To compile a lot of software you need to be able to run the 'configure' script. To do this you should install most of the additional packages available for Minix with 'packman', especially the gcc compiler and the autoconf tools. You'll need to modify your PATH to be able to run them:
export PATH=/usr/gnu/i386-pc-minix/bin:/usr/gnu/bin:$PATH

Some of the utilities installed may need their memory requirements changed using 'chmem'. For example, when running 'configure' for the first time I encountered this error:
$ ./configure
./configure: xmalloc: ./parse.y:2716: cannot allocate 64 bytes (0 bytes allocated)

To track down the command causing this problem run the 'configure' script explicity using 'sh' passing the '-x' option which displays all commands run:
sh -x ./configure+ test -n
+ test -n
+ DUALCASE=1
+ export DUALCASE
...
+ CONFIG_SHELL=/usr/local/bin/bash
+ export CONFIG_SHELL
+ exec /usr/local/bin/bash ./configure
./configure: xmalloc: ./parse.y:2716: cannot allocate 64 bytes (0 bytes allocated)

This shows that 'bash' ran out of memory. Changing the memory value of 'bash' gets 'configure' working:
$ su
Password:
# chmem +1000000 /usr/local/bin/bash
/usr/local/bin/bash: Stack+malloc area changed from 131072 to 1131072 bytes.
#
$ ./configure
...


Categories: ,

Friday, June 23, 2006

Minix with a static IP address

When Minix 3 is installed it defaults to using DHCP to obtain an IP address and DNS server information. With the move of this weblog to a dedicated server I was given a static IP address and couldn't use DHCP. Here's how I set up Minix to run with a static IP address.

I installed Minix as normal but did not get an IP address since there is no DHCP server running on the network. Minix decides whether to use DHCP or not from the existance of an '/etc/rc.net' file. If it does not exist, the following steps are performed (this is all in '/usr/etc/rc'):
  1. Run the 'dhcpd' daemon to obtain an IP address.
  2. Run the 'nonamed' daemon for DNS queries.
  3. Run '/etc/rc.daemons' if it exists.

By creating an '/etc/rc.net' file these steps are not done, instead it is expected that '/etc/rc.net' will do what is necessary to get the network up and running. I created an '/etc/rc.net' that looked like the following:
ifconfig -I /dev/ip0 -n 255.255.255.0 -h my.ip.address.here
add_route -g my.gateway.address.here
daemonize nonamed -L
. /etc/rc.daemons

The first things it does is run 'ifconfig' to set the IP address. Replace 'my.ip.address.here' with the dotted IP number. This is followed by an 'add_route' to set the gateway for the network. Again, 'my.gateway.address.here' is replaced by the gateway dotted IP address. Both of these IP addresses were provided by my hosting company.

The 'nonamed' daemon still needs to be run and so does the 'rc.daemons' script. This won't happen if 'rc.net' exists so it's done manually within the new 'rc.net'.

Once final step is to tell Minix the IP address of the nameservers. This can be done using 'nonamed' by adding something like the following to '/etc/hosts':
192.168.1.10  %nameserver
192.168.1.11 %nameserver

Replace '192.168.1.10', etc with the IP address of the nameservers as given to you by the hosting provided. Usually '/etc/hosts' holds local domain name lookup information. The '%nameserver' is a special directive used by 'nonamed' to tell it what the IP addresses of the nameservers are. Usually it gets this from the DHCP configuration. Without DHCP it needs to be done manually.

If you don't run 'nonamed' you can set the nameserver information differently by adding it to '/etc/resolv.conf'. In that case the file would look like:
nameserver 192.168.1.10
nameserver 192.168.1.11

Again, you'd replace the IP addresses with the proper nameserver ones. Without 'nonamed' this will use the network nameservers directly.

If you use 'nonamed' you should not have a '/etc/resolv.conf', instead using the '/etc/hosts' method described above. 'nonamed' is essentially a local nameserver that delegates to the network ones but has some additional benenfits like caching, etc. From the man page:
Nonamed is not a name daemon. It can answer simple queries from /etc/hosts, but anything else is relayed to a real name daemon. Nonamed maintaines a small cache of replies it has seen from a name daemon, and will use this cache to minimize traffic if the machine is permanently connected to the Internet, or to answer requests if the machine is often disconnected from the Internet, i.e. a computer at home.

Once these steps are done you can bring the network up by rebooting, or running:
. /etc/rc.net

You'll now have the static IP address and access to the network.

Categories: , ,

Server Moved

I posted before that I was moving the server to a new home and it's now done. The DNS has been updated for the new IP address and if you can read this post it's from Minix 3 running on a dedicated server. Hopefully no more problems with power cuts!

Categories: ,

Thursday, June 22, 2006

Server Downtime

The server was down today for about 8 hours due to a power cut at home. The problems of hosting the server at home!

The good news is I've ordered a dedicated server from M5 Hosting and am setting it up now. In a day or two I'll have the Minix Tips domain switch to that server and it should be much more reliable.

M5 Hosting's support has been excellent so far. I'll report back here on how things go after I've been using them for a bit.

Categories: ,

Little Smalltalk for Minix 3

I've compiled Little Smalltalk version 4.5 to run under Minix 3. This version of Little Smalltalk is written in C and modified by Andy Valencia and Kyle Hayes to add additional functionality. From the Little Smalltalk site:
Little Smalltalk is a sort of fun experiment in building a minimal smalltalk system. The source code for the interpreter is less than 1800 lines of code. The image consists of less than 4000 objects. It runs in almost no memory. In short, it's small, it's reasonably fast, it's easy to understand, and easy to modify.

This version, thanks to Kyle, includes a Class Browser with a web based GUI. Using your browser, connect to the running Little Smalltalk instance and you can browse classes and methods. You can even modify methods through the web interface on the fly.

I modified the source slightly to compile under Minix. I'll revisit the changes in a week or so to tidy it up so it still builds and runs under the original platforms. In the meantime though you can download:

To build from source, make sure you have GNU gcc installed and in your PATH:
export PATH=/usr/gnu/i386-pc-minix/bin:/usr/gnu/bin:$PATH

Run 'gmake' from within the lst-4.5 directory to create the 'st' executable, and then from within the 'ImageBuilder' directory to create the Smalltalk image.

To run, from within the lst-4.5 directory, run 'st'. To start the web based class browser follow this example (key in the red text):
$ ./st
3227 objects in image
-> File fileIn: 'classbrowser.st'.
method inserted: subclass:variables:classVariables:
method inserted: from:to:
method inserted: position:
...
method inserted: showErrorOn:
method inserted: start
method inserted: startOn:
file in completed
-> HTTPClassBrowser new start.
Socket: 3
IP: 0.0.0.0
Port: 6789

If you now visit http://machinename:6789/ you will be able to access the class browser. There being no GUI web browser for Minix you'll probably want to do this from some other machine, replacing 'machinename' with the name or ip address of the Minix machine. It does work with Lynx running under Minix but the text based interface is not pleasant as it uses frames. Also note that the class browser is listening on any incoming ip address so make sure port 6789 is not accessable from people you don't trust.

It's not Squeak, but it's still fun to play with.

Categories: , ,

Tuesday, June 20, 2006

Update about this site

My first post to Minix Tips mentioned that I was actually hosting this site on a Minix 3 server running the httpd daemon that ships with it.

In particular I mentioned that I was using qemu to run Minix on a User Mode Linux server I use.

Unfortunately I was not able to get this setup stable enough. Qemu 0.8.1 would often segfault when running under User Mode Linux. Sometimes multiple times per hour. I had it restarting automatically but it was causing problems. I'm not sure if this is due to the UML kernel version I was using or some other interaction. I ended up moving off the UML machine and putting it on my own PC connected to the internet.

This stopped the segfaults but about once a day the qemu process, and in turn Minix, would hang. It refused all connections to the outside world and I couldn't even type on the console.

All is not lost though. I'm now running under VMware Server. This is a free product in beta test, although it is closed source. It is working very well and I've had no problems running Minix 3 since moving to this setup. So this weblog remains hosted on a Minix 3 server.

As it's running on my PC it is prone to problems like me rebooting or the power going out (all too frequent in New Zealand in Winter!). If it stays stable for another couple of weeks I'll look at moving to a commercial hosting system.

I'll still keep my eye on qemu though and try to get that running smoothly. I'm keen to make sure an open source solution is viable in case VMware Server becomes unavailable.

Categories: ,

Device Driver Development

I posted a thread on comp.os.minix asking about device driver development tips and got pointed to this resource about development of the es1371 audio driver. In particular the bachelorES1371.pdf file contains a good description of how a device driver is developed.

Categories: , ,

Updates to ftp, httpd, ftpd and man pages

I've received a note from Albert Woodhull of some updates to some of the Minix 3.1.2a software.

The first is a new version of Michael Temari's ftp program, ftp101.tar.Z (Mirrored from here). From Albert: "It should actually have been part of the last Minix 2 (2.0.4) release, and thus of all Minix 3 releases. It fixes at least one bug. I've made some updates to the documentation. There is more information in
ftp101.txt (Mirrored from here)."

There is also a new release of Michael Temari's httpd program. This release adds redirection support and is avilable for download in httpd0995.taz (Mirrored from here). More about it is in httpd0995.txt (Mirrored from here).

Several new man pages were also provided to me by Albert in man0606.tar.Z (Mirrored from here). They include:
  • ftp.1 (updated for ftp 1.01, released Feb 2005)
  • http_status.5
  • httpd.8 (updated for httpd 0.995, released May 2006)
  • httpd.conf.5
  • mtools.1
  • tcpd.8
  • urlget.1

I was also advised that Minix 3 has older source for the ftpd program that has a security vulnerability. It ships with the correct binary but not the correct source. So it's safe to run the ftpd binary but if you rebuild ftpd from source you'll get the version with the vulnerability. The corrected source is available in ftpd200.tar.Z (Mirrored from here). Information about it is in ftpd200.txt (Mirrored from here).

I believe the Minix CVS has been updated with some of this and will likely be in the next release. Thanks for the updates Albert!

Categories: ,

Minix 2 Resource Moved

Two former Minix resource sites were minix1.hampshire.edu and minix1.bio.umass.edu. These sites were run by Albert Woodhull and they were hosted on the Minix 2 operating system.

Unfortunately they are no longer operational but all the information contained there is now located at minix1.woodhull.com. It's a great resource for all things Minix. Although geared towards support for Minix 2, Albert tells me that Minix 3 information will also be appearing. A lot of material valid for Minix 2 is also very relevant to Minix 3.

Albert's name should be familiar to Minix enthusiasts. He's the co-author of the book 'Operating Systems Design and Implementation'. If you have the old sites bookmarked, please change them to the minix1.woodhull.com address.

Categories: ,

Sunday, June 18, 2006

SpiderMonkey Javascript for Minix

I've ported the Mozilla SpiderMonkey Javascript engine to Minix. I used the latest CVS from branch JS_1_7_ALPHA_BRANCH, which contains some of the new Javascript 1.7 enhancements like generators and destructuring assignments.

The files are available as:


I've raised a bug in Mozilla's bugzilla for the port and it contains the patches that can be applied to the original SpiderMonkey source.

To build from source on Minix you'll need GNU gcc and GNU make installed. You also need /usr/gnu/bin and /usr/gnu/i386-pc-minix/bin on your path:
export PATH=/usr/gnu/i386-pc-minix/bin:/usr/gnu/bin:$PATH

You can then build from the 'src' directory with:
gmake -f Makefile.ref

I tried to use readline support but when it tried to link it failed saying that libreadline.a was corrupt. I also tried the inbuilt 'editline' support but that failed to link due to virtual memory being exhausted. I'll investigate that a bit further as it's a bit hard to use when there's no command line history or anything.

Categories: ,

Saturday, June 17, 2006

Running Telnet and FTP servers with Minix

A default installation of Minix 3 includes ftpd and telnetd. These are the programs used to run FTP and Telenet servers respectively. They are not configured to run by default as they can be a security risk if not configured properly. This post outlines how to run them.

FTP and Telnet are not used as much as they were in the past. Instead SSH is probably more often used for remote access to servers. FTP and Telnet are insecure in that all information is passed as 'clear text' including passwords. There is no encryption like there is with SSH. That said, they are still common protocols and are easy to setup and configure.

The programs for FTP and telnet are called 'in.ftpd' and 'in.telnetd' respectively. They are designed to be run from a script called 'rc.daemons' which lives in the '/etc' directory. A default script exists with the name '/etc/rc.daemons.dist' which shows what the entries should look like.

By creating '/etc/rc.daemons' with the following entries you'll have FTP and Telnet servers running at startup:
# cat >/etc/rc.daemons
daemonize tcpd telnet in.telnetd
daemonize tcpd ftp in.ftpd
CTRL+D
'tcpd' is a program that accepts remote connections and passes them to other programs to do work. A line like 'tcpd telnet in.telnetd' says to run 'tcpd' listening on the telnet port (port 23) and run 'in.telnetd' to process the incoming connection. The 'daemonize' at the beginning runs 'tcpd' as a background process, known as a daemon.

To run telnet and FTP without having to restart the system you can manually spawn 'tcpd' as follows:
# intr -d tcpd telnet in.telnetd &
# intr -d tcpd ftp in.ftpd &
The 'intr' command spawns the process with input from /dev/null and output to /dev/log. The '-d' and the '&' spawn the process in the background and immediately returns to the shell.

You will need to put the entries in 'rc.daemons' if you want the servers to start running after a reboot.

Anonymous FTP should be disabled before running 'ftpd' to be safe. To do this, edit /etc/passwd, and remove the 'ftp' user. To enable, keep the 'ftp' user and see the 'ftp' man page. To configure either of these services you should read their 'man' pages:
# man telnetd
# man ftpd
If you are running Minix in an emulated environment like 'qemu' you won't be able to access these servers from the host machine, or any other machine except for those participating in the 'qemu' network. This tends to limit the reason for running the server in the first place!

To work around this you can pass a 'redir' option to 'qemu' which tells it to listen on a particular port on the host machine, and re-route connections from that to a port on the Minix machine. As an example, starting Minix with the following 'qemu':
qemu -localtime -hda minix.img -net user -net nic -redir tcp:5023::23

This creates a port on the host machine numbered '5023' which accepts tcp connections, and passes them to the Minix emulated machine on port '23', the 'telnet' port. So by telnet-ing to port 5023 on the host you can telnet into the emulated machine:
telnet localhost 5023
The format of the 'redir' options is {tcp or udp}:{host port}:{guest ip/name}:{guest port}. In the example above we skipped the 'guest ip/name' as it defaults to 10.0.2.15 which is assigned by default in 'qemu'.

Categories: , ,

Friday, June 16, 2006

Running Minix under VMware Player

I showed in a previous post how to get Minix running under qemu. This post shows how to get a Minix system running using VMware Player under Windows. You can download a pre-installed Minix system for VMware from the Minix 3 website. This post will show how to create one from scratch.

The first step is to install VMware Player. It's a free install. Once installed it requires a 'virtual machine configuration file'. This file describes how much memory the virtual machine has, what type of processor, etc. The easiest way to create one of these is to visit http://www.easyvmx.com. That website has a form you can full in to create the image and download it. I used the 'Super Simple Edition' option from the left hand side of the site. The following are the fields I entered or changed from the existing defaults:
  • Virtual Machine Name: Minix
  • Virtual Machine Operating System: Other OS
  • Virtual Machine Memory Size: 256MB
  • Virtual Machine Disk Size: 2GB
Click 'Create Virtual Machine' and download the 'Minix.zip' file presented.

It is possible to boot the Minix setup process directly from the CD-ROM ISO image from the Minix 3 website but it requires editing the file download above. Instead, to make the process easier, burn the ISO image to a CD and have that CD in the CD-ROM drive.

Start VMware Player and choose the 'Minix.vmx' file that you unzipped. The VMware machine will boot from the CD-ROM starting the Minix install process. Press CTRL+G to allow the keyboard to go to the VMware virtual machine and select option '1' (16MB Minix). Login as 'root' and run setup:
# setup

From here work through the prompts. The main thing to watch out for is the request for the network card type. Use option (6), the AMD Lance, as this is emulated by VMware. Note that this is a different choice from the qemu instructions.

Once the setup is finished you should 'shutdown' and then quit VMware player when the shutdown is complete:
# shutdown
fd0>
...close VMware player once the fd0> appears...

Restarting VMware player and choosing the 'Minix.vmx' file will boot into your newly created Minix system.

Categories: , ,

Wednesday, June 14, 2006

Handling out of memory issues

Minix does not have virtual memory. This means all running programs must fit inside the amount of available RAM.

A program has, as part of its binary, a field which tells it how much memory to allocate for stack space when it starts up. If this amount is too much for the available free memory of the system then you will not be able to start it. If it is too little then the program may crash while running due to not having enough memory.

This field in the binary can be adjusted using a command called 'chmem'. As you get to know Minix more you'll get familiar with this command I suspect! To demonstrate the use of 'chmem' I'll show how to use it on the 'mined' command.

To find out how much memory the command requires (ie. the value in that field in the binary):
# chmem +0 /usr/bin/mined
/usr/bin/mined: Stack+malloc area changed from 65536 to 65536 bytes.
The value can be incremented using the '+' or decremented with '-'. It can be set to a specific value using '='. Setting it very low may result in the command being unable to run:
# chmem =100 /usr/bin/mined
/usr/bin/mined: Stack+malloc area changed from 65536 to 100 bytes.
# mined
mined: Exec format error
# chmem =65536 /usr/bin/mined
/usr/bin/mined: Stack+malloc area changed from 100 to 65536 bytes.
# mined
...starts up...
If you find a program crashes due to low memory try bumping up its chmem value using '+10000' at a time until it runs.

The most common occurance of this 'out of memory' issue is running X11. Running 'xdm' will often fail silently when you first try. This is due to 'Xorg' running out of memory:
# chmem +0 /usr/X11R6/bin/Xorg
/usr/X11R6/bin/Xorg: Stack+malloc area changed from 520000000 to 520000000 bytes.
This may not run depending on how much memory you have. By changing it to a lower value you can get X to run:
# chmem =50000000 /usr/X11R6/bin/Xorg
/usr/X11R6/bin/Xorg: Stack+malloc area changed from 520000000 to 50000000 bytes.
# startx

You'll need to play around with the value to work out what exactly will work on your system depending on how much memory you have, and the configuration of your memory card.

Categories: ,

Adding Users

Ideally you don't want to always be 'root' when using Minix. It's best to create a user for your day to day usage and 'su' to 'root' as required.

Like most Unix based systems a user must belong to a group. I use a 'users' group that all users belong too. Minix doesn't have this by default. To add it, edit the '/etc/group' file. If you haven't installed an alternative editor you can use 'mined' which is installed by default:
...logged in as root...
# mined /etc/group
This is a full screen editor. You can use the arrow keys to move around and just type the changes you want. Add the following line:
users:*:12:
This adds a 'users' group with an id of '12'. Make sure that id isn't already being used. To exit 'mined' and save press CTRL+X and answer 'y' to the 'do you want to save' prompt.

Now the group is added, add a user with the 'adduser' command:
adduser chris users /home/chris

This will add a user called 'chris' who belongs to the 'users' group and the home directory is '/home/chris'. Initially there is no password set. Use 'passwd' to change this:
passwd chris

Logoff 'root' by pressing CTRL+D and then login under the new user. You can still run commands as 'root' when needed without logging off by using 'su'.

Categories: ,

Running Minix under qemu

Qemu is an open source CPU emulator. It can be used to run Minix quite nicely. I use Linux as my main operating system so these instructions are geared towards running qemu under Linux but it's possible to run under Windows too. Qemu version 0.8.1 is the version I used. I tried earlier versions but had some networking problems.

The first step is to create a disk image for Minix. This will appear to Minix running inside qemu as a hard drive. I use a 2GB image but smaller images are quite workable. Minix 3 with all contributed binaries installed takes about 500MB. Without the contributed binaries it's about 80MB I think. The reason I went for the 2GB image is to enable including all the source for all the included programs and to be able to develop software as well. Create the image using 'qemu-img':
qemu-img create minix.img 2G

This will create a 2GB file. Qemu does have a 'copy on write' format which grows the file as needed. You can try that with:
qemu-img create -f qcow minix.img 2G

I had random segfaults when trying this but it may have been due to other issues. The nice thing about it is the initial file is very small.

With the file created and the Minix 3 IDE CD-ROM image downloaded you can start the install process:
qemu -localtime -net user -net nic -m 128 -cdrom IDE-3.1.2a.iso -hda minix.img -boot d

This command will boot Minix from the IDE CD-ROM image inside of qemu. The '-m 128' indicates we want 128MB of memory to be provided to the Minix system. Any amount can be used here, the more the better if you want to use X11.

The initial boot process will take you through to a login prompt. Login as 'root', no password and run 'setup'.
# setup

From here work through the prompts. The main thing to watch out for is the request for the network card type. Use option (4), the Realtek 8029, as this is emulated by qemu.

As a disk image is being used you can safely avoid the check for bad disk blocks by pressing CTRL+C.

Once the 'setup' is completed, use 'shutdown' to safely close Minix down. When the boot prompt appears after the 'shutdown' command, close qemu.
# shutdown
fd0>

Now we restart qemu but change the '-boot d' parameter to '-boot c' to boot off our newly installed Minix image. We need to make one important change before the system boots to enable the network card though. Minix requires a parameter to be set, qemu_pci=1. This can be done once and saved to the image. The easiest approach is to start the new image, ignore the network errors, login as root, shutdown, set qemu_pci=1, save it, then reboot:
qemu -localtime -net user -net nic -m 128 -cdrom IDE-3.1.2a.iso -hda minix.img -boot c
...login as root...
# shutdown
d0p0s0> qemu_pci=1
save
boot

This system will boot again and the network card should work. From now on you can start by using the qemu command as above, there's no need to set the parameter again.

You should change your 'root' password as soon as possible. Use 'passwd' to do this:
# passwd

Once logged in as root you can use 'packman' to install packages:
# packman

This will bring up a list of packages which you can install, including gcc, X11, various GNU tools, etc.

Categories: , ,

Minix Wiki Book

From comp.os.minix comes news of a Minix Wiki Book project. The idea being to have people document in a collorative fashion how to use Minix.

Categories:

Running on Minix 3!

The server hosting this weblog is running the Minix 3 Operating System. I don't actually have a spare computer connected to the internet to run Minix on so I'm running it using Qemu on a User Mode Linux system (From Linode).

There's some tricks to getting this to work smoothly - and I haven't solved all the problems yet - but I'll be posting about that later. In the meantime, the plan for this weblog is to document how to use and modify Minix 3.

Categories: