Login
You're viewing the code4lib.social public feed.
  • Oct 27, 2026, 1:25 AM

    I have a stupid, "I'm so ignorant on the topic that I don't know what I don't know" question.

    In the past, like 20-30 years ago, how did X11 draw to the screen (not limited to Linux)? Were there syscalls for "draw gfx"? Was the transition from user to kernel mode to blit to a framebuffer or send to GPU optimized so the "syscalls" weren't heavy? B/c it seems like doing everything thru syscall would be slow (analogous to how no one used the int 0x10 BIOS functions for drawing)

    💬 1🔄 0⭐ 0

Replies

  • Oct 27, 2026, 1:28 AM

    I don't seem to recall there being any gfx devices you can open under /dev. So doesn't seem like there'd be an ioctl layer or you do everything via open/read/write (which doesn't that also have an ioctl layer/pointers to read/write/etc? Just the user doesn't see it?)

    💬 0🔄 0⭐ 0
  • Oct 27, 2026, 1:37 AM

    @cr1901 these days its /dev/drm et al. in the past it was OS dependent. In the “good” case, X11 would open a device and mmap a region. In the “bad” case, X11 would hand enumerate the fucking PCI bus and mmap the device through /dev/mem

    Either way most interactions with the hardware would go through mmap.

    💬 1🔄 0⭐ 0
  • Oct 27, 2026, 1:42 AM

    @erincandescent (Okay, so it's as bad as I imagine. I guess my next question is "if you enumerate the PCI bus, why do you need to screw with /dev/mem? Can't you ask for a mmap at an exact physical address?")

    EDIT: Nevermind I'm a dumbass, mmap needs an fd.

    💬 0🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0
  • Oct 27, 2026, 1:50 AM

    @cr1901 on “more modern” (I don’t know when “more modern”) is I believe on NetBSD (and maybe Solaris? I think this has Sun heritage?) it’d be through a wscons device

    💬 0🔄 0⭐ 0
  • Oct 27, 2026, 3:40 AM

    @cr1901 historically the client to server connection was TCP/IP or Unix Domain Sockets, and the client would send higher level 2D drawing requests (point, line, text, etc) to the server.

    Over time that changed to “here’s a bitmap, please copy to screen” (and client side rendering). That transition was ~20 years ago.

    💬 1🔄 0⭐ 0
  • Oct 27, 2026, 3:40 AM

    @cr1901 historically the X11 server to video card interface was “we are root and can map video memory into our address space, and send hardware IO directly”. This was… very FAFO.

    Kernel mode switching (KMS) and the kernel management of video memory also came along about 20 years ago. Which at least allowed mapping video memory without being root or directly sending hardware IO to the video card. (And in many cases it switched to the frame buffer driver.)

    💬 0🔄 0⭐ 0