![]() There are many ways to set up a Linux VM we really don't want to get into the details and the pros and cons of each of them here.īut if you are not familiar with this, don't worry. Here, I won't delve into the minutiae of installing Linux as a guest on Oracle VirtualBox, the reason being that this installation is not directly related to Linux kernel development. For example, to set up the ctags index, just cd to the root of the source tree and type ctags -R. The root of the source tree has some code that is common to all chapters, such as the source files convenient.h, klib_llkd.c, as well as others.įor efficient code browsing, I would strongly recommend that you always index the code base with ctags(1) and/or cscope(1). Each chapter is represented as a directory – for example, ch1/ has the source code for this chapter. ![]() The source code is organized chapter-wise. You can clone and work on it by cloning the git tree, like so: git clone Working within a guest VM also adds an additional layer of isolation and thus safety.Ĭloning our code repository: The complete source code for this book is freely available on GitHub at. So, we will assume that you are working on a Linux guest. However, for the purposes of this book, we cannot assume that you will always have a dedicated native Linux box available to you. Like any seasoned kernel contributor, I would say that working on a native Linux system is best. It should be pretty obvious – the more RAM and CPU power the host system has, the better! Internet access is definitely helpful and required at times.Īs performing tasks such as building a Linux kernel from source is a very memory- and CPU-intensive process, I highly recommend that you try it out on a powerful Linux system with plenty of RAM and disk space to spare as well.Either a DVD drive or a USB port for the installer media (not required when setting up Ubuntu as a guest VM).25 GB of free hard drive space (I suggest more, at least double this).Running as a guest VM: The host system should have at least 4 GB RAM (the more the better and the smoother the experience).Running on physical host: 2 GB or more system memory (more will certainly help).Ubuntu Desktop specifies the following as "recommended system requirements" for the installation and usage of the distribution: You will need a modern desktop PC or laptop. Setting up the software – distribution and packages.This chapter will take us through the following topics, which will help us set up our environment: Hence, this book gives you many hands-on experiments and kernel code examples that you can and indeed must try out yourself this will greatly aid in your making real progress and deeply learning and understanding various aspects of Linux kernel and driver development. The best way to learn something is to do so empirically – not taking anyone's word on anything at all, but trying it out and experiencing it for yourself. We will also clone this book's code repository on GitHub, and learn about a few useful projects that will help along this journey. We will install a recent Linux distribution, preferably as a Virtual Machine ( VM), and set it up to include all the required software packages. This chapter will teach you exactly how to do this and get started. To get the most out of this book, it is very important that you first set up the workspace environment that we will be using throughout the book. Hello, and welcome to this book on learning Linux kernel development. You’ll also benefit from more advanced material on cache effects, a primer on lock-free techniques within the kernel, deadlock avoidance (with lockdep), and kernel lock debugging techniques.īy the end of this kernel book, you’ll have a detailed understanding of the fundamentals of writing Linux kernel module code for real-world projects and products. The following chapters will cover key kernel internals topics including Linux kernel architecture, memory management, and CPU scheduling.ĭuring the course of this book, you’ll delve into the fairly complex topic of concurrency within the kernel, understand the issues it can cause, and learn how they can be addressed with various locking technologies (mutexes, spinlocks, atomic, and refcount operators). Next, you’ll write your first kernel module using the powerful Loadable Kernel Module (LKM) framework. You’ll start the journey by learning how to build the kernel from the source. By working with the 5.4 LTS kernel throughout the book, you can be confident that your knowledge will continue to be valid for years to come. This book uses the latest 5.4 Long-Term Support (LTS) Linux kernel, which will be maintained from November 2019 through to December 2025. This easy-to-follow guide will have you up and running with writing kernel code in next-to-no time. Linux Kernel Programming is a comprehensive introduction for those new to Linux kernel and module development. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |