4. WrmOS: kernel

← 3. WrmOS: bootloader

5. WrmOS: root-pager Sigma0 →

Contents
4.1 Overview
4.2 Configuration parameters
4.3 System calls

4.1 Overview [up]


The main document for L4 microkernel is L4 Kernel Reference Manual Version X.2. It describes kernel API, ABI and principles of L4 Operation System.

Kernel is the core part of WrmOS witch is executed on target CPUs in privileged mode. The following actions must be doing by kernel:

  • complete system initialization
    • initialize MMU
    • initialize kernel UART
    • initialize Interrupt Controller
  • create root-pager Sigma0 and execute it
  • process system exceptions, IRQs and system calls in runtime

4.2 Configuration parameters [up]


Kernel has the next configuration parameters:

Name Location Description
usr_krn_dbg cfg/prj/<project-name>.prj Kernel debug flag. My be 0 or 1. It allows to use debug configuration with asserts, additional debug outputs and other (for 1) or use release configuration (for 0).
usr_krn_log Kernel logging enable flag. May be 0 or 1. It enables internal kernel logging, that allows to see kernel activities and actions.
krn_vaddr cfg/plt/<platform-name>.plt Start of kernel virtual addresses.
krn_tick_usec Kernel tick in microseconds. Kernel periodically timer will tick every krn_tick_usec microseconds.
krn_uart_paddr Kernel UART physical address.
krn_uart_sz Kernel UART size in bytes.
krn_uart_bitrate Kernel UART bitrate.
krn_uart_irq Kernel UART interrupt number.
krn_intc_paddr Interrupt Controller physical address.
krn_intc_sz Interrupt Controller size in bytes.
krn_timer_paddr Kernel Timer physical address.
krn_timer_sz Kernel Timer size in bytes.
krn_timer_irq Kernel Timer interrupt number.

4.3 System calls [up]


Full description of L4 system calls there is in L4 Kernel Reference Manual Version X.2. Short description of system calls is listed below:

System call Privileged L4 API Description
Kernel Interface Any applications l4_kip() Get Kernel Interface Page.
Exchange Registers Any applications l4_exchange_registers() Read or modify: stack pointer, instruction pointer, thread flags, pager, user defined handle.
Thread Control Root-pager, Root-task l4_thread_control() Root-pager Sigma0 or root-task Alpha can create and delete thread.
System Clock Any applications l4_system_clock() Get current system clock (system uptime in microseconds).
Thread Switch Any applications l4_thread_switch() Release the CPU.
Schedule Any applications l4_schedule() Change thread parameters: priority, timeslice length and other scheduling parameters of threads.
IPC Any applications l4_ipc()
l4_send()
l4_receive()
IPC is the fundamental operation for inter-process communication and synchronization.
Unmap Any applications l4_unmap() Unmap memory from caller address space.
Space Control Root-pager, Root-task l4_space_control() Root-pager Sigma0 or root-task Alpha can configure address space.
Processor Control Root-pager, Root-task --- Control the internal frequency, external frequency, or voltage for a system processor.
Memory Control Root-pager, Root-task l4_memory_control() Set the page attributes. For example cached or not.
Kernel Debugger Any applications l4_kdb() Kernel debugger system call.

← 3. WrmOS: bootloader

5. WrmOS: root-pager Sigma0 →