Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

15
  • 16
    Great answer, but I do think there's something important missing: DRI, the Direct Rendering Infrastructure. With this, applications address hardware almost directly with a minimum of supervision by Xorg and the kernel (much like how Xorg mostly addresses hardware itself with a minimum of supervision of the kernel). This is used extensively to do hardware accelerated OpenGL though libmesa, for example. Then of course, nowadays there's Wayland which replaces Xorg, but of course at slightly different abstraction locations. It's a complex landscape :) Commented Feb 20, 2020 at 16:16
  • 4
    As marcelm says, hardware access nowadays goes through DRI (or DRM). /dev/mem provides access to very little memory nowadays. There’s also all the input stack, which is hidden behind libinput and libevdev now. Commented Feb 20, 2020 at 16:32
  • 10
    X11 is a protocol: it does not talking to hardware, it's formatted data sent between a client (the "application") and a server (probably x.org). The X11 server itself doesn't talk to hardware for output, either, and uses various file I/O and ioctl interfaces to the kernel to talk to input. Output is generally done through other kernel APIs like DRM to get frame buffers to fill and to talk to specialized drawing hardware like the GPU. Basically, constructing a GUI means sending and receiving data through kernel APIs. Commented Feb 20, 2020 at 21:43
  • 2
    There is one extra layer that is glossed over here between X11 and the hardware - the device driver. But since the device driver is a kernel module you can be forgiven by just saying it is part of the kernel Commented Feb 21, 2020 at 3:19
  • 4
    @poopoopeepee123 I'd like to note that X11 itself (the API part) is just a protocol that runs over TCP/IP (on your machine your apps connect to localhost). This makes X11 very flexible by being able to run a GUI program on a different computer and displaying it on a different computer even in a different country. This also makes it possible to talk to X11 directly using standard network programming without using xlib if you study the protocol (it is also how people write things like clipboard managers by intercepting X11 events) Commented Feb 21, 2020 at 3:22