1622
submitted 1 day ago* (last edited 4 hours ago) by bytepursuits@programming.dev to c/linux@lemmy.world
you are viewing a single comment's thread
view the rest of the comments
[-] BillyClark@piefed.social 19 points 15 hours ago

It's an amazing accomplishment, but if anybody is wondering why it's not flat-out impossible, she very likely was snooping on how it was controlled by existing drivers, either by looking at the software side, which honestly, I'm less familiar with, or by using something like a logic analyzer, which can be used to record signals being sent to the hardware directly. So, if she did it that way, she didn't reuse the code of the existing driver, but analyzed the output. I've had to debug some drivers in the past with a logic analyzer, and just that was a lot of work.

If she did it without existing drivers, then it would have been an absolute slog, I think bordering on impossible. You'd have to guess every signal. GPUs may be more specialized than CPUs, meaning that their instruction set will be smaller, but that would be insane.

[-] AdrianTheFrog@lemmy.world 49 points 14 hours ago

lol I randomly searched for a page from collabora about how they reverse engineer GPU drivers (since I've seen that they've done that for other GPUs) and the very first page I went to was written by this person. Apparently this was a side project while she did fairly similar work on Mali GPUs at Collabora.

Anyways, here's what she said about the process:

Typically, for Linux or Android driver reverse-engineering, a small wrap library will be written to inject into a test application via LD_PRELOAD that hooks key system calls like ioctl and mmap in order to analyze user-kernel interactions. Once the “submit command buffer” call is issued, the library can dump all (mapped) shared memory for offline analysis...

it took some elbow grease to identify the three critical calls: memory allocation, command buffer creation, and command buffer submission...

With those obstacles cleared, we can finally get to the shader binaries, black boxes in themselves. However, the process from here on out is standard: start with the simplest fragment or compute shader possible, make a small change in the input source code, and compare the output binaries. Iterating on this process is tedious but will quickly reveal key structures, including opcode numbers.

From https://alyssarosenzweig.ca/blog/asahi-gpu-part-1.html , there's a lot more details about the subsequent parts of the process in the next articles but they're harder to summarize

this post was submitted on 27 Aug 2026
1622 points (99.4% liked)

Linux

18874 readers
2391 users here now

Welcome to c/linux!

Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!

Rules:

  1. Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.

  2. Be respectful: Treat fellow community members with respect and courtesy.

  3. Quality over quantity: Share informative and thought-provoking content.

  4. No spam or self-promotion: Avoid excessive self-promotion or spamming.

  5. No NSFW adult content

  6. Follow general lemmy guidelines.

founded 3 years ago
MODERATORS