Live data from Hacker News

Fui: C library for interacting with the framebuffer in a TTY context

github.com

1–10 of 70 posts

Re: Fui: C library for interacting with the framebuffer in a TTY context

#3
Don't type commands from the Internet, especially as root, especially when dd is involved. That being said,

If you're ever bored, from a TTY, type

sudo dd if=/dev/urandom of=/dev/fb0

This provides a nifty demonstration of how both the framebuffer and urandom works.

you can also take a sort of "screenshot" in a tty by typing dd if=/dev/fb0 of=./shot.fb

and then you can view it by flipping those filenames around, so that the shot.fb is now the input and /dev/fb0 is now the output.

Re: Fui: C library for interacting with the framebuffer in a TTY context

#4
post #3

Don't type commands from the Internet, especially as root, especially when dd is involved. That being said, If you're ever bored, from a TTY, type sudo dd if=/dev/urandom of=/dev/fb0 This provides a nifty demonstration of how both the framebuffer and urandom works. you can also take a sort of "screenshot" in a tty by typing dd if=/dev/fb0 of=./shot.fb and then you can view it by flipping those filenames around, so th…

[deleted]

Re: Fui: C library for interacting with the framebuffer in a TTY context

#5
post #3

Don't type commands from the Internet, especially as root, especially when dd is involved. That being said, If you're ever bored, from a TTY, type sudo dd if=/dev/urandom of=/dev/fb0 This provides a nifty demonstration of how both the framebuffer and urandom works. you can also take a sort of "screenshot" in a tty by typing dd if=/dev/fb0 of=./shot.fb and then you can view it by flipping those filenames around, so th…

Writing urandom to the framebuffer is a joy in and of itself. You actually reminded me to have users add themselves to the video and input group (which does require root privileges usually), but this way they can then run the library without sudo.

Re: Fui: C library for interacting with the framebuffer in a TTY context

#6
Can someone explain what “the framebuffer” is? I’m familiar with OpenGL programming where the OS can provide a framebuffer for an application but I’m confused about whether there is a global framebuffer for the entire desktop. Is this a Linux specific concept?

Re: Fui: C library for interacting with the framebuffer in a TTY context

#7
post #6

Can someone explain what “the framebuffer” is? I’m familiar with OpenGL programming where the OS can provide a framebuffer for an application but I’m confused about whether there is a global framebuffer for the entire desktop. Is this a Linux specific concept?

As far as I know, a framebuffer can mean a lot of things depending on hardware and implementation, but it was used to refer to actual memory that would contain pixel values that would eventually be written to the screen. In Linux, this is abstracted by the framebuffer device, which is hardware independent (you can actually have several fbdevices, which if I'm not mistaken end up referring to different monitors usually). What's convenient about the implementation is that these devices still work as normal memory devices, which means you can read/write as you would any other memory. Some more info: https://www.kernel.org/doc/html/latest/fb/framebuffer.html
Post reply on HN