Trainos
microkernel developed for playing with trains
Install / Use
/learn @MrPicklePinosaur/TrainosREADME
TrainOS
microkernel developed for playing with trains
</div>Features
- Fully functional multitasking kernel with interprocess communication mechanisms
- Custom standard library built from the ground up
- Intelligent train control for the marklin train set
- Stylish terminal user interface for monitoring and sending commands to trains
Running the code
Make a copy of config.mk.example called config.mk:
cp config.mk.example config.mk
Then, in config.mk, replace /u/cs452/public/xdev with the location of your toolchain directory.
Build the project:
make
This should generate a trainos.img file. Upload this image file to https://cs452.student.cs.uwaterloo.ca/. This should get it onto the Raspberry Pi.
Turn on the Raspberry Pi (or restart it if it's already on). Wait for the TrainOS kernel to boot up.
<!-- Below the TrainOS logo and the UW course gacha, there should be a prompt asking you to `SELECT TASK TO RUN`. Each task is assigned a number; type in the corresponding number to run that task. The RPS test is the task called `K2` while the performance test is the task called `K2Perf`. --> <!-- You can find the CSV file for the K2 performance test at `docs/K2Perf.csv`. -->Running in simulator
WARNING: currently qemu only supports raspberry pi 3, so there may be unexpected between the simulator and the actual lab raspberry pis.
The kernel can be inside qemu and remotely debugged using gdb. Ensure that you have the following installed:
- qemu-system-aarch64
- gdb-multiarch
First build the image with the QEMU=1. You can set the value in your
config.mk or pass it to make when building:
make clean; make QEMU=1
Start qemu with the trainos image:
./scripts/sim.sh
This will start a gdbserver on port 1234. Next start gdb-multiarch and run:
(gdb) target remote :1234
Directory Structure
kern: kernel codeuser: user programslib: library implmentationinclude: header files for libraries
Related Skills
node-connect
353.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
353.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
353.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
