How a windowing system is implemented in C ?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users How a windowing system is implemented in C ?
# 1  
Old 02-14-2014
Debian How a windowing system is implemented in C ?

Hi All,
I was wondering how using C the programmers have implemented a GUI (x window & ms windows). Am curious to learn about the overall architecture.

I learned a bit about graphics primitives, memory mapped io, etc
I want to learn more whether the above is the foundation upon which modern GUI are built on both Windows & Linux.
Also, i want to know how the Kernel comes into play here.
# 2  
Old 02-14-2014
Xwindows is usually based on the ncurses library. See what your manual page for ncurses shows you.

This is a good how-to document:

NCURSES Programming HOWTO
This User Gave Thanks to jim mcnamara For This Post:
# 3  
Old 02-14-2014
i read very quickly the ncurses manual.

but my question is at a much lower level how the code accesses the bare graphics card?
# 4  
Old 02-14-2014
Actually you should be using Xlib. There are some tutorials around, just google for it. Xlib talks to the Xserver. The Xserver talks to a HAL type driver. I guess you could get the source code to the Xserver and be a replacement Xserver. But you would need to talk to the HAL driver. The HAL drivers talks to a driver supplied by the guys who made the video card. I have heard complaints that they don't open-source their drivers. But I have never looked into that. I really have never peeked inside Xserver, but I gather that you cannot talk directly to the graphics hardware.

I suggest you stick with Xlib.
# 5  
Old 02-14-2014
Quote:
Originally Posted by coolatt
but my question is at a much lower level how the code accesses the bare graphics card?
Nobody except graphics card manufacturers has programmed graphics cards at the bare metal for over 20 years. If you want the best performance, you use the drivers they make. For UNIX, that mostly means using the drivers they make for X11.

Memory-mapped I/O is often involved, yes.
This User Gave Thanks to Corona688 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Linux

X Windowing Free Open Source Software at Windows Desktop

I am using a ssh session for my org Linux box to do all my installation work. Recently I installed a X Serve app but could not start its execution cause neither I am sure if X Server is running or not nor of how the app output (X windowing app) would be rendered on a Windows desktop from where I am... (3 Replies)
Discussion started by: uunniixx
3 Replies

2. Programming

Algorithm needs to be implemented in JAVA

Hi, I need to implement this algorithm in JAVA. I tried to write half of the code But I stopped in the other half. The algorithm: Marking procedure at router R: let R' = Bitlntereave(R, Hash(R)) let k be the number of non-overlapping fragments in R' for each packet w let x be a random... (0 Replies)
Discussion started by: ENG_MOHD
0 Replies

3. Linux

swapon: Function not implemented

Hi, Trying to add a swap file to my server as below: dd if=/dev/zero of=/swapfile1 bs=1M count=2048 2048+0 records in 2048+0 records out 2147483648 bytes (2.1 GB) copied, 27.4514 seconds, 78.2 MB/s # mkswap -c /swapfile1 Setting up swapspace version 1, size = 2147479 kB # swapon... (6 Replies)
Discussion started by: chris5126
6 Replies

4. UNIX for Dummies Questions & Answers

X Windowing system

Hi All, I am new to UNIX. In a linux text I have seen that the display is managed by X windowing system. Please give some details about the working of X windowing system. Any help would be appreciated Thanks, Jaysamson (1 Reply)
Discussion started by: jaysamsonp
1 Replies

5. UNIX for Advanced & Expert Users

What do you want to see implemented in Unix ?

Hello all, I just want to ask everyone what does he/she want to see implemented in Unix ? Applications, services, drivers, modules ? Just mention it here :) Thank you very much in advance. (0 Replies)
Discussion started by: core-ix
0 Replies

6. UNIX for Advanced & Expert Users

Free software like proftpd or wu-ftpd implemented under SSH

Anybody can to suggest to me a ftp software like proftpd or wu-ftpd (ftp with chroot for users) implemented with tunneling under SSH. Thanks in advance. Hugo. (2 Replies)
Discussion started by: hugo_perez
2 Replies
Login or Register to Ask a Question