Anatomy of the Linux Kernel
LinucksGirl writes "The Linux kernel is the core of a large and complex operating system, and while it's huge, it is well organized in terms of subsystems and layers. In this article, the reader explores the general structure of the Linux kernel and gets to know its major subsystems and core interfaces. 'When discussing architecture of a large and complex system, you can view the system from many perspectives. One goal of an architectural decomposition is to provide a way to better understand the source, and that's what we'll do here. The Linux kernel implements a number of important architectural attributes. At a high level, and at lower levels, the kernel is layered into a number of distinct subsystems. Linux can also be considered monolithic because it lumps all of the basic services into the kernel. This differs from a microkernel architecture where the kernel provides basic services such as communication, I/O, and memory and process management, and more specific services are plugged in to the microkernel layer.'"
I posted the question "What is the Linux kernel" to Ask a Ninja on YouTube. He told me it was a secret project undertaken by tree squirrels to create a time machine from the kernels of nuts so they could fast forward through winter cos they are fed up being stuck indoors for the winter months.
Do not try to read the dupe, thats impossible. Instead, only try to realize the truth
What truth?
There is no dupe
That takes you into the guts of a distribution, but not much further than "make menuconfig" into the kernel itself. Woot.
Not that there's anything wrong with Linux From Scratch, but a deep diving kernel expedition it isn't.
The graph hints that 2.6.0 is the last major release, but isn't the scheme 2.6.x.y where x is major and y is minor nowadays?
My other account has a 3-digit UID.
From TFA (emphasis mine): "Linux quickly evolved from a single-person project to a world-wide development project involving thousands of developers. One of the most important decisions for Linux was its adoption of the GNU General Public License (GPL). Under the GPL, the Linux kernel was protected from commercial exploitation, and it also benefited from the user-space development of the GNU project (of Richard Stallman, whose source dwarfs that of the Linux kernel). This allowed useful applications such as the GNU Compiler Collection (GCC) and various shell support." Tivo?
8 of 13 people found this answer helpful. Did you?
that is starting to rival teh microsoft ;)
The diagrams are nice and for the most part the text is okay, but there is one glaring error that should have been edited out before this was published:
This is false and could be very confusing for readers who don't already know about the structure of Linux. The diagram gets it right.
Some people like to work from the inside (kernel) out (distribution), and other people like to work from outside (distribution) in (kernel). Just pick the one that works out the best for you.
Interesting article but really quite vague.
There is no place like
RTFA. Linux From Scratch is not about understanding the insides of the kernel, it's all about building a custom distro.
My other account has a 3-digit UID.
Interesting to read about events from a bygone era.
If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
5 million lines of code? Are they allowed to show all that.
/insert another "anatomy" joke here.
That's hot.
Ginga no Rekshiya Mata Each page.
Its awesome that the article is being hosted at IBM.. Perhaps more people will start to shift away from windows and more titles will be available. i think dell is also shipping with linux, yes?
Computer Consultant http://www.itcallout.com.au/
Yes, the diagram gets it right, but the text is essentially correct (unless you insist on being overly pendantic). glibc provides a portable system call interface via functions such as read(), write(), and open(). These functions provide the mechanism to transition between the user-space application and the kernel, ie, they invoke sysenter and sysexit (or int 0x80) on x86 cpus.
Unless you're so l33t that you invoke all your system calls with inline assembly?
Have the developerworks levels been recalibrated for web programmers, what's intermediate about that article? It's a contentless high level intro suitable for executives.
An intermediate article should discuss an implementation detail with sample code.
Would someone care to elaborate?
now if those ibm blades only ... ... wow ... 15 years since
had video/audio-in
it's been
i touched a original ibm made computer.
Here is a great tool to visualize your kernel and then print a poster of it ;-).( and yes you also can stick 16 A4's to a wooden plate but that's just plain silly)
http://fcgp.sourceforge.net/
you do need a big printer for it if you want a readable poster though
I does however show you in perfect details all the arch's and sub systems of the kernel.
Hush little kernel, nobody said you are getting a little f-a-t!
This is what pron for geek look like?
Nah, it's not really about building a distro, in terms of something you're actively engineering for others.
http://www.linuxfromscratch.org/lfs/:
Why would I want an LFS system?
Many wonder why they should go through the hassle of building a Linux system from scratch when they could just download an existing Linux distribution. However, there are several benefits of building LFS. Consider the following:
LFS teaches people how a Linux system works internally
Building LFS teaches you about all that makes Linux tick, how things work together and depend on each other. And most importantly, how to customize it to your own tastes and needs.
Building LFS produces a very compact Linux system
When you install a regular distribution, you often end up installing a lot of programs that you would probably never use. They're just sitting there taking up (precious) disk space. It's not hard to get an LFS system installed under 100 MB. Does that still sound like a lot? A few of us have been working on creating a very small embedded LFS system. We installed a system that was just enough to run the Apache web server; total disk space usage was approximately 8 MB. With further stripping, that can be brought down to 5 MB or less. Try that with a regular distribution.
LFS is extremely flexible
Building LFS could be compared to a finished house. LFS will give you the skeleton of a house, but it's up to you to install plumbing, electrical outlets, kitchen, bath, wallpaper, etc. You have the ability to turn it into whatever type of system you need it to be, customized completely for you.
LFS offers you added security
You will compile the entire system from source, thus allowing you to audit everything, if you wish to do so, and apply all the security patches you want or need to apply. You don't have to wait for someone else to provide a new binary package that (hopefully) fixes a security hole. Often, you never truly know whether a security hole is fixed or not unless you do it yourself.
I'll add that it will give you some excellent OJT on the various tools, as well as an appreciation both for why GUI and a pre-compiled OS is both a luxury and a prison compared to a CLI and source code.
Package management is a chore, though. Once you're in the door, you may go eventually near the ol' online distro of justice...
Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
Huh? The Linux kernel is at the core of Windows?
"If any part Linux was stolen, then Windows was the biggest heist in history."
I did read the article. I thought it was pretty good. I'm just suggesting one way of approaching the understanding of the kernel. I don't understand why the mods are being so anal. Off topic? This is highly relevant to *my* learning experience that I started a few days ago.
You must be new here. I expected that comment from an Anonymous Coward, not someone with an ID number that's 162,108 newer than mine.
I don't disagree, in theory. In practice, there are at least a few things that microkernels can do that monolithic kernels can't (yet).
For example, a microkernel can run filesystems and probably even certain kinds of drivers on a per-user basis. Give them access to the chunk of hardware they need, but don't require them to be able to pwn the rest of the system. This would be really nice for binary drivers, too -- it not only kills the licensing issues, but it allows us to, for example, run nvidia drivers without trusting nvidia with any hardware beyond my video card.
Microkernels can also allow drivers to be restarted and upgraded easily, without having to upgrade the entire system. It would be theoretically possible to upgrade the nvidia drivers in-place, or even recover from an nvidia driver crash without having to reboot the whole system. If it was designed intelligently, you might not even have to restart X to reload a driver.
Monolithic kernels can do this in theory. In practice, "kernel modules" are ugly and hackish, often requiring you compile a kernel module for a specific kernel version, and too often being held "in use" by something. Also, they just sit there eating up RAM (though a small amount, I admit) when not being used, yet often you want them loaded anyway -- for example, loop is completely useless except for the 1% of the time I want to mount a disk image, but if loop isn't loaded, mount won't load it.
One of the major selling points of a Unix system in the first place, at least to me, was that a single rogue program is unlikely to bring the entire system down with it. Sure, forkbombs still work, and eating tons of memory still sucks, although you can prevent both of them -- but you don't often have the situation you see on Windows (especially 95/98), where a single badly-written program can make the whole system unstable.
This is true on microkernels, only more so. In order to replace them entirely with a monolithic kernel, you need a bit more than type-safety -- you need a language that is restrictive enough that you can actually run multiple, untrusted programs in the same address space. If you can do that, you don't even need userspace processes to have a private address space, except for some backwards-compatible POSIX layer.
But then you're stuck with the tricky problem of making that kind of language useful for the low-level stuff a kernel has to do. Like it or not, I don't think we're at a point where you can make a viable kernel in LISP or Erlang, though Java might be close (when extended with C, which kind of kills the point).
I would love to develop such a system, but I am about to be gone for two weeks, and when I get back, I still won't have a ton of time.
And I think you're probably wrong about microkernels using shared memory "destroying the separation advantage" -- I'm guessing it's probably done in a fairly safe/quick way. (Or if it's not, it can be.) Consider a pipe between two processes -- what you write to stdout would, in a naive implementation, be copied to the stdin of the other process. A smarter implementation might actually allow you to simply pass ownership of that particular buffer to the other process -- functionally about the same, but almost as fast as shared memory.
But if I have no clue what I'm talking about, please tell me. I don't want to sound like a moron.
Don't thank God, thank a doctor!
Due to the nature of the BSD license, I wouldn't be surprised if NT had as much BSD code in it as OS X does.
Of course, that's difficult to prove. All we really know are a few trivial things like telnet, although I hear most modern OSes just ripped off the BSD network stack wholesale.
Don't thank God, thank a doctor!
'The Linux kernel is the core of a large and complex operating system, and while it's huge, it is well organized in terms of subsystems and layers.'
Should read:
'The Linux kernel is a large and complex operating system, and while it's huge, it is well organized in terms of subsystems and layers.'
Although based upon the comments from those who claim to have read the article it doesn't look like the article covers anything but compiling the Linux operating system with make menuconfig. It does apparently include information about the other software that is included with the operating system to make up complete operating system distributions.
Apologies to Mr. Bunk. That's what happens when you make a geek get up at 5:00 A.M. to take somebody to the airport.
Finally modding someone offtopic when they rant about what "Begging the Question" means: priceless.
Kernels are not Operating Systems and it is syntactically incorrect to place a "," before an "and", although it is usually acceptable where one list contains a second list. In this case, where the "and" applies to the whole of the remainder of the sentence and not just the insert, the comma should follow the and.
It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
Trustworthy is an adjective, meaning that the trust placed on an object is valid.
Perhaps a better way of saying what you said:
See the difference? Millions of people trust untrusworthy code every day.
libertarian: (n) socially liberal, financially conservative; neither left, nor right.