frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

DRM Panic QR code generator

https://rust-for-linux.com/drm-panic-qr-code-generator
48•weinzierl•7h ago

Comments

danhor•4h ago
It seems like this is already deployed in Arch, as I've hit it yesterday. I was surprised at first, but it was quite useful.
homebrewer•3h ago
It's easy to check (unless the kernel was compiled without config in procfs, which it probably wasn't):

  $ zgrep CONFIG_DRM_PANIC_SCREEN_QR_CODE /proc/config.gz
  CONFIG_DRM_PANIC_SCREEN_QR_CODE=y
greatgib•4h ago
Fun, and nice addition, but again another good example of let's sneak some rust in critical parts of the kernel so that rust will become mandatory.

I would not really have noticed if there wasn't this section about why rust, where arguments looks phony and clearly made up afterward to justify a decision that was already taken:

   This project was written in rust, because memory safety is critical in a panic handler.

   For this particular case, I found the Rust code to be cleaner, and easier to read.
rcxdude•4h ago
I suspect it's more of a 'this would be handy to have, and I would prefer to use rust' as opposed to motivated by making the language harder to do without in the kernel. Certainly this kind of thing I would find rust much nicer for than C.

(I would agree the first argument is kinda wavy. If anything the panic handler has a fairly unique relationship with memory safety: it's likely to be executing in an environment where that's already gone out the window and it needs to try to assume as little as possible about what might or might not be correct that its reading from and writing to, while also its own memory safety is perhaps less critical because the system is already crashing, it's just got to get the info out before everything completely stops. Though that doesn't make it immune from security concerns. A code execution vulnerability in the handler means any panic could turn into a worse problem)

tialaramex•2h ago
The elaborate Rust type system and so on does not exist in the machine code executing when "the system is already crashing". Very often it turns out that expressive Rust you wrote which talks about a fancy Iterator protocol and a lambda function just got compiled into the same sixteen CPU instructions that would have been emitted for the (much harder to understand) macro expanded C you'd have to write instead with the same meaning.

Rust vs C matters a lot more for maintainers, who read the source code - hopefully not from a machine which is currently crashing - than for the executable kernel itself.

jeroenhd•4h ago
The first version of the PR is a little more honest: https://patchwork.freedesktop.org/series/135886/

> There is no particular reason to do it in rust, I just wanted to learn rust, and see if it can work in the kernel.

Which I think is fairer. Good on him for trying to stay on top of recent developments. With Linux basically supporting Rust now so it's a valid choice, especially for a new component. Plus, it's not like this is an important features, the anti-Rust people can live perfectly fine without QR code crash dumps like they have for decades now.

I think doing this in C is an unnecessary risk (you really don't need all that many raw pointer interactions and shared struct ownership) but the security and stability of this component hardly matters. The kernel is already dead because of a bug or a hardware failure anyway, this is just making the catastrophic failure of the rest of the system a bit prettier.

meindnoch•3h ago
>Good on her for trying

"Pronouns: He/Him" https://gitlab.com/kdj0c

jeroenhd•2h ago
Good catch, didn't spot that on the freedesktop site and the docs page linked. I've edited my comment.

My apologies to kdj0c if he's reading this.

ChocolateGod•3h ago
What's the need for memory safety if the kernel is going to stop executing and memory will be wiped before any further execution is done.
krior•2h ago
Memory safety is not just about releasing unused memory.
kookamamie•2h ago
Agreed, picking Rust for the project likely has very little to do with "memory safety".
varispeed•2h ago
> because memory safety is critical in a panic handler.

As in: I can't be bothered to write memory safe code.

rs186•1h ago
> let's sneak some rust in critical parts of the kernel so that rust will become mandatory.

This project is a great example of where and when Rust should be used.

"sneak" some rust in the kernel? It is exactly this kind of attitude that is slowing progress.

Am4TIfIsER0ppos•3h ago
How am I supposed to use a QR code when the only thing that I have to decode it is currently panicking? If I am supposed to draw it I hope it is only a few bits. A traditional BSOD with codes and registers would be easier to copy.
bauruine•3h ago
It may isn't useful for you but a huge majority has a phone they can use for this task.
elmigranto•3h ago
What if your phone’s kernel panics? :)
tialaramex•3h ago
Did you know other people have phones too?
ChocolateGod•3h ago
That's planned obsolescence and you should get a new one.
andrelaszlo•3h ago
Bring out the crayons and some graph paper!
weinzierl•2h ago
In this context DRM stands for Direct Rendering Manager.

It has nothing to do with digital rights management.

