kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* New text
@ 2020-02-19 15:54 Ruben Safir
  2020-02-19 21:36 ` Valdis Klētnieks
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Ruben Safir @ 2020-02-19 15:54 UTC (permalink / raw)
  To: kernelnewbies

is there currently a rfecommended text to learn kernel development from?


-- 
So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
http://www.mrbrklyn.com 

DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive 
http://www.coinhangout.com - coins!
http://www.brooklyn-living.com 

Being so tracked is for FARM ANIMALS and extermination camps, 
but incompatible with living as a free human being. -RI Safir 2013


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: New text
  2020-02-19 15:54 New text Ruben Safir
@ 2020-02-19 21:36 ` Valdis Klētnieks
  2020-02-19 23:17   ` Ruben Safir
  2020-02-19 23:43 ` Robert P. J. Day
  2020-02-23  3:51 ` Aruna Hewapathirane
  2 siblings, 1 reply; 9+ messages in thread
From: Valdis Klētnieks @ 2020-02-19 21:36 UTC (permalink / raw)
  To: Ruben Safir; +Cc: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 2816 bytes --]

On Wed, 19 Feb 2020 10:54:10 -0500, Ruben Safir said:
> is there currently a rfecommended text to learn kernel development from?

The first thing to remember is that the kernel has no obligation to be easy for
new programmers. It's more like a Formula 1 race car than a Ford Escort -
there's an expectation that you *really* know what you're doing when you put
your hands on the steering wheel.

As a result, the authoritative source on that is, of course:

$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

Seriously - the kernel is a work in progress, and it's in motion all the time.
There's no way to write a text that's up to date - by the time you finish, the
source tree has moved by 3 or 4 million lines.

Currently, the best is probably Linux Device Drivers, Third Edition (just
google for LDD3 and you'll get a pointer to the PDF).

However - keep in mind that it discusses *concepts* like locking and variable
lifetimes and so on.  It's now somewhere over 15 million lines out of date, and
it's expected that if you can't figure out for yourself what concepts mean, or
what the *current* API is, then you probably shouldn't be writing large chunks
of kernel code that requires undertanding the current APIs.

Note that many bugs are fixable without knowing all that - it's often a
"somebody added A and B, when it should have been A - B" or a stupid null
pointer mistake, or similar.  And drivers/staging is just *full* of stuff that
is in drastic need of help.

Protip: if you've been handed a device dqriver for a 4.7 kernel, and been told to make
it work under a 5.5 kernel, and you have *no* idea how to fix all the compile errors,
the way to proceed is usually:

0) Kernel API changes are *supposed* to break a compile - if you used to pass
an integer as the third parameter, and now it's a pointer to a structure, the
build will break.  Anybody who makes a kernel API change where the third
parameter used to be an integer that meant one thing, and changes it to an
integer that means something else, so it will compile but not work correctly,
will probably get smacked around with a large trout or something. (A common
work around for this is changing a function from (struct *A, struct *B, oldint)
to (struct A*, newint, struct *B) so the compiler will whine).

1) Start wading through the git log until you find the commit that changed the
API. In either that commit, or a commit in the same series, whoever changed the
API also changed all the in-tree users of the API.

2) Look at that commit, and see what got changed in all the in-tree users.

3) Do the same thing to your out-of-tree code.

And here you thought it was difficult, :)

(Of course, if you're trying to get a 2.6.12 driver working on 5.6... you may decide
that it's time to start drinking heavily :)

[-- Attachment #1.2: Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: New text
  2020-02-19 21:36 ` Valdis Klētnieks
@ 2020-02-19 23:17   ` Ruben Safir
  2020-02-20 20:12     ` Valdis Klētnieks
  0 siblings, 1 reply; 9+ messages in thread
From: Ruben Safir @ 2020-02-19 23:17 UTC (permalink / raw)
  To: Valdis Klētnieks; +Cc: kernelnewbies

On 2/19/20 4:36 PM, Valdis Klētnieks wrote:
> The first thing to remember is that the kernel has no obligation to be easy for
> new programmers. 

it is not that hard.  It can be understood, and kernel writers aren't
generally starting out by pouring over the code base to learn how it
works.  OS operations can be taught conceptually, with kernel code
source as an example.   The Love text is a bit old at this point.

