There is a great experience for speed lovers to use the MINIX installed on a primary partition, but it is simpler if the first encounter with MINIX takes place on a virtualized machine. So we are going to install MINIX3 in VirtualBox. For example, let's choose the latest development snapshot image minix3_2_1_ide_20131118.iso, that should be written to a CD disk, but it is a better way to mount this ISO image directly.
Creating a virtual machine in VirtualBox is a very simple, but necessary subtask. After some clicks with using the default settings the new virtual MINIX system will be launched soon.
At first startup, we must give from where we want to boot. All we have to do is to choose the downloaded image file.
From this point we have to give some settings that must be applied mutatis mutandis.
We must follow the instructions which appeared on the screen: the installation will start after we have logged in as root and entered setup.
During the next installation steps we may accept the defaults by pressing Enter, mutatis mutandis. Then (after unmounting the installer disk image in the menu item ) we are able to boot the new MINIX system from the hard disk.
In the next section we are going to take possession of the newly installed MINIX.
The first kernel compilation is an obligatory task for all students. Let's do it together now!
Using the command cd /usr/src we enter the
directory that contains the MINIX kernel-tree. Then we open the
source file kernel/main.c with
vi editor. The usage of vi is not
masochism, because the installed MINIX has no other editors
now.
In this source file, search for the function
announce().
/*===========================================================================*
* announce *
*===========================================================================*/
static void announce(void) { /* Display the MINIX startup banner. */
printf("\nMINIX %s.%s. " #ifdef _VCS_REVISION "(" _VCS_REVISION
")\n" #endif "Copyright 2012, Vrije Universiteit, Amsterdam, The
Netherlands\n", OS_RELEASE, OS_VERSION); printf("MINIX is open
source software, see http://www.minix3.org\n"); printf("nORBi a
kernelben\n"); printf("%c%s",0x1B,"[47;30m"); }All we did was to write a message during booting. The
Hungarian language message nORBi a kernelben
roughly means „the author is in the kernel” that is similar to a
„Hello, World!„ message from the kernel. This message will be
printed in boot time. In addition, the video mode of the terminal is
changed to gray background and black foreground. The description of
the used ANSI escape codes, for example, can be found in Wikipedia.
After saving the source (using Shift+zz key combination in vi) the make install command compiles the kernel sources, then the system must be rebooted by the command shutdown -r.
In the case of the newly compiled kernel we can see the message from the kernel and the changed video mode as well.
Handling packages and the packages themselves are always changing... At first in Minix3, we could use packman package manager program and for example the emacs editor could be installed from package. At this moment MINIX's package manager is pkgin and emacs cannot be installed from package.
Before listing the available packages we must enter the command pkgin update, after this we are able to choose from packages using command pkgin av|more.
For example, I like to set the
bash's PS1 environment
variable to show the host name, the user name and the working
directory. I usually add the following lines to the bottom of the
.profile file.
export PS1="\[\033[47;30m\][minix@\u]\w > " clear bash
exitIf we have already set the video mode in kernel, we do the
same in the shell too. Here we may notice that using
.bashrc to set PS1 is a more
robust solution than using .profile
export PS1="\[\033[47;30m\][minix@\u]\w
> " clear because in this case the make world will not delete this file.