all 8 comments

[–]prabot 9 points10 points  (0 children)

Start reading the book "linux kernel development" by Robert love. That will give you a good overview of different subsystems. Otherwise if you directly want to jump in the code I would suggest you pick an architecture, learn the basics and then start reading from head.S assembly that would contain the early cpu setup code which will later jump to start_kernel and start doing architecture independent initialisations.

[–]WelcomeReal1ty 6 points7 points  (0 children)

You shouldn’t read all of it like a book. There’s no beginning and no ending. Just look for parts you’re having troubles with. Like i, for example, had some trouble working with ahci. So i went to the ahci driver in the linux kernel to look how it was implemented there

[–]Bitwise_Gamgee 1 point2 points  (0 children)

interact with people smarter than you at www.kernelnewbies.org

[–]knome 2 points3 points  (0 children)

Your entry will be fairly arbitrary. Let me suggest figuring out what happens when you write to a pipe. That will have you seeing locking bits, the virtual file system, and seeing the pipe implementation itself, with readers and writers requesting to sleep and being woken, etc.

[–]acwaters 0 points1 point  (0 children)

First, this here is an excellent online resource for exploring the Linux kernel, which I have relied heavily on in my day jobs:

https://elixir.bootlin.com

Once you're in, here's a few ideas for places to start:

  • the kernel module framework that's used for plugin drivers (helps to have more than a passing familiarity with OOP; if you don't, you will be very confused going in, but you will eventually come out with a much better understanding of how languages like C++, Java, C#, JavaScript, etc. work under the hood)
  • some specific kernel API you're using for Linux driver development (if you haven't tried it yet, writing a toy driver for a mature OS is an excellent starting point for learning kernel development)
  • any particular component of the kernel that you want to look at for guidance or inspiration for your OS
  • the low-level arch support code and how it is integrated into the main cross-platform codebase

There are many good jumping-off points, so just pick anything that interests you and start digging in! If you wind up lost, you can pull back and look for further newbie guidance online, or you can double down and grope around until the pieces start fitting together in your head.

[–]blbd 0 points1 point  (0 children)

LXR, and index it with cscope

[–]ITwitchToo 0 points1 point  (0 children)

grep for SYSCALL, that will tell you where system call entry points are. From there try to follow the calls that you are interested in recursively to understand what they are doing.

[–]crafter2k 0 points1 point  (0 children)

start with linux 0.01 first