LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 09-16-2022, 07:21 PM   #1
watchintv
Member
 
Registered: Oct 2016
Posts: 57

Rep: Reputation: Disabled
I am a beginner learning about the Linux kernel, any advice?


So, I jut started learning about the Linux kernel. I have setup a GDB environment and want to learn more about the system internals of the kernel. Basically, I am interested in taking apart the the machine and putting it back together. All while understanding what is going on internally. Any advice for someone like me? Somebody who wants to learn how the kernel works. Is GDB even necessary?

Thanks guys, you all have been lifesaver for me.

-E
 
Old 09-16-2022, 07:38 PM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,665

Rep: Reputation: Disabled
Kernel is the OS. I suggest you get acquainted with it first. IMHO the best way to do it is getting sources and then starting with minimal configuration 'make allnocnfig'. From there start adding options and functions until you have a working kernel, read up on every option, don't rush. Then you will have vital knowledge of kernel structure and functionality and can start diving deeper.
 
Old 09-16-2022, 07:57 PM   #3
watchintv
Member
 
Registered: Oct 2016
Posts: 57

Original Poster
Rep: Reputation: Disabled
alright, that sounds good. ill start doing that.
 
Old 09-16-2022, 11:31 PM   #4
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 382Reputation: 382Reputation: 382Reputation: 382
> understanding everything, from the *very bottom up*!!!

Sounds like me, although I'm barely 2% of the way along the full Journey.

My idea is two directions:
1) study documentation on the syscalls and use strace (man 2 intro)
I think you would want to understand what the kernel is and does, before you start to build/configure/modify it

Then 2) the 7,500 CONFIG_ options See the book Linux kernel Programming, pages 66-172

Here's my dream goal: (BTW, do you use VirtualBox?)
https://www.linuxquestions.org/quest...ne-4175716205/

Last edited by !!!; 09-16-2022 at 11:40 PM.
 
Old 09-17-2022, 12:36 AM   #5
watchintv
Member
 
Registered: Oct 2016
Posts: 57

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by !!! View Post
> understanding everything, from the *very bottom up*!!!

Sounds like me, although I'm barely 2% of the way along the full Journey.

My idea is two directions:
1) study documentation on the syscalls and use strace (man 2 intro)
I think you would want to understand what the kernel is and does, before you start to build/configure/modify it

Then 2) the 7,500 CONFIG_ options See the book Linux kernel Programming, pages 66-172

Here's my dream goal: (BTW, do you use VirtualBox?)
https://www.linuxquestions.org/quest...ne-4175716205/
I am using Qemu at the moment. Yeah I am in a similar situation. I am daunted by the all the config options.
 
Old 09-17-2022, 02:08 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,153

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
Go get a book - which one depends on what you intend to do/learn. The kernel is ridiculously dynamic - just look at the patchlist for each release. Any book you get is instantly out of date, but will be useful none-the-less.
I haven't looked recently, but let's say in round numbers the kernel is 25 million (yep, you read that right) lines of code. Pick something that interests you and concentrate on that - could be scheduler, block device drivers, swap, memory management, boot, whatever. Whatever you pick will be getting updates all the time, which can be bloody frustrating when you are trying to learn the code. Stick with it.

As it happens there are now some really quite good tracing tools for the kernel that make life much easier to get involved without knowing all the gory details of the code - I couldn't believe my luck when BPF became available.
 
Old 09-17-2022, 08:44 PM   #7
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,384
Blog Entries: 28

Rep: Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164
There is extensive documentation at kernel.org.
 
Old 09-17-2022, 09:55 PM   #8
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,665

Rep: Reputation: Disabled
Quote:
Originally Posted by watchintv View Post
I am daunted by the all the config options.
Tip: You need to go thru all options and when you are finished you have to repeat, during first round you enabled options and these made more options visible. And then third round. After third you should have a working kernel.

You didn't think you can get it done in one afternoon, did you?
 
1 members found this post helpful.
  


Reply

Tags
gdb, kernel



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Coding bootcamp learning platform and privacy issues with online learning. Need Advice ! slothbin Programming 2 04-01-2016 08:33 AM
books about learning linux for beginner yzzwolf Linux - General 6 11-15-2012 07:11 AM
[SOLVED] For a beginner learning C- is it OK to use old text books? keithostertag Programming 3 02-01-2012 11:25 AM
[SOLVED] Learning Python beginner Help toli Programming 9 01-31-2012 08:49 AM
Beginner Linux-only tools and info on learning C programming? linus72 Programming 1 02-23-2009 11:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 06:23 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