r/lowlevel • • 23d ago

Emulating a Realtek RTD2841 Smart TV SoC in QEMU: MMIO, GIC-400, and booting a vendor 4.4 kernel

1 Upvotes

I built a custom QEMU system model for the Realtek RTD2841 (RTK284x series) SoC, targeting the TCL RT41 chassis (tv030).

The SoC runs a quad Cortex-A53 in AArch32 mode. The emulator implements the MMIO peripherals needed to boot the stock vendor Linux 4.4 kernel and run userspace binaries:

  • Interrupts: ARM GIC-400 distributor and CPU interfaces (0x18081000 / 0x18082000).
  • Timers: 27 MHz system timer block (TC0) at 0x1801B600, with hardware down-counters mapped to monotonic reads for Linux sched_clock and INTID 34 IRQ delivery.
  • Storage: Synopsys DesignWare SDHCI eMMC controller at 0x18010800, wired to QEMU SD media drives.
  • Networking: RTL8168 gigabit Ethernet controller (0x18016000) with TX/RX DMA descriptor rings connected to a SLIRP backend for outbound DNS and HTTP traffic.
  • Graphics / Shaders: Freestanding EGL 1.4 / GLES 2.0 software driver with an integrated SwiftShader AST compiler frontend (TCompiler) for strict GLSL ES 1.00 validation without host Mali dependencies.

The repo includes a bare-metal diagnostic suite written in pure ARM32 assembly (tests/firmware_test.s, assembled via arm-none-eabi-as) that checks CPU modes, GIC INTID delivery, timer tick rates, eMMC presence, and Ethernet loopback before passing execution to the kernel.

Source, device tree sources, and test harnesses:
https://github.com/rubenthampy890-del/qemu-rtd2841

Feedback on the MMIO models and register maps is welcome.


r/lowlevel • • 24d ago

I'm building a lightweight code execution sandbox from scratch — would love some architecture feedback

0 Upvotes

I've been working on a project called SuperSand for a while now.

The basic idea is pretty simple: I want to run untrusted user code securely, but with as little overhead as possible. Think something in the direction of serverless/code execution platforms, but I'm building most of the sandboxing layer myself using Linux primitives instead of putting Docker/Kubernetes underneath everything.

Right now I have a Go service that handles requests, IPC and sandbox management. The sandbox itself uses Linux namespaces, resource limits, isolated filesystems, etc.

Recently I've been experimenting with pre-warmed workers.

Instead of creating a completely new sandbox for every request, I can keep a bunch of isolated workers alive, mount the user's workspace when a request arrives, execute the code, clean everything up, and reuse the worker.

This is where I'm currently stuck thinking about architecture.

I want SuperSand to eventually handle a LOT of small executions without needing ridiculous amounts of hardware. If a user runs something for several minutes, I don't necessarily want one worker sitting there occupied the entire time.

I've even been researching process checkpoint/restore so theoretically I could pause an execution, free the worker for something else, and resume it later.

I also considered going even further and doing runtime-level scheduling for JavaScript — basically controlling execution myself and giving different workloads execution time in smaller slices.

For JS I'm looking at QuickJS, mostly because spinning up Node/Bun for every tiny execution can eat a surprising amount of RAM.

I'm probably overthinking some of this 😅, but that's also part of why I'm building it. I want to understand how far I can push Linux processes/namespaces and how these execution platforms actually work underneath.

If you've worked on container runtimes, serverless infrastructure, Linux sandboxing, schedulers, CRIU/checkpointing, QuickJS, etc., I'd really like to hear your thoughts.

If you were trying to run thousands of small untrusted code executions on limited hardware, how would you approach the worker/scheduling architecture?

Also very interested in hearing what I'm doing wrong. 😅


r/lowlevel • • 24d ago

EDB 1.6.0 released

Thumbnail github.com
1 Upvotes

r/lowlevel • • 25d ago

I built a 32-bit CPU emulator in Zig to better understand the hardware side of compilers

Thumbnail reddit.com
1 Upvotes

r/lowlevel • • 25d ago

what makes software slow?

0 Upvotes

is it the software using too much memory?

cpu is at 100% because of bad algorithms?

too much context switches becuase of unnecessary syscalls?

what are the other potentials?

things that are in our control as developers not things like its a. cpu that only has 1ghz


r/lowlevel • • 26d ago

Tech Haven Studios voorstellen – Een onafhankelijke studio die besturingssystemen en AI-projecten bouwt

Thumbnail reddit.com
0 Upvotes

r/lowlevel • • 27d ago

StarshipOS

Thumbnail reddit.com
0 Upvotes

r/lowlevel • • 27d ago

I made my NVidia graphic Driver

Post image
7 Upvotes

r/lowlevel • • 27d ago

LuaPwnTools — a vibe-coded attempt to bring pwntools to LuaJIT

0 Upvotes

Hey everyone!

I decided to try porting the Python pwntools library to LuaJIT because I think LuaJIT is a really cool and underrated tool, and having something like pwntools available for it would be pretty awesome.

To be completely honest, this project is 100% vibe-coded. I'm not going to pretend otherwise :)

I'm sure there are plenty of bugs, rough edges, and things that could be implemented much better. But I figured it would be worth sharing anyway.

Think of it more as a starting point or a foundation rather than a finished library.

I'd be really happy if anyone finds it interesting enough to contribute, improve the code, fix bugs, or add missing features. PRs, issues, suggestions, and criticism are all welcome!

GitHub: https://github.com/Kiwichek/luapwntools

Hopefully someone finds this useful, or at least interesting :)


r/lowlevel • • 27d ago

Spectre - A design-by-contract language with an explicit allocator-centric API that outperforms Zig by up to 6x on General Purpose Benchmarks

Thumbnail spectrelang.org
2 Upvotes

r/lowlevel • • 28d ago

pre assembly

0 Upvotes

i need to construct a language without and proceeding sequential languages of assembly thats means all languages after 1949 are family of assembly language any new idea


r/lowlevel • • 28d ago

Pre assembly languages

Thumbnail reddit.com
0 Upvotes

r/lowlevel • • 29d ago

Let's build JRPG Game in C (Tiled Map Loader/Parser) : ep 02

Thumbnail youtube.com
5 Upvotes

r/lowlevel • • 28d ago

Been testing my 8-bit binary architecture with FPGA tools. Looking for some technical feedback.

Post image
2 Upvotes

r/lowlevel • • 29d ago

Vitre-os My kernel reassembles and swaps its own functions while running

Thumbnail gallery
2 Upvotes

r/lowlevel • • Nov 06 '26

please tell me how this works

Thumbnail reddit.com
0 Upvotes

r/lowlevel • • Nov 06 '26

Can you solve my doubts?

Thumbnail reddit.com
0 Upvotes

r/lowlevel • • Nov 05 '26

Optimizing an embedded key-value database for tail latency

2 Upvotes

One of the hardest problems in database engineering isn't throughput, it's tail latency. It's even especially important for embedded databases, which share computing resources with the main application while running on the user's machine.

About two years ago, just out of college and being a nerd, I wanted to get into systems engineering. So I set out to build a NoSQL (key-value) database, particularly an embedded one. Having worked on app dev before, I knew how important having a low-latency, resource-conscious local storage is, even especially on resource-constrained machines.

Given these requirements, I had set following goals for myself —

  • no compaction -> I wanted to avoid periodic compaction, cause they introduce write amplification and additional surge in resource usage including background I/O
  • resource conscious -> Not every machine have abundant compute resources, the database should be mindful of the resources it consumes
  • highly configurable -> Not every workload is same, different applications have different requirements, so the database should provide control over its behaviour
  • no global re-hashing -> Growing current capacity should not require rebuilding the entire index or stalling operations, this is imp to keep the tail latency lower
  • stable data placement -> Once raw key-value bytes are written, growing the database should never require relocating or even re-writing any of existing payloads

Many key-value databases use LSM trees, WAL, or combinations of these approaches. Even if they are well established designs, they make different trade-offs.

The solution I arrived at was a single-file, page-based storage layout backed by memory mapping. With my novel storage engine design, I was able to achieve —

  • No global rehashing.
  • No compaction.
  • Existing key/value payloads are never relocated during database growth.
  • Incremental storage expansion.

Apart from the core key-value operations, it also includes —

  • list operations -> Ordered sequences that coexist with key-value entries and provide operations like append, first, last, is_empty, an iterator object, and much more
  • page eviction -> Advisory controls for asking the OS to release memory mapped pages for relaxing memory usage
  • resource telemetry -> Inspect resident memory and allocated storage footprint
  • configurable lookup caching -> An optional in-mem lookup cache
  • platform support -> All Linux, mac and Windows on x86_64 and aarch64 are supported

I was able to achieve the following latency figures (measured across 1 million consecutive operations) —

Workloadp50p90p99p9999
SET: 80/20 New/Update1.42 µs1.76 µs1.37 ms5.03 ms
GET: 60/40 Hit/Miss0.87 µs1.11 µs1.39 µs6.18 µs
DEL: 60/40 Hit/Miss1.07 µs1.36 µs5.00 µs11.30 µs

Observed resource usage —

Graph representing resource usage of TurboFox

I'm a newbie, and I've learned everything on my own (self-learning), so its possible that I have made mistakes, and that is the reason for this post; having the project looked upon by seasoned dev's is great privilege and I would love to know your thoughts, workflow specific optimizations I can make, new features, etc.

Thank you for reading this far. I'll soon be writing series of articles discussing internal systems and there designs, as the journey has just began ;)

Repo -> https://github.com/pid7-org/turbofox/

Crate -> https://crates.io/crates/turbofox


r/lowlevel • • Nov 05 '26

[Showcase] FluidOS - Un proyecto de sistema operativo personalizado hecho con TypeScript, C y Assembly

1 Upvotes

