Live data from Hacker News

Frame – Linux X server in Assembly

isene.org

11–20 of 115 posts

Re: Frame – Linux X server in Assembly

#14

Interesting. I've never quite found that Linux is more optimized on battery-powered machines for energy savings, even though supposedly there is a lot of room to tweak and optimize settings -- from selecting a low resource window manager/DE to turning off various services to switching up power management utilities. But this does seem like an approach that might produce that kind of fruit?

The really unfortunate thing about linux is the defaults tend to be not battery friendly.

For example, I recently got another 1 hour out of my old laptop's battery because I didn't realize for the intel video card driver I needed to add some modprobe flags to get it to load up a firmware binary blob. Doing that enabled hardware video decoding, faster performance, and lower power usage.

There's a bunch of setting like this that you need to make sure are turned on to get the best battery performance. Some OSes are better about toggling them than others and mine (gentoo) let's you discover later that you forgot to turn them on :).

Re: Frame – Linux X server in Assembly

#15

Interesting. I've never quite found that Linux is more optimized on battery-powered machines for energy savings, even though supposedly there is a lot of room to tweak and optimize settings -- from selecting a low resource window manager/DE to turning off various services to switching up power management utilities. But this does seem like an approach that might produce that kind of fruit?

The really unfortunate thing about linux is the defaults tend to be not battery friendly. For example, I recently got another 1 hour out of my old laptop's battery because I didn't realize for the intel video card driver I needed to add some modprobe flags to get it to load up a firmware binary blob. Doing that enabled hardware video decoding, faster performance, and lower power usage. There's a bunch of setting like…

Hey could you tell me about this flag please? I have an intel gpu and might need it too!

Re: Frame – Linux X server in Assembly

#16
When first looking at the source code, I wondered why one would waste so much time to write 25k lines in raw assembly language, but then I saw that it was generated with Claude, for whom it does not matter much how expanded is the written text.

If someone had written this program manually, the strategy would have been very different. With a good macro-assembler (and nasm is good enough) one should define a great number of macros, to encapsulate all the tedious boilerplate, especially for things like function prologues, epilogues and invocations.

With a well written macro library, an assembly program can be almost as compact as a C program, instead of containing many text lines for each equivalent high-level language statement.

Such an assembly source with good macros can be read and understood much more easily than raw assembly language, like in this "frame.asm".

Otherwise, this is interesting work.

Re: Frame – Linux X server in Assembly

#17

Interesting. I've never quite found that Linux is more optimized on battery-powered machines for energy savings, even though supposedly there is a lot of room to tweak and optimize settings -- from selecting a low resource window manager/DE to turning off various services to switching up power management utilities. But this does seem like an approach that might produce that kind of fruit?

The really unfortunate thing about linux is the defaults tend to be not battery friendly. For example, I recently got another 1 hour out of my old laptop's battery because I didn't realize for the intel video card driver I needed to add some modprobe flags to get it to load up a firmware binary blob. Doing that enabled hardware video decoding, faster performance, and lower power usage. There's a bunch of setting like…

I have a laptop where you need to load a certain driver to turn off the discrete GPU, which triples the idle battery life.

Re: Frame – Linux X server in Assembly

#18

I am loving the shift from 'X11 is too big and messy to ever reimplement' to 'there are multiple wildly different X servers being built from scratch'. Also, has anyone run it successfully? I got as far as building and running with --display and then running `DISPLAY=:7 dwm` and `DISPLAY=:7 alacritty`, but I can't seem to focus the window to actually type. Given that the author posted a picture of the thing actually r…

> 'there are multiple wildly different X servers being built from scratch'

by claude code. So this was only possible since no human had to bear looking at X original source code.

Re: Frame – Linux X server in Assembly

#19
post #15

Earlier quoted context omitted.

The really unfortunate thing about linux is the defaults tend to be not battery friendly. For example, I recently got another 1 hour out of my old laptop's battery because I didn't realize for the intel video card driver I needed to add some modprobe flags to get it to load up a firmware binary blob. Doing that enabled hardware video decoding, faster performance, and lower power usage. There's a bunch of setting like…

Hey could you tell me about this flag please? I have an intel gpu and might need it too!

It's the GuC and HuC firmware.

https://wiki.gentoo.org/wiki/Intel#GuC.2FHuC_firmware

Post reply on HN