Farmix


Farmix is an open source operating system licensed under the GPL2. The short term goals is to be a teaching tool for myself and others and the very long term goal is to be a POSIX compatible operating system viable for desktops and server environments. Before you laugh, when I say long term I probably mean a decade. The source code is here

Why are you writing Farmix?



An operating system which controls the hardware and provides an standard, simple environment for user space programs pretty much encapsulates the most technical aspects of software development. My ability to write an operating system from scratch would represent a milestone in my technical ability and my commitment to mastering my chosen domain, even outstripping the benefits of having a Phd in operating system theory. This is my thought process at least.



I'm a very hands on person. For a long time I've always wanted to write an operating system but I've not known how to. Sure I dabbled in assembly and C at university, I have read books on Operating System too:



but how do you know when you're ready? I've always felt my knowledge of development wasn't strong enough but what don't I know that I need to know? Everyone has to start somewhere, to be given a starting point. Nobody just opens a text editor and starts typing the first line of code from day one. Certainly not if it's their first operating system. So what I did was simple. I googled "How to write an operating system". I followed a guide, copied and pasted the code snippets and voile, I ended up with something that boots up and writes "hello world" to the screen.

This is a huge accomplishment. Real, working and understandable commented code from which I can work backwards through and learn what it means retrospectively. I can see it, test it, actually understand it. Turning theoretical knowledge into actual technical knowledge. From there I can go out on my own. Find out how to detect memory on my development machine, play with it until I get it working, then go back and write clean code and the basis for a memory management unit. Then I move on to the next thing, a filesystem. Working through the components of an operating system until I have something user space programs can use effectively. Farmix is a teaching tool for myself although I hope to blog about the challenges here and describe what I've done for the benefits of others and to help me reflect on my experiences, further learning from them. I'm hoping this website will help a lot of people who want to write operating systems. I won't deny my approach is rather crass, to hack it, to play with it, to force out something that works. To force my way through something I don't understand, where my knowledge is weak and after I get something working to go back and clarify those holes in my knowledge when I clean the code up and write about it here. That is why I'm writing Farmix.

What's going to make Farmix special? What will make it popular?



I've already said I'm doing it for myself. Not for the sake of money or other things. However, having some goals gives you something to work towards. I've already declared up front that I want it to be viable on the desktop and server. Who doesn't wish the product of their labour to become well recognised and relied upon? It's just another benefit on top of being the teaching tool I already use it for.

So the idea is this. I want Farmix to be the simplest and easiest to read operating system out there supporting the minimum amount to be considered an operating system. I want it to be as easy to read as MINIX. That's a pretty achievable goal. I want university students to be able to download, compile and install Farmix, then be able to use it to test the theory behind their brand new scheduler algorithm, run it and prove it without having to understand everything about operating systems. I also want Farmix to be POSIX compliant with all it's complexities so that existing user programs such as X11 and Gnome can be ported to it, as well as being the most easily optimisable operating system so that in a server environment so you can get maximum resources from your dedicated app as possible. That's a nice, enormous collection of goals to aim for!

Those are pretty disparate goals however. How can something be simple to understand AND POSIX compliant? How can something be easy to read AND heavily optimised? This is where Patchwork comes in. Patchwork is a brand new patching tool I've written in conjunction with Farmix. Like apt or yum it applies source code patches with a notion of dependencies that allow an extremely flexible configuration or expansion of Farmix, whilst allowing the base code to be static and simple. Patchwork is key to making Farmix both simple and sophisticated.

So I put down Farmix to work on Patchwork. Patchwork is a complete application available from my Github account. I even wrote an article here about Patchwork. It isn't the success I wanted it to be. In fact it adds complexity but since Farmix is so new.. I'm still super optimistic about what I can do with it. Programming is my passion and even though my goals are enormous and my ideas don't always work there's still plenty of fun and learning to be had.

I've got a Raspberry Pi coming. It's a £35 ARM based computer the size of a credit card with no case, I hope to be porting Farmix from x86 to ARM for it. Fingers crossed and I hope you'll come visit when I report back my findings!

Phillip Taylor
Enthusiastic Operating Systems developer!