> 1) Start wading through the git log until you find the commit that
changed the API. In either that commit, or a commit in the same series,
whoever changed the API

I don't think that will be a useful way to learn to code the kernel.

I'm suprised that there has been no new text since Loves work  :(

-- 
So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
http://www.mrbrklyn.com
DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002

http://www.nylxs.com - Leadership Development in Free Software
http://www.brooklyn-living.com

Being so tracked is for FARM ANIMALS and extermination camps,
but incompatible with living as a free human being. -RI Safir 2013

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: New text
  2020-02-19 15:54 New text Ruben Safir
  2020-02-19 21:36 ` Valdis Klētnieks
@ 2020-02-19 23:43 ` Robert P. J. Day
  2020-02-20  1:55   ` Ruben Safir
  2020-02-23  3:51 ` Aruna Hewapathirane
  2 siblings, 1 reply; 9+ messages in thread
From: Robert P. J. Day @ 2020-02-19 23:43 UTC (permalink / raw)
  To: Ruben Safir; +Cc: kernelnewbies

On Wed, 19 Feb 2020, Ruben Safir wrote:

> is there currently a rfecommended text to learn kernel development
> from?

  not really ... given the speed of development, any book would be out
of date pretty much the instant it hit the shelves. best place to look
is in the in-kernel Documentation.

rday

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: New text
  2020-02-19 23:43 ` Robert P. J. Day
@ 2020-02-20  1:55   ` Ruben Safir
  0 siblings, 0 replies; 9+ messages in thread
From: Ruben Safir @ 2020-02-20  1:55 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Ruben Safir, kernelnewbies

there are diagrams for the linux memory management and paging systems?



On Wed, Feb 19, 2020 at 06:43:05PM -0500, Robert P. J. Day wrote:
> On Wed, 19 Feb 2020, Ruben Safir wrote:
> 
> > is there currently a rfecommended text to learn kernel development
> > from?
> 
>   not really ... given the speed of development, any book would be out
> of date pretty much the instant it hit the shelves. best place to look
> is in the in-kernel Documentation.
> 
> rday

-- 
So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
http://www.mrbrklyn.com 

DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive 
http://www.coinhangout.com - coins!
http://www.brooklyn-living.com 

Being so tracked is for FARM ANIMALS and extermination camps, 
but incompatible with living as a free human being. -RI Safir 2013


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: New text
  2020-02-19 23:17   ` Ruben Safir
@ 2020-02-20 20:12     ` Valdis Klētnieks
  2020-02-20 21:06       ` Ruben Safir
  0 siblings, 1 reply; 9+ messages in thread
From: Valdis Klētnieks @ 2020-02-20 20:12 UTC (permalink / raw)
  To: Ruben Safir; +Cc: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 665 bytes --]

On Wed, 19 Feb 2020 18:17:36 -0500, Ruben Safir said:

> > 1) Start wading through the git log until you find the commit that
> > changed the API. In either that commit, or a commit in the same series,
> > whoever changed the API
>
> I don't think that will be a useful way to learn to code the kernel.

That was addressing the specific case of "I need to update an out of tree
driver to a recent kernel".

And I didn't say the kernel is impossible to learn - only that there's no
special consideration given in-tree to beginning kernel hackers.  If you don't
already understand topics like locking and caching and file systems, you need
to learn those elsewhere.


[-- Attachment #1.2: Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: New text
  2020-02-20 20:12     ` Valdis Klētnieks
