Skip to main content
Commonmark migration
Source Link

#How it works (Gnu/Linux + X11)

How it works (Gnu/Linux + X11)

Overview

##Overview ItIt looks something like this (not draws to scale)

Linux

##Linux AtAt the bottom is Linux (the kernel): a small part of the system. It provides access to hardware, and implements security.

Gnu

##Gnu ThenThen Gnu (Libraries; bash; tools:ls, etc; C compiler, etc). Most of the operating system.

X11 server (e.g. x.org)

##X11 server (e.g. x.org) ThenThen X11 (Or Wayland, or ...), the base GUI subsystem. This runs in user-land (outside of the kernel): it is just another process, with some privileges. The kernel does not get involved, except to give access to the hardware. And providing inter-process communication, so that other processes can talk with the X11 server.

X11 library

##X11 library AA simple abstraction to allow you to write code for X11.

GUI libraries

##GUI libraries LibrariesLibraries such as qt, gtk, sdl, are next — they make it easier to use X11, and work on other systems such as wayland, Microsoft's Windows, or MacOS.

Applications

##Applications ApplicationsApplications sit on top of the libraries.

#Some low-level entry points, for programming

Some low-level entry points, for programming

xlib

##xlib UsingUsing xlib, is a good way to learn about X11. However do some reading about X11 first.

SDL

##SDL SDLSDL will give you low level access, direct to bit-planes for you to directly draw to.

Going lower

#Going lower IfIf you want to go lower, then I am not sure what good current options are, but here are some ideas.

#Links

Links

X11

##X11 https://en.wikipedia.org/wiki/X_Window_System

Modern ways

##Modern ways WritingWriting this got my interest, so I had a look at what the modern fast way to do it is. Here are some links:

#How it works (Gnu/Linux + X11)

##Overview It looks something like this (not draws to scale)

##Linux At the bottom is Linux (the kernel): a small part of the system. It provides access to hardware, and implements security.

##Gnu Then Gnu (Libraries; bash; tools:ls, etc; C compiler, etc). Most of the operating system.

##X11 server (e.g. x.org) Then X11 (Or Wayland, or ...), the base GUI subsystem. This runs in user-land (outside of the kernel): it is just another process, with some privileges. The kernel does not get involved, except to give access to the hardware. And providing inter-process communication, so that other processes can talk with the X11 server.

##X11 library A simple abstraction to allow you to write code for X11.

##GUI libraries Libraries such as qt, gtk, sdl, are next — they make it easier to use X11, and work on other systems such as wayland, Microsoft's Windows, or MacOS.

##Applications Applications sit on top of the libraries.

#Some low-level entry points, for programming

##xlib Using xlib, is a good way to learn about X11. However do some reading about X11 first.

##SDL SDL will give you low level access, direct to bit-planes for you to directly draw to.

#Going lower If you want to go lower, then I am not sure what good current options are, but here are some ideas.

#Links

##X11 https://en.wikipedia.org/wiki/X_Window_System

##Modern ways Writing this got my interest, so I had a look at what the modern fast way to do it is. Here are some links:

How it works (Gnu/Linux + X11)

Overview

It looks something like this (not draws to scale)

Linux

At the bottom is Linux (the kernel): a small part of the system. It provides access to hardware, and implements security.

Gnu

Then Gnu (Libraries; bash; tools:ls, etc; C compiler, etc). Most of the operating system.

X11 server (e.g. x.org)

Then X11 (Or Wayland, or ...), the base GUI subsystem. This runs in user-land (outside of the kernel): it is just another process, with some privileges. The kernel does not get involved, except to give access to the hardware. And providing inter-process communication, so that other processes can talk with the X11 server.

X11 library

A simple abstraction to allow you to write code for X11.

GUI libraries

Libraries such as qt, gtk, sdl, are next — they make it easier to use X11, and work on other systems such as wayland, Microsoft's Windows, or MacOS.

Applications

Applications sit on top of the libraries.

Some low-level entry points, for programming

xlib

Using xlib, is a good way to learn about X11. However do some reading about X11 first.

SDL

SDL will give you low level access, direct to bit-planes for you to directly draw to.

Going lower

If you want to go lower, then I am not sure what good current options are, but here are some ideas.

Links

X11

https://en.wikipedia.org/wiki/X_Window_System

Modern ways

Writing this got my interest, so I had a look at what the modern fast way to do it is. Here are some links:

respond to comment
Source Link
ctrl-alt-delor
  • 28.8k
  • 11
  • 66
  • 113
