The hypervisor toolkit releases contain prebuilt versions of the hypervisor image, tools and documentation. The toolkit releases are specifically tailored for application development on top of Codezero.
This is a quick getting started guide that explains how to download, install, build and develop on Codezero Embedded Hypervisor Toolkit releases.
% man utcb % man l4_map % man l4_ipc % man capability
on the terminal should give quick and detailed reference on these API elements, without need to scroll on the website and reference manual.
Building and running the default installation container should print 'Hello World!' on the terminal screen.
Once the toolkit is installed, Codezero can be build for Pandaboard issuing following command in toolkit's codezero directory:
% ./build.py -f prebuilt/config.cml -b
If everything goes fine, an elf binary, 'final.elf', will be built under 'build/'.
To run Codezero on Pandaboard using a MMC/SDHC card use the following procedure:
% codezero/prebuilt/MLO % codezero/prebuilt/u-boot.bin % codezero/build/final.elf
This will start booting Codezero on Pandaboard and run 'Hello World' container printing 'Hello World'.
PS: QEMU doesnot support OMAP4/Pandaboard as of now.
Codezero developer toolkit provides a complete development environment for baremetal and multithreaded applications.
Let's consider a scenario where a software stack that acts as an interactive shell is to be ported to Codezero. Let's assume that the shell uses a certain amount of physical memory, requires 3 threads, a synchronization mechanism between threads, and access to UART for input/output. Below are the basic steps that would be required for porting:
If you plan to develop a userspace software layer or port a baremetal stack on top of Codezero embedded hypervisor, the current setup would be sufficient.
The development cycle would be such that new changes would be made, recompiled, and tested on QEMU/Insight, as described in the steps above.
For further information, please consult the Codezero Overview document, API Reference and join our codezero-devel mailing list, where technical issues about the Codezero microkernel are discussed.
The Codezero project uses the Codesourcery ARM cross-compilers for compiling the sources. Other cross-compilers, such as crosstools, may work, but testing only has been done using this toolchain.
For installing the cross-compiler toolchain, please follow the steps below.
a. Create a directory for the cross-compiler toolchain:
% mkdir /opt/archives/cc
b. Download the latest GCC ARM cross-compiler toolchain (IA32 GNU/Linux Installer) for ARM EABI from: http://www.codesourcery.com/sgpp/lite/arm/portal/subscription3053
Download latest GCC ARM cross-compiler toolchain (IA32 GNU/Linux Installer) for GNU-LINUX from: http://www.codesourcery.com/sgpp/lite/arm/portal/subscription3057
We have tested 2009q1 and 2009q3 toolchains, so preferably download any of these.
c. Save both files to /opt/archives/cc.
d. Use the following shell commands to configure and install the toolchain:
% cd /opt/archives/cc % chmod 777 arm-2009q3-68-arm-none-eabi.bin
The last command would grant execution rights to run the binary, but root permission may be needed to achieve this.
% . arm-2009q3-68-arm-none-eabi.bin -i console
The command above will start installing the toolchain. Choose appropriate options when prompted during the installation of the toolchain.
e. Repeat step (d) above for installing arm-2009q3-67-arm-none-linux-gnueabi.bin binary.
f. Add the following lines at the end of the .bashrc file presently in the home directory of the current user (for example /home/amit for a fictional user named amit):
% PATH=$PATH:/opt/tools/cc/bin % export PATH
This will add the path of the installed toolchain binaries to the PATH environment variable. Please note that for the new .bashrc to be effective, a new console should be started. For making changes in .bashrc to be effective in the currently running console, please use the following command in the console:
% source /home/user/.bashrc
% arm-none-eabi-gcc –help
This should display the help section of the installed GCC cross-compiler.
Insight is a GUI front end for GDB. GDB takes its configuration from the ”.gdbinit” file, which should be present under the home directory of the current user. (For example /home/amit for the fictional user named amit). To connect GDB to QEMU that is running Codezero and load its symbols, the following commands should be written to the .gdbinit file, line-by-line. Note the file is broken up below to explain each step.
target remote localhost:1234
tells GDB to connect to QEMU.
load final.elf
loads the following image every time gGDB connects to QEMU.
sym final.elf
tells GDB to use the following filename for symbol information.
break break_virtual
A break_virtual symbol is defined as standard in Codezero builds, to mark the execution right after virtual memory is enabled. From this point onwards, it becomes possible to step through the code as desired. This command makes GDB stop right after virtual memory is enabled.
continue stepi
These commands tell GDB to start from beginning, step over one instruction after the break_virtual breakpoint is hit. This will allow insight to refresh its screen with the new symbol table.
sym kernel.elf
This command tells GDB to use the kernel.elf file for symbol information that includes Codezero symbol information after virtual memory is enabled.
Please copy this file over to your home directory:
% cd codezero % cp ./tools/gdbinit ~/.gdbinit
The script above contains all the necessary commands to start QEMU, load final.elf, start Insight, and initiate execution until the point where virtual memory is enabled inside the Codezero microkernel. Here, some logic is provided by the .gdbinit file under the home directory for loading the symbols and setting the breakpoint during an Insight/GDB startup.
Running the script simply starts everthing and executes Codezero until virtual memory is enabled:
% cd /opt/codezero % ./tools/run-qemu-insight
Taking a closer look at the run-qemu-insight script:
% cd /opt/codezero/tools % gedit run-qemu-insight
opens up the file, which contains the lines:
cd build qemu-system-arm -s -kernel final.elf -m 128 -M versatilepb -nographic & arm-none-insight ; pkill qemu-system-arm cd ..