🏷️Moonix
- A Real-Time Operating System(RTOS) targeted for the ARM Cortex-A8 board.
- github
📌1. Key Features
- Non-Preemptive Scheduling
- Configuration and management of Timer, UART, and Interrupt Controller.
- Interrupt and Exception Handling
- Inter-Process Communication (IPC)
- Synchronization Mechanism
📌2. Development Environment
Category | Tool/Technology |
---|
Languages | C, ARMv7-A Assembly |
Editor | vim |
Build Tools | gcc-ARM-none-eabi |
Other Tools | git, make, shell scripts, gdb, qemu |
📌3. Design
- Selection of operational modes for ARM to optimize performance.
- Utilized HAL to enhance code portability across different hardware platforms.
- Designed the memory structure.
- Designed kernel data structures for Tasks, Interrupts/Exceptions, and IPC.
- Chose Non-Preemptive Scheduling to manage process execution priorities.
- Developed mechanisms for task synchronization within the kernel.
- Designed kernel API functions to facilitate interaction with the OS functionalities.
📌4. Implementation
- Conducted initial hardware setup upon power-up of the ARM core.
- Differentiated and processed various types of interrupts using the Interrupt Controller.
- Developed kernel API functions and essential libraries.
- Implemented context switching and designed scheduler/dispatcher
- Developed IPC mechanisms using message queues and event flags.
- Implemented semaphores as a synchronization tool to manage access to resources.
📌5. Directory Structure
moonix
├── boot
│ ├── Entry.S // Contains the exception vector table.
│ ├── Handler.c // Defines IRQ and FIQ exception handlers.
│ └── Main.c
├── hal // Hardware Abstraction Layer
│ ├── HalInterrupt.h // Common API functions for interrupts.
│ ├── HalTimer.h // Common API functions for timer management.
│ ├── HalUart.h // Common API functions for UART.
│ ├── rvpb // Machine-specific code for RealView PB.
│ │ ├── Interrupt.c // Interrupt-specific common API functions.
│ │ ├── Interrupt.h // Interrupt controller structure declaration.
│ │ ├── ISP1761.h // USB structure declaration.
│ │ ├── Regs.c // Variables for hardware access.
│ │ ├── Timer.c // Timer-specific common API functions.
│ │ ├── Timer.h // Timer structure declaration.
│ │ ├── Uart.c // UART-specific common API functions.
│ │ └── Uart.h // UART structure declaration.
│ └── versatilepb // Machine-specific code for Versatile PB.
│ └── nuri // Machine-specific code for Nuri.
├── include
│ ├── ARMv7AR.h // Macros for operating modes.
│ ├── CtrlBit.h // Bit manipulation macros.
│ ├── MemoryMap.h // Memory mapping macros.
│ ├── stdarg.h // Variable arguments macros.
│ ├── stdbool.h
│ └── stdint.h // Primitive system data types (C99).
├── kernel
│ ├── message.c // Message queue.
│ ├── message.h
│ ├── event.c // Event flag.
│ ├── event.h
│ ├── kernel.c // Kernel API.
│ ├── kernel.h
│ ├── priorityBased.c // Priority scheduling.
│ ├── roundrobin.c // Round-robin scheduling.
│ ├── task.c // Task creation and initialization, TCB.
│ └── task.h // TCB and task context structures.
├── lib
│ ├── armcpu.c // Code to enable/disable IRQ and FIQ.
│ ├── armcpu.h
│ ├── dispatch.c // Context switching.
│ ├── dispatch.h
│ ├── stdio.c // Defines the printf function.
│ └── stdio.h
│ └── stdlib.c // Defines library functions.
│ └── stdlib.h
├── Makefile
├── moonix.ld // Linker script.
└── README.md
📌6. References
6-1. Timer (SP804)
6-2. Philips ISP1761 controller
6-3. UART (PL011)
6-4. GIC
6-5. RealView PB