linux and text GUI ( libncurses)
-
amirsadig
linux and text GUI ( libncurses)
printf and other like function work with character. how does linux let the application to work with pixel, so that it can draw? which system call does that for application? or there is another way to do that!
- Pype.Clicker
- Member

- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:linux and text GUI ( libncurses)
this goes through libraries like ncurses (which does *not* work at pixel level but simply take advantages of some extra-features of the terminals to write at given locations, display objects, menus, etc.
Pixel-drawing can be achieved with libsvga (giving you the same kind of interface as VBE does, but hard to set up due to the special rights you must hold -- often requires you to be root), the X window (sending messages to a graphic server through a network or local socket -- that server must also have the root priviledges to write to the screen).
The last final option is to use OpenGL, which basically acts like X window (client-server approach), but with 3D primitives.
Pixel-drawing can be achieved with libsvga (giving you the same kind of interface as VBE does, but hard to set up due to the special rights you must hold -- often requires you to be root), the X window (sending messages to a graphic server through a network or local socket -- that server must also have the root priviledges to write to the screen).
The last final option is to use OpenGL, which basically acts like X window (client-server approach), but with 3D primitives.
-
amirsadig
Re:linux and text GUI ( libncurses)
I mean - how application in user mode could access video memory or I/O Port which CPU reject when the task run in user mode.
does linux run this application - X Server etc - in kernel Mode?
does linux run this application - X Server etc - in kernel Mode?
- Pype.Clicker
- Member

- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:linux and text GUI ( libncurses)
probably not, those servers must use high-level abstractions like framebuffer driver, etc.
For instance, nVidia has kernel module that allow their implementation of OpenGL to send commands to the hardware -- through that module, and probably reading/writing to /dev/nvidia0
For instance, nVidia has kernel module that allow their implementation of OpenGL to send commands to the hardware -- through that module, and probably reading/writing to /dev/nvidia0