πŸ‘‹ Welcome to the documentation of Xila

Xila is an open-source operating system aimed at embedded systems that provides a user-friendly interface with powerful features. It is designed to run on microcontroller with limited resources while providing efficient and scalable performance. The project aims to provide a fully functional operating system that can perform tasks such as multitasking, memory management, input-output handling, and file system management in constrained environments.

With Xila, developers can build applications for all sorts of end-devices like robotics, smart home automation, wearables, and much more. Xila provides its users with a structured API, a high-level programming language, powerful tools, and clear documentation for ease of use and integration.

The key objective of the project is to make development faster by leveraging Xila’s modular architecture, expandable library of drivers and libraries, and well-documented codebase. By utilizing these tools, developers can rapidly prototype and deploy new products without worrying about lower-level details.

πŸƒ Getting started

Get started to use Xila.

πŸš€ Get started

Here you will find how to get started with Xila.

Get started using Xila on native

Here you will find how to get started with Xila hardware and software.

βœ… Requirements

πŸ“– Steps

  1. Clone recursively the Xila repository on GitHub.
git clone https://github.com/Xila-Project/Core --recurse-submodule
  1. Change directory to the cloned folder :
cd Core
  1. Source the Export.sh script in the cloned folder :
source Export.sh
  1. Run Xila :
xila run <target>
  1. (Optional) If you want to build software for Xila, you can also install WASM32 / WASI target for your favorite langage.

    • For Rust :
    rustup target add wasm32-wasip1
    

πŸš€ Get started using Xila on embedded

Here you will find how to get started with Xila hardware and software.

βœ… Requirements

  • Rust
  • gcc-multilib : to build 32-bit binaries on 64-bit systems

πŸ“– Step

  1. Install your target’s toolchain, either by using the rustup target add command or by installing it manually (espup).

  2. Follow the instructions in the native section to clone the repository and source the Export.sh script.

πŸ“‘ Software reference

This section provides a detailed description of the software components of the project.

🏷️ Nomenclature

Here you will find the nomenclature and casing conventions used in Xila. I know, it doesn’t follow the Rust naming conventions but it my own convention and I like it.

General rules

For all the identifiers:

  • All the names are in English.
  • Each identifier starts with a capital letter and is then camel cased (e.g. This_is_an_identifier).
  • Each words are separated by an underscore _.
  • No abbreviation.

Types

All types should end with _type suffix.

Functions

For functions, use the following rules:

  • Constructor : starts with New.
  • Accessor : starts with Get or Set.
  • Callback : ends with _callback suffix.
  • Others : starts with a verb corresponding to the main action it performs.

Comments

For comments, use the following rules:

  • Use // for single line and multi-line comments (no /* */).
  • If the comment concerns a block of code, add - corresponding to the scope level of the comment.

πŸ“¦ Modules

Each subsystem of Xila is implemented as a module. Modules are designed to be as independent as possible, allowing for easier maintenance and development. Each module is responsible for a specific task, such as managing the filesystem, handling the user interface, or managing tasks.

List of modules

πŸ—ƒοΈ File system

Xila provides a file system API that allows to manage files and directories on the storage device. In a similar way to Linux, Xila uses a virtual file system that abstracts every peripheral/device as a file.

File systems

Each file system is mounted in the virtual file system and can be accessed through the virtual file system API. A file system can be implemented though the File_system::File_system_trait trait.

File types

Xila supports the following file types:

  • File: A file is a sequence of bytes that can be read and written.
  • Directory: A directory is a file that contains a list of files and directories.
  • Device: A device is a file that represents a peripheral or a device.
  • Pipe: A pipe is a file that allows inter-process communication.

Identifiers

When opening a file, a Unique_file_identifier_type is returned. This identifier is made of a File_system_identifier_type and a File_identifier_type. The File_system_identifier_type is used to identify the file system that the file belongs to, while the File_identifier_type is used to identify the file within the file system.

🏁 Task

Xila is a multitasking operating system. It is designed to run multiple tasks simultaneously. Each task is a separate program that runs independently of the others. Tasks can communicate with each other using messages and events.

Management

Tasks are managed by the kernel, more specifically by the Task::Manager_type. The task manager is responsible for registering tasks and their metadata. However, the scheduling is delegated to the underlying (RT)OS.

Implementation

Under the hood, tasks are implemented as a std::thread::Thread. However, on regular operating systems, tasks are executed similarly to threads, but on microcontrollers, tasks are executed in a cooperative multitasking manner. This means that tasks must yield control to other tasks in order to allow them to run.

Memory

Each task has its own stack, however, due to the absence of MMU in most microcontrollers, the memory space is shared between tasks and thus tasks can access each other’s memory. This is a limitation of the current implementation and may change in the future.

Metadata

Each task has metadata associated with it. This metadata includes :

  • Name: The name of the task.
  • Priority: The priority of the task.
  • State: The state of the task (running, ready, blocked, etc.).
  • Stack size: The size of the stack allocated to the task.
  • Parent: The parent task of the task.

Priority

Each task has a priority level, which determines the order in which tasks are executed. Tasks with higher priority levels are executed before tasks with lower priority levels.

ℹ️ About

This section provides information about the Xila project, its goals, and its contributors.

🎯 Goals

The Xila project aims to provide a simple, efficient, and secure operating system for embedded systems. It is designed to be easy to use and to provide a wide range of features to help developers create applications quickly and easily.

πŸ§‘β€πŸ’» Author

The Xila project is developed by Alix ANNERAUD.

πŸ“œ License

This project is licensed under the MIT License. For more information, please refer to the LICENSE file.