No of course not!
Posted Jul 20, 2004 21:49 UTC (Tue) by
dmantione (guest, #4640)
In reply to:
No of course not! by dwheeler
Parent article:
Kernel Summit: Video Drivers
No. The X-server is not specially privileged other than that it runs as root. By
running as root it is capable of using the ioperm and other low level system
calls to get access to the hardware.
However, even though the X-server runs in user space, it's malfunction can
make the system unusable. Therefore the X-server is just as dangerous code
and must obey to the same stability standards as i.e. in-kernel network drivers.
This is bad design. All dangerous code should be run in kernel space. So,
switching a graphics card into a video mode, should not be done by the X
server. Oh and why should a program be set suid root to be able to do some
basic operation like change a video mode?
Also, being limited to user space, certain features of the graphics hardware
remain unused. For example currently, most graphics drivers resort to polling
methods to check is a device has finished its drawing operation. This is a
waste of time, GPUs can generate an interrupt when drawing is complete.
Need to transfer large amounts of data from system memory to graphics
memory? X wastes your processor cycles. Unnecessary. The GPU can do it
for you using a bus mastering operation. Besides interrupts, you need to work
with physical memory addresses etc. You don't want to do this from userspace.
However, doing this right requires very fast kernel <-> userspace interaction.
And that's the challenge for OS designers.
(
Log in to post comments)