Why I left my tech job to work on chronic pain

https://sailhealth.substack.com/p/why-i-left-my-tech-job-to-work-on
105•glasscannon•2h ago•66 comments

Writing a Game Boy Emulator in OCaml

https://linoscope.github.io/writing-a-game-boy-emulator-in-ocaml/
147•ibobev•5h ago•8 comments

Show HN: I AI-coded a tower defense game and documented the whole process

https://github.com/maciej-trebacz/tower-of-time-game
64•M4v3R•2h ago•27 comments

Show HN: BunkerWeb – the open-source and cloud-native WAF

https://docs.bunkerweb.io/latest/
39•bnkty•3h ago•13 comments

Larry (cat)

https://en.wikipedia.org/wiki/Larry_(cat)
104•dcminter•5h ago•27 comments

Lens: Lenses, Folds and Traversals

https://hackage.haskell.org/package/lens
31•hyperbrainer•3d ago•6 comments

A Rust-TypeScript integration

https://github.com/beeeeep54/rust-typescript
27•wreedtyt•3h ago•30 comments

Kepler.gl

https://kepler.gl/
17•9woc•1h ago•0 comments

We're Not Innovating, We're Just Forgetting Slower

https://www.elektormagazine.com/articles/opinion-no-innovation-forgetting-slower
7•obscurette•1h ago•1 comments

Can Large Language Models Play Text Games Well?

https://arxiv.org/abs/2304.02868
21•willvarfar•3h ago•9 comments

Show HN: Fast Thermodynamic Calculations in Python

https://dlr-institute-of-future-fuels.github.io/gaspype/
25•Saloc•3h ago•5 comments

Serving 200M requests per day with a CGI-bin

https://jacob.gold/posts/serving-200-million-requests-with-cgi-bin/
54•feep•2h ago•16 comments

Enhanced Radar (YC W25) is hiring a founding engineer

1•EricButton•3h ago

Is an Intel N100 or N150 a better value than a Raspberry Pi?

https://www.jeffgeerling.com/blog/2025/intel-n100-better-value-raspberry-pi
102•transpute•3h ago•102 comments

I want to leave tech: what do I do?

https://write.as/conjure-utopia/lets-say-youre-working-in-tech-and-you-have-a-technical-role-youre-a
84•todsacerdoti•1h ago•67 comments

Show HN: A cross-platform terminal emulator written in Java

https://github.com/sebkur/forceterm
12•sebkur•3d ago•0 comments

Introducing tmux-rs

https://richardscollin.github.io/tmux-rs/
808•Jtsummers•1d ago•272 comments

Wind Knitting Factory

https://www.merelkarhof.nl/work/wind-knitting-factory
173•bschne•18h ago•51 comments

Zig breaking change – initial Writergate

https://github.com/ziglang/zig/pull/24329
123•Retro_Dev•11h ago•144 comments

DRM Panic QR code generator

https://rust-for-linux.com/drm-panic-qr-code-generator
48•weinzierl•7h ago•20 comments

Killer whales groom each other with pieces of kelp

https://www.science.org/content/article/killer-whales-groom-each-other-pieces-kelp
51•noleary•3d ago•28 comments

Rust and WASM for Form Validation

https://sebastian.lauwe.rs/blog/rust-wasm-form-validation/
8•slau•2h ago•0 comments

phkmalloc

https://phk.freebsd.dk/sagas/phkmalloc/
32•fanf2•3d ago•5 comments

Flounder Mode – Kevin Kelly on a different way to do great work

https://joincolossus.com/article/flounder-mode/
279•latentnumber•23h ago•63 comments

Developing with GitHub Copilot Agent Mode and MCP

https://austen.info/blog/github-copilot-agent-mcp/
77•miltonlaxer•3d ago•48 comments

LooksMapping

https://looksmapping.com/
81•elsewhen•11h ago•46 comments

Launch HN: K-Scale Labs (YC W24) – Open-Source Humanoid Robots

208•codekansas•22h ago•88 comments

Raphael discovery emerges from Vatican museum restoration

https://news.artnet.com/art-world/raphael-rooms-restoration-discovery-2662624
44•andsoitis•3d ago•7 comments

AV1@Scale: Film Grain Synthesis, The Awakening

https://netflixtechblog.com/av1-scale-film-grain-synthesis-the-awakening-ee09cfdff40b
237•CharlesW•22h ago•192 comments

Context Engineering for Agents

https://rlancemartin.github.io/2025/06/23/context_engineering/
83•0x79de•3d ago•24 comments