@ 2020-02-20 21:06       ` Ruben Safir
  0 siblings, 0 replies; 9+ messages in thread
From: Ruben Safir @ 2020-02-20 21:06 UTC (permalink / raw)
  To: Valdis Klētnieks; +Cc: kernelnewbies

On 2/20/20 3:12 PM, Valdis Klētnieks wrote:
> That was addressing the specific case of "I need to update an out of tree
> driver to a recent kernel".

I hear ya, babe, but I didn't ask that :)



-- 
So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
http://www.mrbrklyn.com
DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002

http://www.nylxs.com - Leadership Development in Free Software
http://www.brooklyn-living.com

Being so tracked is for FARM ANIMALS and extermination camps,
but incompatible with living as a free human being. -RI Safir 2013

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: New text
  2020-02-19 15:54 New text Ruben Safir
  2020-02-19 21:36 ` Valdis Klētnieks
  2020-02-19 23:43 ` Robert P. J. Day
@ 2020-02-23  3:51 ` Aruna Hewapathirane
  2020-03-15 11:10   ` Rishi Agrawal
  2 siblings, 1 reply; 9+ messages in thread
From: Aruna Hewapathirane @ 2020-02-23  3:51 UTC (permalink / raw)
  To: Ruben Safir; +Cc: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 922 bytes --]

>> On Wed, Feb 19, 2020 at 10:54 AM Ruben Safir <ruben@mrbrklyn.com> wrote:
>> is there currently a rfecommended text to learn kernel development from?

There are lot's out there. I have listed below the ones that helped me.

1 - The Linux Programming Interface: A Linux and UNIX System Programming
Handbook  by Micheal Kerrisk who is the man pages maintainer
<https://en.wikipedia.org/wiki/The_Linux_Programming_Interface>
2 - Linux From Scratch
<http://www.linuxfromscratch.org/lfs/downloads/stable/LFS-BOOK-9.0.pdf>

3 - How Linux Works
<http://index-of.es/Varios-2/How%20Linux%20Works%20What%20Every%20Superuser%20Should%20Know.pdf>

4 - Xv6, a simple Unix-like teaching operating system
<https://pdos.csail.mit.edu/6.828/2012/xv6.html>

5 - Advanced Linux Programming

<https://richard.esplins.org/static/downloads/linux_book.pdf>
6 - Linux Networking <http://linux-training.be/linuxnet.pdf>

Hope this helps - Aruna

[-- Attachment #1.2: Type: text/html, Size: 1254 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: New text
  2020-02-23  3:51 ` Aruna Hewapathirane
@ 2020-03-15 11:10   ` Rishi Agrawal
  0 siblings, 0 replies; 9+ messages in thread
From: Rishi Agrawal @ 2020-03-15 11:10 UTC (permalink / raw)
  To: Ruben Safir; +Cc: Aruna Hewapathirane, kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 1332 bytes --]

See if this helps - https://lkw.readthedocs.io/en/latest/

On Sun, Feb 23, 2020 at 9:22 AM Aruna Hewapathirane <
aruna.hewapathirane@gmail.com> wrote:

> >> On Wed, Feb 19, 2020 at 10:54 AM Ruben Safir <ruben@mrbrklyn.com>
> wrote:
> >> is there currently a rfecommended text to learn kernel development from?
>
> There are lot's out there. I have listed below the ones that helped me.
>
> 1 - The Linux Programming Interface: A Linux and UNIX System Programming
> Handbook  by Micheal Kerrisk who is the man pages maintainer
> <https://en.wikipedia.org/wiki/The_Linux_Programming_Interface>
> 2 - Linux From Scratch
> <http://www.linuxfromscratch.org/lfs/downloads/stable/LFS-BOOK-9.0.pdf>
>
> 3 - How Linux Works
> <http://index-of.es/Varios-2/How%20Linux%20Works%20What%20Every%20Superuser%20Should%20Know.pdf>
>
> 4 - Xv6, a simple Unix-like teaching operating system
> <https://pdos.csail.mit.edu/6.828/2012/xv6.html>
>
> 5 - Advanced Linux Programming
>
> <https://richard.esplins.org/static/downloads/linux_book.pdf>
> 6 - Linux Networking <http://linux-training.be/linuxnet.pdf>
>
> Hope this helps - Aruna
>
>
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>


-- 
Regards,
Rishi Agrawal

[-- Attachment #1.2: Type: text/html, Size: 2475 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-03-15 11:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-19 15:54 New text Ruben Safir
2020-02-19 21:36 ` Valdis Klētnieks
2020-02-19 23:17   ` Ruben Safir
2020-02-20 20:12     ` Valdis Klētnieks
2020-02-20 21:06       ` Ruben Safir
2020-02-19 23:43 ` Robert P. J. Day
2020-02-20  1:55   ` Ruben Safir
2020-02-23  3:51 ` Aruna Hewapathirane
2020-03-15 11:10   ` Rishi Agrawal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).