Hello World!

My name is Jorge Kinoshita. I teach Operating Systems at "Escola Politecnica da Universidade de Sao Paulo". I am really grateful to be assigned to this discipline. I have been teaching it for well more than a decade. I have always thought that every student should put his hands on the source code of a particular kernel in order to grasp some concepts, similar to what happens when learning how to program. It is necessary a specific language as well as a specific kernel.
Today it is easy to find source code kernels, but it was not so, some time ago.
A veteran is Minix, the father of Linux.
I used Minix for many years.
Minix was developed by Tanenbaum and his students at Holland around 1980 decade. He used a compiler made by them. It is a micro kernel operating system; that means running just few code in kernel mode and lots of code in user mode when attending to system calls. Linus Torvalds was a student in Filland in 1991. For sure, Torvalds read a lot of Tanenbaum's book: "Operating Systems, Design and Implementation". He mastered Minix and concluded that micro kernel had a lot of performance problems and it would be much better to work with another compiler: gcc - GNU compiler - an open code compiler supported by MIT. Thus, he created Linux.
The source code of Linux is still evolving.
As a professor, I would like a kernel source code that is:

  • more static, to teach students. Minix is far behind from Linux today; in fact, up to my knowledge, Minix is used just for educational purposes.
  • easy to read. Tanenbaum advocates and I agree that a micro kernel source code is easier to read.
Thus, it seemed that Minix would be a great choice. Some problems that I found with Minix are:
  • It is not true that Minix source code is static. In fact, the source code commented in his books is very different from what is more easily found in http://www.minix3.org . I had a lot of problems with students choosing wrong versions of Minix, with different problems in installation, reading the code, etc. For instance: let us suppose that I ask a student to implement virtual memory (I would not do this, but just for illustration) in Minix 3 of the book. A student could take another version with virtual memory in the site.
  • It is a fact that micro kernel source code is easier to read but, in Minix case, it is far from being easier to debug. Today, it is possible to debug the Linux kernel looking to its source code, line by line due to virtualization, more specifically, qemu and gdb.
  • The Minix book is very poor on suggesting good exercises to be made on Minix kernel source code. I was always figuring out some new exercises that made students to learn how the micro kernel and its companion user processes accomplish a system call or an how a hardware interruption is treated. In fact, due to the 386 intel mess, I would like to have made more exercises on interruption, but I could not.
  • It is very difficult to understand the Minix interface to the hardware. Unfortunately, Minix uses intel 386 which is really unnecessarily complex (to be compatible with intel former processors). How can I expect that a student understands how in fact occurs a process switch? Tanenbaum made the code but is well far from being explained. For a long time, I think that process switch and interrupt handling are very important when teaching operating systems, however Minix does not helped me on this important issue.
  • I began to divide my class in two groups: some would work on Minix and others on Linux. The disappointment of the students that were assigned to Minix were visible in their faces. I could not blame them!
In face of the Minix problems and the Linux still going development, I had to choose Linux. Let us see why:
  •  I also teach microprocessors. I base my course on ARM architecture that is way easier to understand than Intel 386. I was always trying to integrate microprocessors and operating systems. Linux was running on ARM, in fact, all android smart phones run Linux, so Linux would be a great choice to integrate microprocessors and operating system disciplines.
  • Linux runs on qemu - a virtual machine that also emulates ARM. Obviously Minix runs on virtual machines (qemu included) but on 386 intel. 
  • Linux was created on the GNU environment, so the Linux source code may be debugged by gdb connecting to qemu. To my knowledge, this is impossible to Minix. Perhaps, it will become possible one day as Minix is being compiled on GNU nowadays. It is possible to see the Linux source code being debugged step by step, in ARM instructions (easier to understand) a great point to Linux!
  • You can not imagine my relief when all the complaints about Minix (installation, version problems, etc.).
  • Last year, another accomplishment: students put all linux source code, qemu, arm cross development tool chains, etc.  on a docker image. Up to 2017, it was somehow difficult to arrange all things in a machine, mainly, Windows machine. Imagine to ask for some students who had never seen Linux, to install qemu, tool chains, learn gdb, etc. and create a Hello World system call in just 2 weeks! This year, I expect this docker image will make my life easier. A great point about all this, is that the Linux source code is frozen in this docker image. 
In the next post, I will present how we are going to work with this docker image.



Comentários

Postagens mais visitadas deste blog

Basics on ARM processor

Assignments - 1

2. run gdb