Development Environment

Source Code, Compilers, and System Generator

Linux Environment Support

If you have none of the supported reference boards at hand and still want to give SDVOS a try, there is still a way! I ported the kernel to the Linux environment and allowed it to execute as a Linux process. When compiled for the Linux environment, the context switch between tasks in SDVOS is implemented using the System V ABI compliant user-level context switching interface. All the modern Linux and UNIX-like distributions should have the support of this interface.

However, no matter what the architecture of your host operating system (32-bit or 64-bit) is, the SDVOS instance will always be compiled to a 32-bit program. This means on 64-bit platforms you need to install the necessary 32-bit libraries. Please refer to your distribution documentation for details of what you need. On Ubuntu Linux, you can do the following:

bash$ sudo apt-get install libc6-dev-i386

The major difference between a Linux SDVOS instance as compared to instances on actual reference boards is I/O. On Linux, no GPIO or any other drivers are supported except for the pseudo UART driver, which just prints to STDOUT. IRQs are emulated by POSIX signals. The system time source is provided by the POSIX per-process timer. Since the Linux kernel is still responsible for the actual machine I/O handling and process scheduling, you cannot expect any true real-time behaviors of SDVOS under the Linux environment.

Though there are some limitations of the Linux environment, the ability of running SDVOS as a process in Linux is still extremely useful. You can easily debug an SDVOS instance in Linux since it is a normal application process. No expensive and slow external debuggers are needed. It is also a very convenient and universal platform for the understanding of OSEK/AUTOSAR OS architecture. These are the reasons why I decided to do the port in the first place.

However, if you are planning on developing any real world applications on SDVOS, I still strongly recommend getting one of the supported reference boards (NUCLEO boards would the most ideal since they are best supported and tested).


When you configure an SDVOS instance for the Linux environment, you need to specify the BOARD attribute in the OS object to LINUX. You should also set the CPU name to Linux. An example might look like:

CPU Linux {
  OS HELLO_OS {
    STATUS = EXTENDED;
    STARTUPHOOK = TRUE;
    ERRORHOOK = TRUE;
    SHUTDOWNHOOK = FALSE;
    PRETASKHOOK = FALSE;
    POSTTASKHOOK = FALSE;
    USEGETSERVICEID = TRUE;
    USEPARAMETERACCESS = TRUE;
    USERESSCHEDULER = TRUE;
    DEBUGLEVEL = 2;
    BOARD = LINUX;
    DRIVER = "uart/linux_uart";
  };
  ...
};

After you configure the kernel with the system generator, the necessary headers and source files will be generated along with the kernel makefile. You can build the kernel by typing make and upload the kernel image to the board with make burn. When you type make burn, you are essentially executing the ELF application binary in the terminal. The upload command is defined in src/board/LINUX/config.mk:

UPLOAD_COMMAND = ./sdvos

sdvos is the kernel ELF binary you get after building the kernel.