Page 1 of 1

Phase V - Recursive Osdev

Posted: Tue Mar 31, 2015 6:00 pm
by sortie
This hobbyist operating system makes more.

When your operating system is self-hosting, has all the ports one could wish for, and actually resemble some degree of quality, then it is time to face the fact that your life has become too easy.

It's time to do it all over again. Recursively.

It's time to enter Phase V.

Image

Bare Bones (II)

The Bare Bones tutorial is isomorphically also a secret meta-tutorial. It documents not only how to complete itself, but it also documents how to complete itself under the operating system you made from it. You've not actually completed Bare Bones until you completed it under your own operating system.

That includes following all the instructions, and building a cross-compiler, naturally.

Example

To better illustrate my point, I've made a special disk image of my operating system. It contains a number of relevant elements:
  • The Bare Bones Tutorial (code, scripts and the tutorial itself)
  • A i686-elf cross-compiler.
  • GRUB & xorriso (grub-mkrescue).
  • Bochs.
  • A whole copy of the osdev wiki!
You can simply boot the disk image up and run a simple script to complete one of the meta layers of Bare Bones and view the result in Bochs. You can then proceed to enter a whole new operating system into the editor, recompile, and complete the next meta layer of Bare Bones, then upload the result as a response to this topic.

Usage

The command line environment is a traditional Unix environment and has the usual commands.
  • /root/bare-bones contains the osdev standard Bare Bones tutorial.
  • /root/meaty-skeleton contains the Meaty Skeleton tutorial.
  • /root/wiki.osdev.org contains a offline copy of the osdev wiki.
Run the ./bochs.sh scripts to recompile and test the tutorials. Use ./install.sh to install them properly onto the harddisk image, so you can select them from the bootloader itself.

Read also /share/doc/user-guide for basic system usage.

The editor is called 'editor' and you exit it with Control-Q. You save with Control-S and load with Control-O.

Disk Image

This is a raw harddisk image containing a 64-bit (x86_64) operating system. It contains a lot of stuff. It's self-hosting. It has python, git, quake, trianglix, nasm, i686-elf cross-compiler, GRUB, parted, e2fsprogs, its own source code, the osdev wiki, and so on. See /tix/installed.list for a list of all ports it contains. You can adapt it to your favorite virtual machine and use it to develop your own recursive hobbyist system on a hobbyist system. It's compressed with xz for good measure.

https://users-cs.au.dk/~sortie/sortix/phase-v/phase-v_x86_64.hdd.xz

For instance,

Code: Select all

wget https://users-cs.au.dk/~sortie/sortix/phase-v/phase-v_x86_64.hdd.xz &&
unxz phase-v_x86_64.hdd.xz &&
qemu-system-x86_64 -enable-kvm -vga std -hdd phase-v_x86_64.hdd -m 1024
Then follow the instructions above or just go do /root/bare-bones and run ./bochs.sh. Press ^C when done. To power off properly, simply type 'exit' in the outermost root shell. Local files are persistent.

The disk image uses the GRUB bootloader, has a ms-dos partition table and contains a single ext2 partition, in case you wish to access it from a host operating system and transfer files.

Let's get a level deeper!


Edit:
Errata
This release has a little bug that prevents it from properly wholly rebuilding itself, simply fix /src/Makefile:

Code: Select all

-	ln -s . "$(SYSROOT)/usr"
-	ln -s . "$(SYSROOT)/$(HOST)"
+	ln -sf . "$(SYSROOT)/usr"
+	ln -sf . "$(SYSROOT)/$(HOST)"

Re: Phase V - Recursive Osdev

Posted: Wed Apr 01, 2015 12:44 pm
by shikhin
=D>

Waiting for someone to post a "MyOS under Sortix under Sortix" on 1 April 2016, now...

Re: Phase V - Recursive Osdev

Posted: Wed Apr 01, 2015 11:59 pm
by Antti
This may be a silly and simplified question. If we had a single-file kernel, let it be SortieKernel.elf, and we would build it on Linux by using a cross-compiler, and the file checksum was "something". If you built it on Sortix, would the checksum be equal to the first one? What about the next iteration? And the next? And so on?