I'm writing my own display server as an educational exercise. Where in the Linux kernel tree would I look for documentation on the console's graphical mode?

Basically, as I understand it, Xorg takes over the tty device and also takes over the raw hardware. How can I find documentation on duplicating that action?

  • 1
    From the tty side this article might be useful: linuxjournal.com/article/5896. It's dated so I don't know how much has changed but it looks like it would be relevant to your task.
    – slm
    Commented Oct 6, 2013 at 1:59
  • 2
    I don't have a full or direct answer so I'm posting as a comment. You may look at the various Wayland compositors that are available. Wayland is seen by many as the technology to supplant/render obsolete Xorg/XFree86. If you're just starting out you may use the study of Wayland as a general study of GUI's on Linux and if you feel like you really should break away from it for some reason, do so then.
    – Bratchley
    Commented Oct 6, 2013 at 1:59
  • 1
    Have you poked around here too? kernelnewbies.org
    – slm
    Commented Oct 6, 2013 at 2:01
  • 1
    Take a look to the Nano-X sources
    – Alex
    Commented Oct 6, 2013 at 8:13
  • 2
    Why don't you just use the framebuffer interface ([src]/Documentation/fb/api.txt)?
    – goldilocks
    Commented Oct 6, 2013 at 11:23

1 Answer 1


Sorry for repeating but take a look to Nano-X sources.

git clone git://microwindows.org/microwin

In particular take a look to the files:


What is done in the tty driver is very similar to what Xorg does, and The devfb driver is a very simple and clean implementation.

Linux's devfb frame buffers mostly rely on ioctl (eg: to set/get resolution) and mmap (to raw write/read pixels).

devfb is just one (easy and a bit more portable on linux) way to access the graphic hardware.

Xorg drivers instead are composed by a kernel driver and a Xorg user space interface between the driver and Xorg itself, and what happen between kernel and user side is really implementation-dependant (there isn't a standard).

You can also take a look to SDL or Directfb but Nano-X is the cleanest/easy and a display server itself, so probably could help you on other question that you'll surely meet.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .