Jump to content

The kernel


Guest mahiles
 Share

Recommended Posts

This question isn't just specific to Mandrake or Linux but I'm having trouble finding answers so if anyone can help me or point me to any sites it would be much appreciated :)

 

What exactly is a kernel? What does it do? Someone I've spoken to seems to think it turns applications on and off so only one is running at once???

 

Thanks

Link to comment
Share on other sites

The kernel IS your linux operating system. Essentially (and arguably) when you say you are running linux - it is the the Kernel that is Linux.

 

It is the core of your system and does all the basic low-level stuff; including memory management, hardware management etc...

 

It's nothing to do with switching programs off and on - although it will manage threads or processes. A thread is the ability for a system to do more than one thing at a time. This means that when you play a game, for example, the screen can be re-drawn at the same time as the game figures out if you actually hit that alien with your last shot. Most CPUs can't actually handle all the threads at exactly the same time - but it appears that they do, because the kernel schedules and controls them in such a way that the CPU recieves the process to .. erm... process in them ost efficient manner possible, generating the appearance of doing several things at the same time.

 

The kernel is absolutely the most important part of your system and you PC will do very little without it - even windows has a kernel which is core to the OS. A kernel on it's own, however, isn't much use - you need software to run on the kernel to do things. Therefore Linux (i.e. the kernel) comes bundled with lots of software (depending on the distro) which actually makes the power of the kernel useful.

 

Hope this all makes sense - I'm sure you'll get some better answers than this one...

Link to comment
Share on other sites

Erm.

Like phunni says... its a very fundamental part of the system ... or the fundamental part.

Its actually hard to explain, especially without pictures but once you get it its actually simple, like a lot of things. :P

 

Its also elusive because its something you don't wanna see. Like the people who sweep streets at 5AM or work all night in a mail sorting office to make sure you get your post. In fact its all of these things and more.

 

Imagine its the hidden processes doing millions of little jobs all the time. Just like the street cleaners if you go and look for it its there, its not actually hidden, its just that you never need to talk to it youself.

[at this point, if anyone is a street cleaner no misprespect - I just ceased an analogy]

 

Now, in general if you wanna talk to the street cleaners you fill out a form at city hall etc. and this gets submitted to a job cue. Their system sorts it and eventually (with a bit of luck) it ends up being transmitted to the right process/person.

 

These forms are like the programs you use. They are a buffer layer if you like between the kernel and the programs or the admin and the workers (processes) ...

If you try talking to them direct then you mess up their schedules and things get messy so you should normally go through the forms etc.

 

Now these workers sometimes retire and get replaced. Some move on to other jobs etc. but normally you don't need to know about this becuase the admin takes care of it all.

 

If you were a single users on a mulituser Linux or UNIX machine you just care about your programs. you talk to them and they talk back and some sysadmin guy takes care of the kernel etc.

But your at home and your doing his job too. So sometimes you need to know which kernel your running etc. and if your interested you can do lots of tweaking etc.

For instance...

Theirs a new thought that says these street cleaners aren't stupid. They just like getting up early and having the day to themselves. In fact you can allow them to use their brain a bit and plan their own schedules.

This is considered a bit experimental. :D

 

So their is a patch to the kernel called pre-emptive multitaking that allows the workers to think for themselves. They can say sweep street a first becuase they find it more efficient.

 

Thier is also a patch or option Im playing with now.

This allows more than 868MB memory to be addressed. So this is like saying I run a big city and 868 garbage vans isn't enough so Im upgrading my planning software and little lights on the map to show 4096 garbage vans.

 

 

Now unfortunately, one thing about the kernel is it actually talks directly to your garbage vans. Like it powers em up and controls the tipping thing at the back etc.

 

Imagine you have toy-town in minature: Or a super SIMS thing.

You have a control program that looks after garbage, mail sorting and loads of other stuff but its been made to only work with models of garbage vans and mail sorting hardware that were know at the time.

 

Some of these you can buy as options ... you can insert them into your running pprogram like a plug-in and they control dump-truck version 21.6. These are like loadable modules.

 

The kernel uses these for ethernet drivers and sCSI drivrs etc.

However the loadable modules need specially writing for the version of the control program you are using.

When you upgrade your version of the control program the modules need to be remade towork with the new version.

 

Every so often a radical new device comes out. Instead of garbage trucks you have a garbage chute that gets onto undergound conveyors and delivered direct to the tip. Now this is cool and efficient etc. and its only a SIM so we aren't really putting people out of work so we decide to use it.

 

BUT

No way, our control program is written to control trucks not conveyors and no amount of hacking is going to do it effiently SO we need to change the control program ... perhaps we pretended they were trucks for a while but its just not efficient.

SO we change the kernel (control prog).

This has direct support for underground conveyers etc. It works better with them.

 

This is like say the mods for USB2 or firewire. At the moment for instance ALL IDE CD writers are supoprted by pretending they are SCSI.

At some point (possibly) they will be supoprted directly and this will be more efficient....

Currently they load a module called IDE-SCI into the kernel.

In the future a NATIVE module might be written called IDE-CDWRITER ??

 

Also certain things can't be loaded as modules...

