David Herrmann - Journey through 20 years of CONFIG_VT

Abstract

Every modern linux desktop system is based on Virtual Terminals. They indirectly manage access to graphics and input devices and dispatch between multiple active sessions. While the concept of a session-manager is crucial to any established desktop environment, VTs are said to be the most insane solution to this problem. In this talk I want to analyse where CONFIG_VT originated from, how it changed during the years and describe why it is about to go away.

The first occurrence of CONFIG_VT dates back to the first linux release 0.01. It includes a file ./kernel/console.c that states: "Hopefully this will be a rather complete VT102 implementation." Today, this comment can still be found in ./drivers/tty/vt/vt.c. Unfortunately, this comment is rather a wish than a fact. Lots of differences exist between an original DEC-VT100 and the linux VT layer. But besides the VT100 emulator, CONFIG_VT also gained virtual terminal support in linux-0.12. It introduced the session management as we use it today and established the signal-based API. Until today, the API stayed the same. Some details changed, like basic internationalization and device hotplugging, but the user-space API in linux-3.10 does not differ much from the early days.

This journey through 20 years of linux+CONFIG_VT will highlight the possibilities and achievements, but also the oddities and easter-eggs, the race-conditions and API-failures that were made over the years. This archaic infrastructure is way out of date, lacks any proper internationalization support and is probably the most racy subsystem in the kernel we know.

If you like the VT API, if you think that we should preserve the last lines of linux-0.01 code, if the bugs I present don't scare you and if hunting down "console_lock races" is what your dreams are made of, you are welcome to be the first maintainer of CONFIG_VT in the last 5 years. If not, I will present you an alternative developed as part of systemd-logind that will finally give us the opportunity to leave this old legacy behind.