This project is a rewrite of my previous handheld console OS [viewtopic.php?t=57735] for a dual-core Cortex-A35 system (specifically STM32MP2).
The kernel itself is written in C++20 and leverages safe(r) programming practices as much as possible e.g. use of references and smart pointers rather than raw ones. Obviously safety is relative here because the device itself features multiple hardware DMA masters with limited firewall protection.
Features include:
- Armv8-A SMP scheduler with multiple active processes + threads
- Syscall interface with wrappers for most POSIX functions
- High resolution (10 ns precision) timer provided to games
- pthread support including threads, mutexes, semaphores, conditions, rwlocks and barriers
- A port of the etnaviv GPU driver allowing hardware-accelerated OpenGL
- Driver for Infineon CYW43439 chipset and IPv4 network stack, sockets and ntp client.
- SD card driver (with UHS-I mode support) with Ext4 (Lwext4) and FAT (fatfs) drivers
- USB driver allowing the device to present itself as a mass storage device to allow provisioning the internal SD card
- Offloading of all input tasks, including tilt sensor and touch screen filtering, to Cortex-M33 core within the device (running separate firmware)
- Cold boot to fully loaded menu system within 4 seconds
The kernel code, hardware schematics and some example images are available at [https://github.com/jncronin/gk] with additional userspace code at [https://github.com/jncronin/gk-userland]
The userland contains:
- GCC/binutils/newlib ports
- Extra libc/POSIX code not provided by newlib (gloss-gk library)
- Many libraries useful for handheld game console development including SDL2, SDL1.2, LVGL9, FreeType, Ogg, Vorbis, FLAC, OpenAL, FluidSynth, Timidity and either Mesa 26 with hardware GPU support or Mesa 20 with LLVM 14 and llvmpipe.
This allows the device to run an array of games/emulators including mednafen, hatari, PCSX, Mupen64plus, Atari++, DOSBox-X, neverball, neverputt, koules, tuxracer etc.
This project is my first attempt at a Armv8-A kernel and I have so far been impressed with its simplicity and "clean-break" from previous 32-bit versions. Combined with the fixed hardware this has made the project both enjoyable and actually feasible for a single developer (no need to write drivers for every single piece of hardware). Unfortunately now the project is complete I spend far more time playing it than developing it, so there may not be many updates for a while...
