Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux HostsFree MagazinesJobs
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Linux Newbie
Reload this Page Kernel and Kernel Modules
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Linux Newbie If you're new to the wonderful world of Linux, start here!

Reply
 
Thread Tools Display Modes
Old 06-30-2008   #1 (permalink)
Just Joined!
 
Join Date: Jun 2008
Posts: 11
Kernel and Kernel Modules

Is it me or is the concept of kernel and kernel modules very difficult to grasp. If somebody's nice enough, please explain to me in laymen terms what exactly the kernel is, how kernel modules work, and why do most people build the'yre own custom kernels?
romenyrr is offline   Reply With Quote
Old 06-30-2008   #2 (permalink)
Linux User
 
hazel's Avatar
 
Join Date: May 2004
Location: Harrow, UK
Posts: 279
What the kernel is: it's the program that runs all your hardware - disks, keyboard, sound card, memory, the lot. It also does the supervisory tasks such as starting all the other programs, assigning resources to them, switching them in and out of the cpu, and cleaning up after them when they terminate.

In Windows, each piece of hardware has its own separate driver program and all of them are using the system buses at the same time; hence the frequent clashes and freezes. In Linux all the drivers are in the kernel and there are no clashes between them because the kernel always knows what it's doing.

But having drivers for every possible piece of hardware all incorporated in the kernel would make it ridiculously large and slow. So the Linux kernel is modular: there is a kind of basic kernel and then all the drivers and filesystem readers are compiled as modules which can be linked in when required.

People used to build their own kernels. Real geeks still do but a lot of us don't bother. The compiled ones that come with your distro are usually good enough.
__________________
"I'm just a little old lady; don't try to dazzle me with jargon!"
hazel is offline   Reply With Quote
Old 07-02-2008   #3 (permalink)
Linux Engineer
 
Join Date: Nov 2007
Location: Córdoba (Spain)
Posts: 1,156
Quote:
Originally Posted by romenyrr View Post
Is it me or is the concept of kernel and kernel modules very difficult to grasp. If somebody's nice enough, please explain to me in laymen terms what exactly the kernel is, how kernel modules work, and why do most people build the'yre own custom kernels?
The kernel is "the core" of your OS. It's a term that's frequently used in Linux, but in fact, all the OS'es need a kernel in one or another form.

The kernel manages the resources: cpu, memory and i/o devices (that's basically everything). It's the first program that is started when you boot your OS (if you except the bootloaders and the bios firmware, which is on a previous stage).

Linux has had traditionally a monolithic kernel, which means that all the drivers and such was embedded into the same kernel, instead of being on separate modules (both things have advantages and disadvantages, that's for another discussion). Lately, the linux kernel has gained some modularity, and now with things like libusd and fuse you can even do drivers on userland (that's also for another discussion).

In simple words: the kernel is the foundation that's needed by all the rest of programs. It's the one which serves as a bridge between your machine and your software. It decides which program is going to run on a given time slice, and which will be the next one to take time (this is how you can emulate multitasking on a single cpu machine). It also decides how to assign memory to the rest of processes. The programs themselves do not know if they are taking ram or swap memory on a hard drive, or anything else. For they it's just "virtual memory". How that memory is handled, how it's assigned, and where it physically resides it's up to the kernel.

The kernel also manages i/o devices, which in fact, means any arbritrary peripheral.

Most distros comes with precompiled kernels, so, unless you need to do some tweaking for any special reason, you shouldn't need to build one.

In some other cases, for example, metadistros like Gentoo, you need to build your own one.
i92guboj is offline   Reply With Quote
Old 07-02-2008   #4 (permalink)
Linux User
 
hazel's Avatar
 
Join Date: May 2004
Location: Harrow, UK
Posts: 279
Quote:
Originally Posted by i92guboj View Post
with things like libusd and fuse you can even do drivers on userland (that's also for another discussion).
Pardon me, but what's the point of that? I always thought that one of the great advantages of Linux over all Microsoft systems back to DOS is that only one program - the kernel - is using the system buses at any one time. Why change that?
__________________
"I'm just a little old lady; don't try to dazzle me with jargon!"
hazel is offline   Reply With Quote
Old 07-02-2008   #5 (permalink)
Linux Engineer
 
scrarfussi's Avatar
 
Join Date: Aug 2006
Posts: 883
maybe this might help

Filesystem in Userspace - Wikipedia, the free encyclopedia
scrarfussi is offline   Reply With Quote
Old 07-03-2008   #6 (permalink)
Linux User
 
hazel's Avatar
 
Join Date: May 2004
Location: Harrow, UK
Posts: 279
Quote:
Originally Posted by scrarfussi View Post
OK, that's for virtual filesystems. But they're really software constructs. What about hardware? What, for example, would be the advantage of having a usb device driver in userspace rather than in the kernel?

ps I hope we won't be accused of hijacking this thread.
__________________
"I'm just a little old lady; don't try to dazzle me with jargon!"
hazel is offline   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
 

Free Magazines
Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe
Systems Management News, the newspaper for IT systems administration and data center managers!
Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe
The Enterprise Newsweekly
eWeek is the essential technology information source for builders of e-business.
subscribe
Oracle Magazine
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe
Total Telecom
Total Telecom is "The Economist of the communications industry".
subscribe
More free magazines »



All times are GMT. The time now is 07:01 PM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.2.0