Software Architecture

The software architecture and source code structure

When designing XWOS, the author fully considered the reusability, portability, and compatibility with third-party software of the code.

The code is structured into multiple layers: build system, BSP, operating system kernel, middleware, and application.

XWOS Architecture
Photo: xwos.tech / CC-BY-SA-4.0

build system

  • xwbs : When users integrate 3rd-party software, they only need to set the source code list, header file path, and compilation options in xwmo.mk .

BSP

  • xwcd : Code related to compiler, CPU, SOC, and peripheral drivers
    • xwcd/ds : This folder contains the driver framework of XWOS. It is called XWOS Device Stack .
    • xwcd/perpheral : This folder contains various peripheral drivers implemented by XWOS Device Stack .
    • xwcd/soc : This folder contains various SOC porting code.
  • xwbd : This folder contains engineering configuration, debugging scripts, linking scripts, drivers, and applications related to various boards.

Kernel

XWOS Kernel Architecture
Photo: xwos.tech / CC-BY-SA-4.0

  • xwos : Kernel
    • xwos/osal : This folder contains source code of operating system abstraction layer. It unifies the kernel API for both uni-core kernel and multi-core kernel.
    • xwos/ospl : This folder contains source code of operating system porting layer . It defines the functions provided by the kernel to BSP, as well as the virtual functions that require BSP to provide implementation to kernel.
    • xwos/lib : This folder contains source code of basic C function library , including atomic operation library, bit operation library, data structure library, etc.
    • xwos/mm : This folder contains memory management
    • xwos/mp : This folder contains source code that implements a multi-core kernel.
    • xwos/up : This folder contains source code that implements a uni-core kernel.

Middleware

  • xwmd : Top folder of middleware
    • xwmd/isc : XWOS Communication Mechanism
      • xwmd/isc/xwcq : Cycle Queue
      • xwmd/isc/xwmq : Message Queue
      • xwmd/isc/xwssc : Inter-SOC Communication
      • xwmd/libc : Adaptation code for standard C library
      • xwmd/xwrust : XWOS Rust Framework
  • xwem : Third party open-source software
    • xwem/fs : file systems
    • xwem/serializing : serialization and deserialization
      • xwem/serializing/nanopb : protocol-buffer
    • xwem/vm : Interpretive Language Virtual Machine
      • xwem/vm/lua : Lua

Applications

  • xwam : This folder contains example code and application code.

Documents

  • xwxr : This folder contains configuration for automatically generating documents.