Planning Your T-Kernel Port
If you plan to port the T-Kernel to a new processor, there are quite a few things that you will need to think of. Before you jump straight into the process of doing the port, you need to “plan” for it. This article gives you a checklist that you can use to prepare yourself for the port.
- Processor: If you start on a port, you will need to target some processor. Currently, the open source T-Kernel has been ported to various 32-bit processors, based on CPU architectures from Renesas, NEC, Toshiba, and ARM. If you are porting to a similar processor, you are in luck! If the processor is very different, you will need to do a bit more work.
- Software: You need a compiler toolchain. The open source T-Kernel relies on the GCC toolchain. At the very least, you need a compiler, assembler, linker and some version of make.
- Environment: Initially, Linux would have been the preferred choice. But, in the past, I have used Windows for porting the T-Kernel, so Windows is fine, too. But, you will probably need Cygwin, if you plan to use Windows.
- Board: You could do quite a bit of your port using an Instruction Set Simulator for your target processor. But, at some point, you will need a board with the processor on it. The kernel itself will need about 70 – 80 Kilobytes of code space and at least about 6 Kbytes of RAM. Most development boards will have at least this much memory, so it should not really present any problems.
- T-Kernel Source Code: Of course, you need to get the T-Kernel source code and standard. Just follow the details given in my article on .
In addition, you need to know the following things about your target:
- You need to know how the main things work on your processor – memory usage, CPU initialization, interrupts, system calls and so on.
- You need to have a good understanding of the GCC tools and the T-Kernel. However, this site will help you with those aspects.
- Memory Map of your target board.
- Procedure to compile, link, download and debug code on your target processor.
You will benefit a lot from looking at ports of the T-Kernel to other processors. Also, it will help you if you have access to the source code of some other operating system, ported to your target processor. A lot of operating systems do very similar things at the core, so, a look at the source of another OS will give you clear ideas about how to proceed with your port.
At the very least, make sure that you can write a program, compile and link with GCC and get it to execute on a board/ simulator that has your target processor on it. It’s even better if this can output to some sort of display (maybe over a serial port) and if you know how to do things like examining the contents of registers, etc. while it is executing.