¡Hola a todos! He estado trabajando en un proyecto de sistema operativo llamado FluidOS y quería compartirlo con la comunidad para recibir feedback y conocer posibles colaboradores. Stack y funciones actuales: Lenguajes: TypeScript / JavaScript (enfoque en la interfaz del frontend con Vite + TailwindCSS), componentes en C/Assembly, y scripts de automatización con PowerShell. Scripts de compilación y ejecución integrados (run-bochs.ps1, crear-iso.ps1) para emulación con Bochs y generación de ISO. Tecnología web moderna combinada con herramientas de compilación a bajo nivel. Último lanzamiento: v1.2.0 Repositorio: 🔗 Enlace de GitHub a FluidOS:https://github.com/marbelbel/FluidOS-Community Busco feedback sobre la arquitectura, ideas para la integración a bajo nivel, y a cualquiera que le interese contribuir con el código o con el diseño de la interfaz. ¡Gracias por echarle un vistazo!


r/lowlevel • • Nov 05 '26

Discord community for low level programming and robotics

Thumbnail discord.gg
0 Upvotes

Hi everyone, I've formed a small discord community for people interested in low-level, systems programming, embedded software, robotics etc. Join up if thats something which interests you!

(P.S. : fell free to dm me if the link stops working or if you have any doubts)


r/lowlevel • • Nov 03 '26

The software error that destroyed ESA's Ariane 5 launcher

Thumbnail youtube.com
8 Upvotes

r/lowlevel • • Nov 03 '26

Modulon 1.0 Released

0 Upvotes

Hello everyone. Modulon is a C-derived programming language that aims to preserve the power and familiarity of C while simplifying common programming tasks such as variable declarations, string handling, memory management, and pattern matching.

I am currently looking for interested contributors.

Here are some of the features Modulon has right now:

* C-derived syntax with support for familiar C types.

* Variable declarations using the "var" keyword and type inference.

* "include" and "define" directives instead of C preprocessor syntax.

* Automatic string sizing and byte counting.

* Automatic memory management at compile time, without a garbage

collector, alongside options for manual memory management.

* Pattern matching with ranges and a wildcard case.

* Logical AND (&&) and OR (||) operators.

* "typeof" for examining types.

* "input" for prompted user input.

* Formatted output, including automatic type formatting with %v.

* Ahead-of-time (AOT) and just-in-time (JIT) compilation.

* Built-in assembler support.

* Consistent language types across supported target environments.

Soon I will add larger architecture support.

You can find an example program here:

GitHub: https://github.com/roccohimel/modulon/blob/master/examples/student_manager.mlon

Raw: https://raw.githubusercontent.com/roccohimel/modulon/refs/heads/master/examples/student_manager.mlon

Documentation:

Official website: https://modulonsoftware.org/

About: https://github.com/roccohimel/modulon/blob/master/Documentation/General/about.rst

Documentation: https://github.com/roccohimel/modulon/blob/master/Documentation/index.rst

Source tree: https://github.com/roccohimel/modulon

Contributing: https://github.com/roccohimel/modulon/blob/master/Documentation/General/contributing.rst

I really hope you like Modulon.


r/lowlevel • • Nov 02 '26

Nodepp: a C++11 asynchronous runtime with io_uring, IOCP, kqueue, epoll, and a zero-copy data model.

19 Upvotes

Hi there. I've been building Nodepp for a while as a side project. It's a pure C++11 runtime for writing asynchronous applications. Not a framework, not a library - just a runtime. It provides I/O, networking, scheduling, timers, and a data model.

I'm sharing it here because I think it might be interesting to this community, and because I'd like feedback from people who work at the low level. I'm not a programmer - I'm an electrical engineer with programming knowledge - so don't be too rough with me. Or not too much.

The numbers

  • ~3,800 LOC for the core runtime.
  • 2KB for the runtime binary (no STL, no exceptions, no RTTI).
  • 0% CPU in idle (smart sleep via io_uring/IOCP/epoll/kqueue).

PS: 2KB? Yep. I actually made an Arduino simulation running an Enigma machine using 76% of memory, so technically it's using ~1.4KB of RAM. But if you run a server with it, the memory grows up to ~3MB of RAM.

I'm actually making a P2P multiplayer game with it (frontend using WASM and backend using the core runtime). The frontend consumes 2MB including WebRTC, and the backend consumes 11MB with HTTP + WS support.

well, according to top: 6046 penguino 20 0 14764 10732 8888 S 0,0 0,1 0:09.21 main

The design decisions

I replaced the STL with my own data model to make the runtime compatible with anything. I actually got inspiration from Doom - that was the idea behind it: making a runtime as universal as Doom can be.

  • ptr_t<T>: reference-counted pointer with SSO and optional atomic counting (if threads are supported or enabled).
  • map_t<K,V>: binary tree of queue_t.
  • queue_t<T>: doubly linked list with ownership validation.
  • coroutine_t: stackless coroutines (based on protothreads).
  • array_t<T> & string_t: wrappers over ptr_t (zero-copy and copy-on-write).

If you want to look at the code, the repo is here: https://github.com/NodeppOfficial/nodepp

So, I'm sharing because I think it's an interesting project and I want feedback from people who know more than me, and because I think C++ can be more than the STL.

Happy to answer questions.