linux and text GUI ( libncurses)

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
amirsadig

linux and text GUI ( libncurses)

Post by amirsadig »

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!
User avatar
Pype.Clicker
Member
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)

Post by Pype.Clicker »

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.
amirsadig

Re:linux and text GUI ( libncurses)

Post by amirsadig »

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?
User avatar
Pype.Clicker
Member
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)

Post by Pype.Clicker »

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
Post Reply