Graphics in Minix.

1,110 views
Skip to first unread message

Srinivas Nayak

unread,
Oct 5, 2012, 2:29:59 PM10/5/12
to min...@googlegroups.com
Dear All,

My query is, in Minix OS, how graphics is handled?

To my knowledge,
Bottom-most layer must be hardware.
What is above it? Device driver from hardware vendor?
Then, on top of it, is there a hardware abstraction layer? To provide drawpixel, drawline, draw circle etc to upperlayer?
Then, I think, other applications/windowmanagers shall be there...

This is just my idea. Got from general OS principle books.
Am I wrong?

Please help, how generally graphics are handled in an OS.
From where, we shall expect drawpixel, drawline, drawcircle etc functions?

Sincerely,
Srinivas Nayak

Erik van der Kouwe

unread,
Oct 5, 2012, 2:43:29 PM10/5/12
to min...@googlegroups.com
Hi,

MINIX does not provide graphics drivers or a graphics API. The only thing it provides on the screen is terminals. This is handled by the tty driver. There is no need here for hardware-specific code, as text mode has a universal hardware interface on the PC platform (provided from the VGA standard, if I am not mistaken).

Graphics drivers and a graphics API providing the functionality you mention are provided by X, which is a user-space server program that can access video memory directly. Programs requiring graphics (X clients) connect to X over a socket and use the X11 libraries to send commands over that connection.

For more details: http://en.wikipedia.org/wiki/X_Window_System

The situation as described here is not specific to MINIX, but applies to most UNIX-like operating systems. Other operating systems, like Windows, do provide graphics as part of the operating system though I am not sure to which extent that is done in the kernel (Windows is able to restart graphics drivers so there is probably some form of isolation).

With kind regards,
Erik

Op vrijdag 5 oktober 2012 20:29:59 UTC+2 schreef Srinivas Nayak het volgende:

Antoine LECA

unread,
Oct 8, 2012, 4:46:16 AM10/8/12
to min...@googlegroups.com
Erik van der Kouwe wrote:
> The situation as described here is not specific to MINIX, but applies to
> most UNIX-like operating systems. Other operating systems, like Windows, do
> provide graphics as part of the operating system though I am not sure to
> which extent that is done in the kernel (Windows is able to restart
> graphics drivers so there is probably some form of isolation).

As I understand it, the basic design of Windows is
- hardware device(s)
- HAL which provides the hooks and bolts to interface with the rest of
the platform (PCI arbitration, for example)
- "video kernel-mode driver", provided usually by the hardware vendor
(which failures usually cause BSoD)
- win32k/dxg graphics manager which is a ring0 server provided by
Microsoft (design was much like Minix servers in NT3, but was moved into
kernel space for performances reasons)
--- privilege transition ---
- "video user-mode driver", provided usually by the hardware vendor
(which one is sometimes "restarted"), linked with a MS-provided library
which provides unoptimized implementation of most features
- several graphics APIs (GDI, OpenGL, GDI+, DirectX, WDDM) as well as
the text-mode console; later is very much analogous to Minix's tty.c.

The user-mode video driver can also been seen as an optimized
implementation of the features that the hardware my be able to perform,
which is linked with the generic graphics code (so simpler hardwares
have the most basic drivers, while powerful ones have the more complex
drivers... while are more prone to bugs.)


I am not sure the full design of X11 is very different: the "video
kernel-mode driver" is usually called the frame-buffer providing
interface, but the difference here is between a functional description
as opposed to an architectural one, I think.


Antoine

prasannatsmkumar

unread,
Oct 8, 2012, 1:00:03 PM10/8/12
to min...@googlegroups.com
Up until Windows XP most part of the graphics was in kernel mode. A lot of crash occurred because of this. From Windows Vista most of the rendering stuff are moved to user space to avoid crash.

In Linux there is something called KMS (kernel mode setting) and DRI (Direct rendering infrastructure) which takes care of basic hardware stuff like setting the correct display resolution and taking care of buffer allocation, sharing of GPU resources respectively. Windows Vista and above also does almost same thing in kernel mode.

In Linux (recent distributions and kernels) X relies on the KMS for setting resolution and for hardware access etc. TTY and X had access to the same device and kernel is not aware of the state of the GPU when the system goes into sleep/hibernate which means waking up is a problem. So a kernel part of the driver was required and DRI came up to serve this need (in 2000 if I remember correctly).


On Mon, Oct 8, 2012 at 2:16 PM, Antoine LECA <antoine...@gmail.com> wrote:
Erik van der Kouwe wrote:
> The situation as described here is not specific to MINIX, but applies to
> most UNIX-like operating systems. Other operating systems, like Windows, do
> provide graphics as part of the operating system though I am not sure to
> which extent that is done in the kernel (Windows is able to restart
> graphics drivers so there is probably some form of isolation).

Windows checks if the GPU responds for any operation within a certain timeout period (generally it is 2 seconds). If the device does not respond it assumes that the GPU has stalled and asks the driver to restart (put it in a known working state). This is nothing related to a bug in kernel code - If the kernel driver part has some bug the system will crash. This Timeout Detection and Recovery (TDR) is used to make sure some user space application gives a call that stalls the GPU for a long time which will look like system hang to the user. This is also to prevent bugs in the GPU (which causes stall) or problems in very high graphics demanding applications / games.
 

--
You received this message because you are subscribed to the Google Groups "minix3" group.
To post to this group, send email to min...@googlegroups.com.
To unsubscribe from this group, send email to minix3+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/minix3?hl=en.



Hope this helps,
PrasannaKumar

BeakGwangMoon

unread,
Oct 8, 2012, 5:21:16 PM10/8/12
to min...@googlegroups.com
Dear Srinivas Nayak
If  you have a VGA tty driver,  you can do it.
 
Actually, Old MINIX had the VGA tty driver ( at minix-vmd or minix-1.5).
 
minix 1.5 can display a DBCS like a japanese, korean character.
Sincerely,
moon
Reply all
Reply to author
Forward
0 new messages