New to linux kernel

Hi

I bought a book called Linux kernel development 3rd edt. by Robert Love.

My question is "Is that a good book to learn more about Linux and its kernel ?".
if the answer is false please advice me for some book.

And another thing is that the book introduces C as the language the Kernel was written in. They advice to use GNU gcc compiler with C99 standard.
So the question is "Can I write my code in C++". If so what C++ standard should I use.

Thank you for reading this.
Hi MCCodo,

Reviews seem to indicate it's a pretty decent book. Please note that it's 6 years old and you need to be competent enough to realize when an interface in the kernel has changed and how to adapt. The Linux kernel is mostly self documenting... You need to be able to, for the most part, read and understand what code in the kernel is doing. For instance, if you want to make a USB kernel driver, you should be able to read the code on all of the utilities in order to understand fully the consequences that has on the objects you pass to it. This book might direct you on concept and interface but I doubt it will explain every section of the kernel. In addition, I already know some of the interfaces have changed. If you take anything from the book, let it teach you how to understand kernel code and how to function (debugging, safer practices in C, organized code) while programming in the kernel. Understanding how Linux specifically works is secondary.

Remember that a single null dereference, a single overflow or underflow, and you potentially have a non-functioning kernel that will soon panic. It's not for the light of heart.

You cannot write a kernel module in C++ out of the box. The Linux kernel, in various areas, goes out of its way to prevent the use of C++ within the kernel, such as causing intentional naming conflicts, using VLAs, not checking for a C++ compiler in headers, and so forth. Theoretically, you could provide your own C++ headers without touching a single bit of C implementation code... you can do the same for D or Rust as well. I've done it, actually, as a test subject but it gets complicated very quick in any advanced use. I don't quite remember the magic I pulled to get it to create all the magic values required for a kernel module either. There's not much interest in the matter... good luck.
Last edited on
Topic archived. No new replies allowed.