This page contains a guided tour of Minoca OS. It assumes you've downloaded the image, fired it up, and are sitting at the green Minoca OS command prompt. The tour was designed for you to type the commands along with us.

Minoca OS is quite similar in outward appearance to Unix-based operating systems. The "~# " prompt suggests (correctly) that you're sitting at the prompt for a Bourne-compatible shell.

Type "ls" and let's take a look around:

~# ls / bin dev etc home lib mnt root usr var

This looks familiar to the Unix directory structure, but is only the result of changing the root directory during system initialization. Take a look at "dev/Volume/Volume1/minoca/config/init.sh" (you can use "cat" or "nano") to see how the system initialized the environment. Here's the shortened output:

~# cat /dev/Volume/Volume1/minoca/config/init.sh ... WORLD="apps" ... export PATH='$PWD/$WORLD/bin' ... exec $WORLD/bin/chroot "$WORLD" -- /bin/init

The root of the Minoca OS file hierarchy is actually the root of the kernel Object Manager's hierarchy, which tracks a global hierarchy of all processes, threads, devices, volumes, and other core objects belong to. This, however, is not accessible from the current environment.

After making some careful modifications to init.sh, you could end up in the native Minoca OS environment that would look something like this:

/Volume/Volume1# ls -l total 16 drwxr-xr-x 1 4096 Fri Sep 26 15:28:14 2014 apps drwxr-xr-x 1 4096 Fri Sep 26 15:28:16 2014 minoca /Volume/Volume1# ls -l / total 0 drwxr-xr-x 1 0 Fri Sep 26 15:28:18 2014 Device drwxr-xr-x 1 0 Fri Sep 26 15:28:18 2014 Events drwxr-xr-x 1 0 Fri Sep 26 15:28:18 2014 Interface drwxr-xr-x 1 0 Fri Sep 26 15:28:18 2014 Irp drwxr-xr-x 1 0 Fri Sep 26 15:28:18 2014 Pipe drwxr-xr-x 1 0 Fri Sep 26 15:28:18 2014 Process drwxr-xr-x 1 0 Fri Sep 26 15:28:18 2014 QueuedLocks drwxr-xr-x 1 0 Fri Sep 26 15:28:18 2014 SharedMemoryObjects drwxr-xr-x 1 0 Fri Sep 26 15:28:18 2014 Terminal drwxr-xr-x 1 0 Fri Sep 26 15:28:18 2014 Volume

OK, this is definitely not Unix. We leave the init.sh modifications as an exercise to the reader.

Moving on, let's see what's currently running:

~# ps PID TTY TIME CMD 0 - 00:00:03 kernel 1 - 00:00:01 init 16 - 00:00:00 sh 17 - 00:00:00 sh

Whoa, a little quieter than we're used to. Well, that's not quite fair as this output doesn't enumerate each thread running in the kernel process. In a Minoca OS build with networking, USB, and a video console, there are about ten kernel threads, total. On my Ubuntu system at home, there are about fifty kernel tasks, and at least twenty-odd user processes running.

In preparation for the next sections, let's install some packages to play with. Minoca comes with opkg, so installing new software is easy:

~# opkg update Downloading http://www.minocacorp.com/packages/0.2/i686/main/Packages.gz. Inflating http://www.minocacorp.com/packages/0.2/i686/main/Packages.gz. Updated list of available packages in /var/opkg-lists/main. ~# opkg install python2 gcc Installing python2 (2.7.5) on root. Downloading http://www.minocacorp.com/packages/0.2/i686/main/python2_2.7.5_minoca-i686.ipk. Installing sqlite (3080500) on root. Downloading http://www.minocacorp.com/packages/0.2/i686/main/sqlite_3080500_minoca-i686.ipk. Installing expat (2.1.0) on root. Downloading http://www.minocacorp.com/packages/0.2/i686/main/expat_2.1.0_minoca-i686.ipk Installing GCC (4.9.2) on root. Downloading http://www.minocacorp.com/packages/0.2/i686/main/gcc_4.9.2_minoca-i686.ipk. Installing binutils (2.23) on root. Downloading http://www.minocacorp.com/packages/0.2/i686/main/binutils_2.23_minoca-i686.ipk. Configuring binutils. Configuring sqlite. Configuring expat. Configuring gcc. Configuring python2. ~#

Let's continue our tour through the system by running Python, one of our favorite interpreted languages:

~# python Python 2.7.5 (default, Apr 29 2016, 12:30:54) [GCC 4.9.2] on minoca0 Type "help", "copyright", "credits" or "license" for more information. >>>

Enter the following commands:

>>> a = "Hi from Python!" >>> f = open("hi.c", "w") >>> f.write("#include <stdio.h>\n") >>> f.write('int main() {puts("' + a + '\\n"); return 0;}\n') >>> f.close() >>> exit()

All we did there was create a file and write to it, but of course most of your favorite Python built-in libraries are available.

Back at the shell, let's edit that file in nano:

~# nano hi.c

Use the arrow keys to navigate, and change the word Python to C. Hit Control-O and then Enter to save the file, and Control-X to exit out of nano.

Make sure your file looks okay:

~# cat hi.c #include <stdio.h> int main() {puts("Hi from C!\n"); return 0;}

Now let's build it:

~# gcc -o hi hi.c

Finally, let's give your first Minoca OS program a test drive:

~# ./hi Hi from C!

And there you have it. You just used Python to write a C program, compiled it, and ran it on Minoca OS. The OS comes preloaded with a core set of applications, with more coming all the time. Now you've got one more.

If you want more information, head to the documentation page. You can learn about what makes Minoca OS unique, get involved in the effort, and download the toolchain to build your own apps and drivers.