When the power is turned on, the typical PC will try to read the first sector from the BIOS's boot device, such as the first floppy disk or the first hard disk, into memory, and execute it. The code obtained from the hard disk (from the so-called master boot sector) immediately will replace itself by the code found in the first sector of the active partition. Thus, the PC now is executing the bootstrap code found in the first sector of
/dev/c0d0p3 (assuming the boot disk is attached to controller 0).
In Minix's case, that bootstrap code loads the NetBSD boot loader, a multiboot-compliant boot loader that is able to boot Minix. The multiboot protocol loads the kernel and executables of boot-time processes (modules) somewhere in memory, according to the configuration settings and the commands entered.
/!\ Slightly stale: informations about criticity, order, and numbers are out of date.
The MINIX 3 system is made up of the union of several independent programs:
|Process Manager server||Critical||Should be number 0 (just after kernel), API calls assume it.|
|Virtual File System server||Critical||Should be number 1, API calls assume it.|
|Minix File System service||Fail-safe||For the root file system on /dev/imgrd|
|Virtual Memory manager||Critical||Should be number 8, mmap*() API calls assume it.|
Critical above means that a
panic() inside that server will bring the whole system down. Fail-safe, on the other hand, means that MINIX 3 should be able to handle a failure of that server, usually by re-starting the driver.
The MINIX 3 system is running now, the different tasks initialize themselves.
rs is the parent of all MINIX 3 system processes, while
init is the grandparent of all user processes; note that the word user is used here in constrast to system processes; and, does not refer to the user-mode - kernel-mode distinction (all processes are user-mode in MINIX). A small file system, contained in RAM inside the 'memory' driver, is mounted as
init is responsible for starting login processes on each terminal; but first, it runs
/etc/rc, a shell script.
The ramdisk itself is build within the
The image ramdisk contains several drivers which are used to boot the system fully:
|pci||Usually needed by the
|Minix File System service||For the real root file system|
|Ext2 File System service||If real root is using EXT2 (Linux)|
It also needs several commands, to perform the initialization,
and several support files
|Access Control List|
|Needed for running service|
/etc/rc checks the state of the system, and starts some daemons. It sets the system timezone if needed, the keyboard translation to the mapping in
/etc/keymap if present, followed by a call to readclock(8) to set MINIX 3's time from the hardware clock. Next, the file systems are checked if necessary, and the
/usr file system is mounted.
The system now is ready for multi-user start-up.
/usr/etc/rc. That cleans out
/usr/tmp/, and resets or cycles log files (by running
/usr/etc/daily), starts the update(8) and cron(8) daemons, and initializes the network services.
/usr/etc/rc runs any scripts that might have been installed into
/usr/local/etc/rc.d/ by packages.
/usr/local/etc/rc to initialize the system in a site- or host-dependent way.
/etc/ttytab, and starts a getty(8) for each enabled terminal line, in order to allow a user to log in.
Getty asks for a user-name, checks a password with login(1), changes to the user's home directory, and spawns a shell, as specified according to the ''/etc/passwd''(5) file.
The shell is a command interpreter, which is a waiting process. Then the waiting process interprets and executes what the user typed. Programs that the user may run are stored by the file system. Execution of a program is accomplished by forking a child process. Then the child can access the system calls. After returning from the system call and ending of the child process the shell waits user input.
The shell starts by interpreting the
$HOME/.profile scripts, which sre used to set up respectively the system and user default values and parameters. On MINIX,
$HOME/.profile also executes the instructions from