How myeongcheolko/kortos works
KoRTOS is a bare-metal Cortex-M4 RTOS paired with an STM32F446 register-level HAL. An application creates tasks and synchronization objects, starts the kernel, and the scheduler dispatches tasks using the Cortex-M port; tasks may use kernel queues, semaphores, and mutexes or access peripherals through HAL drivers. The README documents the kernel/port split and HAL capabilities; sampled source confirms scheduler/port and selected app-to-driver relationships. Other HAL-to-kernel wiring is not assumed.
Main entry points: kortos_hal.h HAL include interface · kernel.c Scheduler and primitives · CAN_loopback_mutex_queue.c Application tasks · port.c Context switching
Components 19
Portable kernel
- Kernel API
kernel/kortos.h - Scheduler and primitives
kernel/kernel.c - Kernel configuration
config/kortos_config.h
Cortex-M4 port
- Context switching
port/arm/cortex_m4/port.c - Port interface
port/arm/cortex_m4/port.h
STM32 peripheral HAL
- GPIO driver
kortos_hal/STM32F446xx/GPIO.c - SPI driver
kortos_hal/STM32F446xx/SPI.c - I2C driver
kortos_hal/STM32F446xx/I2C.c - USART driver
kortos_hal/STM32F446xx/USART.c - CAN driver
kortos_hal/STM32F446xx/CAN.c - Peripheral registers
kortos_hal/STM32F446xx/STM32F446xx.h - Clock control
kortos_hal/STM32F446xx/rcc.c - HAL include interface
kortos_hal/STM32F446xx/kortos_hal.h
Board bring-up
- Startup and vectors
bsp/STM32F446xx/startup.c - System calls
bsp/STM32F446xx/syscalls.c - Heap support
bsp/STM32F446xx/sysmem.c
Sample applications
- Application tasks
sample_apps/kernel/CAN_loopback_mutex_queue.c - SPI exchange demo
sample_apps/hal/SPI_send_receive_arduino.c
Other components
- Application developer
Connections 18
- Application developer → Application tasks: implements
- Application tasks → Kernel API: calls
sample_apps/kernel/CAN_loopback_mutex_queue.c - Kernel API → Scheduler and primitives: implemented by
kernel/kernel.c - Scheduler and primitives → Context switching: yields to
- Context switching → Scheduler and primitives: ticks and schedules
port/arm/cortex_m4/port.c - Scheduler and primitives → Kernel configuration: uses settings
- Application tasks → CAN driver: transmits frames
sample_apps/kernel/CAN_loopback_mutex_queue.c - Application tasks → GPIO driver: configures pins
sample_apps/kernel/CAN_loopback_mutex_queue.c - SPI exchange demo → SPI driver: exchanges data
sample_apps/hal/SPI_send_receive_arduino.c - SPI exchange demo → GPIO driver: reads and toggles
sample_apps/hal/SPI_send_receive_arduino.c - HAL include interface → GPIO driver: includes
kortos_hal/STM32F446xx/kortos_hal.h - HAL include interface → SPI driver: includes
kortos_hal/STM32F446xx/kortos_hal.h - HAL include interface → I2C driver: includes
kortos_hal/STM32F446xx/kortos_hal.h - HAL include interface → USART driver: includes
kortos_hal/STM32F446xx/kortos_hal.h - HAL include interface → CAN driver: includes
kortos_hal/STM32F446xx/kortos_hal.h - Startup and vectors → Scheduler and primitives: starts runtime
- Port interface → Context switching: declares services
port/arm/cortex_m4/port.c - Peripheral registers → Clock control: defines registers