┌───────────────────────────────────────────────┐ │ User │ │ ┌─────────────────────────────────────────┤ │ │ Application │ │ │ ┌──────────┬─────┬─────┬─────┤ │ │ │ ... │ SDL │ GTK │ SDLQT  │ │ │ ├──────────┴─────┴─────┴─────┤ │ │ │ xLib │ │ │ ├────────────────────────────┤ ├─────┴───┬────────┴──┐ X11 │ │ Gnu │ Libraries │ Server │ │ Tools │ │ │ ├─────────┘ │ │ ├─────────────────────┤ │ │ Linux (kernel) │ │ ├─────────────────────┴─────────────────────────┤ │ Hardware │ └───────────────────────────────────────────────┘ 
┌───────────────────────────────────────────────┐ │ User │ │ ┌─────────────────────────────────────────┤ │ │ Application │ │ │ ┌──────────┬─────┬─────┬─────┤ │ │ │ ... │ SDL │ GTK │ SDL │ │ │ ├──────────┴─────┴─────┴─────┤ │ │ │ xLib │ │ │ ├────────────────────────────┤ ├─────┴───┬────────┴──┐ X11 │ │ Gnu │ Libraries │ Server │ │ Tools │ │ │ ├─────────┘ │ │ ├─────────────────────┤ │ │ Linux (kernel) │ │ ├─────────────────────┴─────────────────────────┤ │ Hardware │ └───────────────────────────────────────────────┘ 
┌───────────────────────────────────────────────┐ │ User │ │ ┌─────────────────────────────────────────┤ │ │ Application │ │ │ ┌──────────┬─────┬─────┬─────┤ │ │ │ ... │ SDL │ GTK │ QT  │ │ │ ├──────────┴─────┴─────┴─────┤ │ │ │ xLib │ │ │ ├────────────────────────────┤ ├─────┴───┬────────┴──┐ X11 │ │ Gnu │ Libraries │ Server │ │ Tools │ │ │ ├─────────┘ │ │ ├─────────────────────┤ │ │ Linux (kernel) │ │ ├─────────────────────┴─────────────────────────┤ │ Hardware │ └───────────────────────────────────────────────┘ 
add amendment, thanks to comment from @StephenM.Webb
Source Link
ctrl-alt-delor
  • 28.8k
  • 11
  • 66
  • 113
┌───────────────────────────────────────────────┐ │ User │ │ ┌─────────────────────────────────────────┤ │ │ Application │ │ │ ┌──────────┬─────┬─────┬─────┤ │ │ │ ... │ SDL │ GTK │ SDL │ │ │ ├──────────┴─────┴─────┴─────┤ │ │ │ xLib │ │ │ ├────────────────────────────┤ ├─────┴───┬────────┴──┐ X11 │ │ Gnu │ Libraries │  Server │ │ Tools │ │ │ ├─────────┘ │ │ ├─────────────────────┤ │ │ Linux (kernel) │ │ ├─────────────────────┴─────────────────────────┤ │ Hardware │ └───────────────────────────────────────────────┘ 

##X11 server (e.g. x.org) Then X11 (Or Wayland, or ...), the base GUI subsystem. This runs in user-land (outside of the kernel): it is just another process, with some privileges. The kernel does not get involved, except to give access to the hardware. And providing inter-process communication, so that other processes can talk with the X11 server.

┌───────────────────────────────────────────────┐ │ User │ │ ┌─────────────────────────────────────────┤ │ │ Application │ │ │ ┌──────────┬─────┬─────┬─────┤ │ │ │ ... │ SDL │ GTK │ SDL │ │ │ ├──────────┴─────┴─────┴─────┤ │ │ │ xLib │ │ │ ├────────────────────────────┤ ├─────┴───┬────────┴──┐ X11 │ │ Gnu │ Libraries │  │ │ Tools │ │ │ ├─────────┘ │ │ ├─────────────────────┤ │ │ Linux (kernel) │ │ ├─────────────────────┴─────────────────────────┤ │ Hardware │ └───────────────────────────────────────────────┘ 

##X11 Then X11 (Or Wayland, or ...), the base GUI subsystem. This runs in user-land (outside of the kernel): it is just another process, with some privileges. The kernel does not get involved, except to give access to the hardware. And providing inter-process communication, so that other processes can talk with the X11 server.

┌───────────────────────────────────────────────┐ │ User │ │ ┌─────────────────────────────────────────┤ │ │ Application │ │ │ ┌──────────┬─────┬─────┬─────┤ │ │ │ ... │ SDL │ GTK │ SDL │ │ │ ├──────────┴─────┴─────┴─────┤ │ │ │ xLib │ │ │ ├────────────────────────────┤ ├─────┴───┬────────┴──┐ X11 │ │ Gnu │ Libraries │ Server │ │ Tools │ │ │ ├─────────┘ │ │ ├─────────────────────┤ │ │ Linux (kernel) │ │ ├─────────────────────┴─────────────────────────┤ │ Hardware │ └───────────────────────────────────────────────┘ 

##X11 server (e.g. x.org) Then X11 (Or Wayland, or ...), the base GUI subsystem. This runs in user-land (outside of the kernel): it is just another process, with some privileges. The kernel does not get involved, except to give access to the hardware. And providing inter-process communication, so that other processes can talk with the X11 server.

added 19 characters in body
Source Link
ctrl-alt-delor
  • 28.8k
  • 11
  • 66
  • 113
Loading
use correct dash. Role back an edit (a misunderstanding), but also make it clearer.
Source Link
ctrl-alt-delor
  • 28.8k
  • 11
  • 66
  • 113
Loading
add links
Source Link
ctrl-alt-delor
  • 28.8k
  • 11
  • 66
  • 113
Loading
improve diagram, spelling
Source Link
ctrl-alt-delor
  • 28.8k
  • 11
  • 66
  • 113
Loading
improve diagram
Source Link
ctrl-alt-delor
  • 28.8k
  • 11
  • 66
  • 113
Loading
added 384 characters in body
Source Link
ctrl-alt-delor
  • 28.8k
  • 11
  • 66
  • 113
Loading
added 384 characters in body
Source Link
ctrl-alt-delor
  • 28.8k
  • 11
  • 66
  • 113
Loading
added 384 characters in body
Source Link
ctrl-alt-delor
  • 28.8k
  • 11
  • 66
  • 113
Loading
added 399 characters in body
Source Link
ctrl-alt-delor
  • 28.8k
  • 11
  • 66
  • 113
Loading
added 399 characters in body
Source Link
ctrl-alt-delor
  • 28.8k
  • 11
  • 66
  • 113
Loading
Source Link
ctrl-alt-delor
  • 28.8k
  • 11
  • 66
  • 113
Loading