LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-13-2011, 10:33 AM   #1
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
How to learn about the deeper parts of Linux?


I have been trying to do LFS, and it's neat and I learned a few things and understand a lot of it, but it also showed be that there's a lot that I don't know. I have always wanted to learn how the kernel, booting, drivers, executables, shared libraries, etc. work, but I don't know how or where to start.

Also, it's not just about not knowing where to start, but it's also both a little overwhelming. I also feel like I don't really understand how something works and it doesn't "click" until I know it (and everything it relies on) deeply, but at the same time I cannot learn it deeply without starting somewhere. It
's like a destructive recursive cycle.

Right now most of what I know is that there's the kernel and it splits the recources among the processes, it has drivers to interface with the hardware that are somehow integrated into it, and it can load and unload "modules", whatever that means.

Do you have any suggestions or places to start?
 
Old 06-13-2011, 11:03 AM   #2
mk27
Member
 
Registered: Sep 2008
Distribution: fedora, gentoo, ubuntu
Posts: 148

Rep: Reputation: 23
"Linux Kernel Architecture" by Wolfgang Mauerer is a great book. It does require some familiarity with C programming, and will be a waste of time without that (but you do not have to be an expert).

If you do not do any programming, I think it will be tough to find sources that explain the kernel in general terms. IMO that's not impossible, I've just never heard of anyone making the effort.

Probably a good place to start, since "modules" is an unknown concept, is to research what linux kernel modules are. "Modules"/modularity is a fundamental programming/software design concept which means pretty much what it says:

http://en.wikipedia.org/wiki/Modularity

A software module is something that is not a stand-alone program, but is designed to be plugged into one, providing some optional functionality. Distro kernels use modules for hardware drivers. This allows the distro to install a basic kernel, and a slew of different modules for all of the possible hardware the kernel can run. Obviously, plugging all those modules in will take up a huge amount of memory, probably slow the kernel down, and definitely create conflicts between modules that do the same thing, just with different hardware. So what happens is the system detects what hardware is actually there, and makes a good guess about what module to use. You can also remove and install modules while the system is running (see man rmmod and man modprobe).

All kernel module code can be built directly into the kernel, meaning their function is no longer provided by a pluggable module. For example, you could build a kernel specifically for your computer, with the video, sound, etc. drivers built into it, so that no modules are required.

Building kernels is actually a good way to learn about them. Unfortunately, this has been discouraged in recent years, and the LDP "Kernel How-to" is no longer maintained (and I think gone from the LDP), which I learned a lot from way back when. But look around and don't be afraid to try it anyway, you can't actually hurt anything. Just make sure you understand your bootloader so that if you build an f-uped kernel you can load your old one by rebooting.

WRT booting, that is not done by the kernel. It's done by the bootloader, which loads the kernel. After that the kernel is in charge of everything.

Quote:
Originally Posted by MTK358 View Post
I also feel like I don't really understand how something works and it doesn't "click" until I know it (and everything it relies on) deeply, but at the same time I cannot learn it deeply without starting somewhere. It
's like a destructive recursive cycle.
I have the same problem, LOL. Eventually you find yourself reading about the transistors that make up the CPU...

To be honest, I would focus on LFS more than the kernel. But: don't treat LFS as anything more than a learning experience. Maintaining a modern linux system built entirely from scratch for regular use is going to be a ridiculous (or near impossible) task on your own. You might, however, combine it with building small bootable systems on cds or usbs. I did this (way back when) on compressed floppy disks (an entire working OS in 3-5 mbs!). For that, you would probably build a kernel using your distro sources (or just use the distro kernel), create a filesystem, and populate from your distro. When you get that to work out, you can try to do one from scratch.

Last edited by mk27; 06-13-2011 at 11:19 AM.
 
Old 06-13-2011, 01:02 PM   #3
mk27
Member
 
Registered: Sep 2008
Distribution: fedora, gentoo, ubuntu
Posts: 148

Rep: Reputation: 23
Quote:
Originally Posted by mk27 View Post
If you do not do any programming, I think it will be tough to find sources that explain the kernel in general terms. IMO that's not impossible, I've just never heard of anyone making the effort.
Hmmm, I just ran across this:

http://www.kroah.com/lkn/

"Linux Kernel in a Nutshell", available through that page as a free pdf, and written for non-programmers. Greg Kroah-Hartman is I think responsible for more code in the current linux kernel than anyone else, including Linus Torvalds, so he should be pretty well informed.

Last edited by mk27; 06-13-2011 at 01:05 PM.
 
Old 06-13-2011, 01:30 PM   #4
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by mk27 View Post
Hmmm, I just ran across this:

http://www.kroah.com/lkn/

"Linux Kernel in a Nutshell", available through that page as a free pdf, and written for non-programmers. Greg Kroah-Hartman is I think responsible for more code in the current linux kernel than anyone else, including Linus Torvalds, so he should be pretty well informed.
I'll look at it. I know C programming, but if the book is for non-programmers I guess that means it's a simpler place to start.
 
Old 06-13-2011, 02:52 PM   #5
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,299
Blog Entries: 61

Rep: Reputation: Disabled
"Linux Kernel in a Nutshell" is mostly about building kernels, and all the configuration options.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux Computer Parts Spectre5 Linux - Hardware 41 03-16-2009 11:59 PM
Wading deeper into the Linux ocean spongedaddy LinuxQuestions.org Member Intro 1 05-15-2008 10:27 PM
LXer: Podcast delves deeper into Linux boot speedups LXer Syndicated Linux News 0 06-23-2007 07:46 PM
LXer: IRD pushes Linux deeper into the enterprise LXer Syndicated Linux News 0 02-19-2007 09:01 PM
LXer: Diving deeper into the latest Linux vulnerability numbers LXer Syndicated Linux News 1 05-03-2006 05:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration