A dedicated kernel for multi-threading applications.

Friday, June 09, 2017

Testing Toro on KVM and Xen

Hi folks! These days I have been experimenting with Toro on KVM and Xen. This is still experimental work but it demonstrates how flexible Toro is. In KVM, I had very good results and ,with minor changes, Toro was running without any problem.




In Xen, I tried with an HVM guest. However, I can't go further than booting the kernel. It seems that I am getting a lot of exceptions when Toro tries to wake up the cores in the system.


I will focus on Xen in the next days. In addition, I am very interested in test Toro in Hyper-V so stay tuned!

Matias

Monday, June 05, 2017

E1000 driver is alive!

Hi folks! I spent this weekend trying to make the driver e1000 works. I started with this piece of code in 2011. I based on the code of Minix3. However, I could not go further than getting the MAC address, and then, I just gave up. I restarted last weekend and I did a great progress. I have almost the ToroPing.pas example working (see Figure 1). The key was to enable E1000_DEBUG in QEMU and put the hands in the code to understand as much as possible what the network card was doing. I will give more details about how enable debugging in QEMU in future posts.

Figure 1. ToroPing.pas running with E1000 driver.
 I will continue progressing on E1000 in the following weeks so stay tuned!

Matias



Monday, May 29, 2017

Progress on Toro Virtual Filesystem and tooling

Hi folks! the purpose of this post is to highlight the work done on Torokernel Virtual Filesystem.

Writing Operation support in VFS:
I implemented three new VFS functions: SysWriteFile(), SysCreateFile(), SysCreateDir(). I will not detail the aim of these functions which I think is obvious. However, their semantics could vary from other kernels. For example, SysCreateFile() first tries to create  a new file, if the file already exists it fails. In the case of SysCreateDir(), if the directory exists, it also returns with error.

Writing Operation support in Ext2 driver:
I added three new functions to give support to the new vfs features. These are Ext2WriteFile(), Ext2CreateFile() and Ext2CreateDirectory().

Pci unit:
I moved all the pci device detection to a new unit named Pci.pas. This makes the code in FileSystem.pas much more clear.

Tool to create an populate ext2 images in Windows 10:
To ease the filesystem manipulation, I compiled a simple version of genext2fs for Windows 10. This is a common tool in Linux system which allows to create and populate an ext2 image. In Windows 10, I could not find such a tool so I decided to port it by myself. Again, this is a simple port which may not work in all cases. However, it is working fine in my tests. You can find an user guide here.

TorowithFileSystem.pas project:
I updated this example to show the use of new vfs features. The example still relies on ToroFiles.img which is mounted and used to get /web/index.html. I updated the application to log in the directory /web/logs each time that client requests a page.  

This is more or less all the progress done in the last three months. Future work is the implementation of Continuous Integration to compile the tests examples so stay tuned!

Matias

Friday, May 12, 2017

Continuous Integration in torokernel (travis)


Hi folks, this weekend I spent some time playing around Travis. This is a tool for continuous integration which is very well integrated into Github. Travis makes very easy to build and run tests after a push or before a pull request for a given branch. 
I started my experiments with a simple idea: make a test to check if a simple application in Toro Kernel is correctly executed. To do this, I choose a simple application named ToroHello.pas which just writes "Hello World" to the serial console. To check this application, I set up Travis to do two things:
1. To compile ToroHello example and generate the booting image ToroHello.img.
2. To run the image in Qemu and test if the example worked.  
I based on a previous work in https://github.com/nielsAD/travis-lazarus. So 1) was easy to do and I got a ToroHello.img compiled by using Travis very quickly (see Figure 1). 
The task 2) took me a bit more time. I set up to run qemu after the building and to output the serial port to a file. Then, I tested if the output contains 'Hello world". In such a case, the test passed. Following pictures show the output of the job:

Figure 1. Travis compiling ToroHello.pas


Figure 2. Travis running ToroHello.img in Qemu and outputting the serial
Figure 2 shows the output from the serial port. We can see Toro's initialization at line 3574.

Figure 3. Result of the building

To summarizes, in a very short time I was able to compile ToroHello and then produce a test to verify its correct behavior. This is a simple example but it allows to show how powerful might be CI for a kernel. So I am planing to use Travis in two different levels of testing. The first level is to verify the compilation of the examples after a push and/or pull request. The second level is to write specific tests to measure performance, leaks, wrong behaviors, exception faults, etc. This needs however a lot more experimentation.

Matias