For a start your PC boots up from somewhere, in most cases a hard disk but it might be a CD or network. Whatever it boots up from has to be loaded into the kernel before modules can be loaded from a file system ...

 

Hope that helped ????????????????????? :!:

Link to comment
Share on other sites

I'm going to try and put my friend bvc to sleep again with another story.

 

In the simplest terms, Linux is an operating system. It was created in October 1991 by a University of Helsinki student named Linus Torvalds (Linux stands for Linus's UNIX). Linux itself is actually just the kernel; it implements multitasking and multiuser functionality, manages hardware, allocates memory, and enables applications to run.

 

The average user will never be interested enough in any operating system to want to know about things like kernel internals. Only the truly dedicated -- those who have no personal lives, or those who are being paid to do this kind of work -- are going to want to explore these intricacies.

 

But even if you never descend to the giddy depths of kernel hacking yourself, it is reassuring to know that you can easily hire a contractor or firm to do this work for you; to commission such modifications for a proprietary system is very often a more difficult and more costly undertaking.

 

For the beginner, probably the most important thing about the kernel that you need to remember is that odd-numbered kernel versions (in other words, 2.3, 2.5, 2.7) are the experimental, development kernel. Stable, release kernels carry even numbers (in other words, 2.4, 2.6, 2.8).

 

A typical Linux distribution includes the Linux kernel, but it also contains many application programs and tools. For the most part, many system- and user-level tools found in a Linux distribution come from the Free Software Foundation's GNU project (GNU standing for "GNU's Not UNIX").

 

Both the Linux kernel and the GNU tools suite are released under the GNU General Public License, or GNU GPL. If you are not already familiar with the GNU GPL, the best way to begin to understand it is to go and read it. At the risk of summarizing away some important parts, the GNU GPL is a way of setting computer code free so that the people who use that code may meddle and experiment with it to their hearts' content.

 

 

All content I stole from IBM's website. 8)

Link to comment
Share on other sites

Sorry if someones already written what i'm about to say, but i don't have time to read over everyone elses replys.

 

First of all, the kernel is not the operating system as i saw some people here say, there are slight differences. I'll give some definitions of the two.

 

Kernel: The core code of which the operating system relies on to interact with the hardware. The kernel handles things like memory management, process scheduling and hardware interaction.

 

Operating system: Controls resources such as data manipulation, parsing commands, controlling input/output and peripherals.

 

If you dont understand the differences between the above definitions i'll talk about it in a bit more depth.

 

The operating system are the programs that use the kernel to interact with your hardware. All of the software included in your distribution (apart from the kernel) could be called the Operating system.

 

You could basically say that Linux is the kernel that you use (2.4, 2.6 etc), and that Mandrake (or whatever distribution you use) is the Operating System. You should not call 'Linux' an operating system, because it isn't, it is a kernel (i doubt many people care, but hey, some people may as well know).

Link to comment
Share on other sites

Well, I agree with phunni.

If the distro isn't the OS and the kernel isn't the OS then there is no OS. Well, strictly speaking the kernel can't do anything by itself.

It needs an interpreter and several other things but since certain support can be compiled into the kernel this is close enough.

Strictly speaking it doesn't include a filesystem, only device support but you can compile filesystem support into the kernel or as a module.

 

Seriously though, the kernel is what it defines itself to be and this has evolved over the years.

 

For someone who is justifyably interested and understandably confused like Mahiles I think all the definitions are more than adequate.

Link to comment
Share on other sites

I myself am in the Linux is the total package group. Since it is next to meaningless to have a kernel running with no other services, and it is usually necessary to run quite a few extras, such as filesystem, X server, and something like KDE or Gnome, if not other services like SAMBA or Python, or what-have-you, and have other tools avaialable like compilers and the like, it's pretty impractical to talk about Linux as being less than all of that.

 

Whew, that was one single sentence... my old English teachers would kill me.

Link to comment
Share on other sites

JaseP

 

Not disagreeing, I guess its what you wanna make it..

 

But X server is pointless for many linux machines, probably most of them.

Most dedicated linux servers are probably running service like apache or nfs or whatever and don't need a screen, keyboard or mouse.

So I'd say X is an option ...

 

Its also not limited to linux, even XFree86 is not linux specific and runs on many unices. Like bsd, beos etc.

 

Its like a window manager I guess.... completely optional depending on what you want linux to do.

 

Then you can look at embedded devices.... its still the same kernel...

 

If you have a windows NW you need Samba, if not its just a waste of space.

 

I think the definition of

What is Linux.... is what you can strip away to and still have something run ???

 

Anyway, like the earlier poster who gave the technical lowdown.... I guess this is an education type thread so were really discussing 'what it means to us'.

Thats the nice thing about linux :D its whatever you wanna make it :D

Link to comment
Share on other sites

We can also run the same kernel and different OS's ourselves.

 

Like you but the same kernel in gentoo and mandrake etc. as a single bzImage and you could have different 'OS's' with the same kernel.

 

Or you can have 6 different kernels with the OS....

 

strctly I guess its the part under linus's control but he never says an unauthorised patch isn't linux.... just not the linus bersion so even that doesn't work...

 

Im going home before I give myself a headache !!!!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...