Why can MS-DOS run graphical games without a desktop, while Linux usually needs one?

0
5
Asked By MellowCedar42 On

If Debian is booted into a text-only console with no desktop environment, why can't I run ordinary graphical applications or games there? MS-DOS also presents a text-based interface, yet many DOS games could switch to graphics and use the screen directly. What is different about the way Linux handles graphics, and can Linux programs render graphics without X11 or Wayland?

4 Answers

Answered By QuietHarbor7 On

Linux can run graphics without a full desktop environment, but the program still needs a graphics interface. A game can use the framebuffer or the newer DRM/KMS interfaces directly, or use a library such as SDL configured for a console backend. The desktop and display server are conveniences that provide windows, input handling, and coordination between applications; they aren't the only way to access the GPU.

Answered By PixelMoth_31 On

DOS games generally included their own hardware-specific graphics code and assumed a fairly predictable PC. DOS also offered very little protection or isolation, so a program could take over the machine and write to video memory or use BIOS graphics services directly. Modern Linux supports many kinds of hardware and multiple processes at once, so the kernel controls the hardware and exposes safer, standardized interfaces instead of letting every application freely take over the display.

MellowCedar42 -

So the limitation isn't that a Linux console is inherently text-only; it is that most graphical programs are written to target a display server or another graphics backend rather than taking over the hardware themselves.

Answered By CopperOrbit9 On

A desktop environment is not the same thing as the display server. You can boot to a virtual console with no desktop and run a program using a direct framebuffer, DRM/KMS, or a suitable SDL backend. Some emulators and game ports do exactly this. The program must be designed or configured for that mode, and it usually needs permission to access the graphics device.

Answered By Northwind!58 On

There are also ways to display graphics remotely. A graphical program can use a network-capable display protocol, while a plain SSH terminal normally only carries text. That is why launching a normal GUI application from an SSH session may fail unless a graphical display is available, even though Linux itself is capable of rendering without a desktop.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.