LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How many layers of programming are there? (https://www.linuxquestions.org/questions/linux-software-2/how-many-layers-of-programming-are-there-537840/)

SouthernGorilla 03-15-2007 05:10 PM

How many layers of programming are there?
 
This seems like the appropriate forum to ask this question even though it's not about a specific program. I'm just curious to know how many layers of programming there are between the kernel and what I see on the screen, and what the layers do. For example, I'm running ubuntu 6.10 so I have the ubuntu desktop which relies on GNOME which relies on metacity. What do these layers do? What is the difference between the ubuntu desktop and another distro's GNOME-based desktop? I'm not looking for performance issues, just trying to understand the fundamentals of how ditros work and how it's all tied to the kernel.

*I suppose I could have posted this in the newbie forum, but it doesn't really seem to fit there since it's not a "how-to" question. I have plenty of "how-to" questions to ask, but most of those aren't very newbie-ish either.

bulliver 03-15-2007 05:36 PM

Quote:

How many layers of programming are there?
Depends what you are running of course, and these 'layers' do not always match up cleanly or evenly, ie: there is a lot of overlap.

If we start with the kernel, then we have glibc on top of that, which abstracts the system calls. On top of that we have a shell to input commands. For an X desktop we also need the X server running. Then you need a window manager, or full-blown desktop environment, like KDE (WM: Kwin) or Gnome (WM: metacity,sawfish). Each of those will depend on an underlying GUI toolkit (ie: QT, GTK et al...). Any other app you may want to run may have dependencies on other libraries, and each of these libraries may have further dependancies.

The justification for all these 'layers' is twofold I suppose:
1: Modularity. Why force someone to run software they don't want to. IE: if you just want to run fluxbox there is no reason to install all the KDE code.

2. Code-reuse. Why rebuild the wheel everytime you want to write some software? If you want to write a neato DVD player, why not use xine-libs rather than re-writing the DVD-reading code from scratch?

That said, everything I wrote here is grossly oversimplified.

Quote:

What is the difference between the ubuntu desktop and another distro's GNOME-based desktop?
Not much. Perhaps some cosmetic/branding changes, and a few small patches to integrate it with the Ubuntu 'layout'.

studioj 03-15-2007 09:38 PM

like what HE said == that was a great synopsis !

SouthernGorilla 03-16-2007 07:38 AM

Quote:

Originally Posted by bulliver
Depends what you are running of course, and these 'layers' do not always match up cleanly or evenly, ie: there is a lot of overlap.

If we start with the kernel, then we have glibc on top of that, which abstracts the system calls. On top of that we have a shell to input commands. For an X desktop we also need the X server running. Then you need a window manager, or full-blown desktop environment, like KDE (WM: Kwin) or Gnome (WM: metacity,sawfish). Each of those will depend on an underlying GUI toolkit (ie: QT, GTK et al...). Any other app you may want to run may have dependencies on other libraries, and each of these libraries may have further dependancies.

The justification for all these 'layers' is twofold I suppose:
1: Modularity. Why force someone to run software they don't want to. IE: if you just want to run fluxbox there is no reason to install all the KDE code.

2. Code-reuse. Why rebuild the wheel everytime you want to write some software? If you want to write a neato DVD player, why not use xine-libs rather than re-writing the DVD-reading code from scratch?

That said, everything I wrote here is grossly oversimplified.


That certainly does seem to answer the question I asked. Now I need to look at wikipedia and my thesaurus to understand it all, heh.

I understand the benefits of modularity, even the biggest hard drives would fill up quickly if every program contained all the libraries and subroutines it needed. I can't help but wonder if there isn't too much of a good thing, though. It's easy to see how a system can become unstable. A single bug in one library can mess up a dozen programs, each of which can cause further disruption.

I'm still not entirely clear on the issue, but that's my fault. The last time I did any programming was high school, BASIC on an Apple II.

I also gather that I'm better off picking a distro based on the window manager since that's where I'll see more of a difference. I suspected as much since the only difference I see between most of them is their choice in wallpaper.

Thanks for feeding my brain.

pixellany 03-16-2007 08:34 AM

Quote:

Originally Posted by SouthernGorilla
I also gather that I'm better off picking a distro based on the window manager since that's where I'll see more of a difference.

I disagree. I would also consider the package manager and how various utilities are set up to make administration easier.

Try several distros to see what you like---I'm running about 5 at the moment

SouthernGorilla 03-16-2007 05:18 PM

Quote:

Originally Posted by pixellany
I disagree. I would also consider the package manager and how various utilities are set up to make administration easier.

Try several distros to see what you like---I'm running about 5 at the moment

How many can I fit on a 750GB drive? I need to search around and figure out how to install multiple distros without messing up the one I have. I know it involves partitioning, but it's a new and scary concept. I've already had to reinstall ubuntu twice because it's developed issues.

osor 03-16-2007 06:55 PM

Quote:

Originally Posted by SouthernGorilla
What is the difference between the ubuntu desktop and another distro's GNOME-based desktop?

It’s not as brown.

SouthernGorilla 03-16-2007 07:18 PM

Quote:

Originally Posted by osor
It’s not as brown.

Now that's funny.

Is the difference between distros really that superficial?

Did a little more research, tell me if I've got this right. X puts up the window, moves it, sizes it, etc. Gnome controls the content of the window. Metacity puts the frame around it.


All times are GMT -5. The time now is 04:16 AM.