# Linux Kernel Development Environment

> *So, you want to learn how to become a Linux kernel developer? Or you have been told by your manager, “Go write a Linux driver for this device.”* [HOWTO do Linux kernel development](https://www.kernel.org/doc/html/v4.10/process/howto.html)

* [Flex & Bison Are Now Needed To Build The Linux Kernel; Linux 4.16 Can Also Be Snap'ed](https://www.phoronix.com/scan.php?page=news_item\&px=Linux-Now-Needs-Flex-Bison)

## Linux Kernel Source Code

3 Linux Kernel Source Code Repositories

* <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git>
  * git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
* <https://github.com/torvalds/linux>
  * <git@github.com>:torvalds/linux.git
* <https://www.kernel.org/>
  * Tar.Gz

## Workstation Setup

```bash
root@workstation:~# apt-get update
root@workstation:~# apt-get upgrade
root@workstation:~# apt-get install linux-headers-$(uname -r) kernel-package libncurses5 libncurses5-dev git libelf-dev
```

```bash
user@workstation:~$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Cloning into 'linux'...
remote: Counting objects: 5396825, done.
remote: Compressing objects: 100% (2538/2538), done.
remote: Total 5396825 (delta 2876), reused 3072 (delta 2127)
Receiving objects: 100% (5396825/5396825), 984.15 MiB | 6.28 MiB/s, done.
Resolving deltas: 100% (4522724/4522724), done.
Checking connectivity... done.
Checking out files: 100% (59844/59844), done.
user@workstation:~$
```

```bash
user@workstation:~$ cd linux
user@workstation:~/linux$
```

```bash
user@workstation:~/linux$ ls
arch        crypto       init     MAINTAINERS      net       System.map
block        Documentation  ipc        Makefile         README    tools
built-in.o  drivers       Kbuild   mm             samples   usr
certs        firmware       Kconfig  modules.builtin  scripts   virt
COPYING     fs           kernel   modules.order    security  vmlinux
CREDITS     include       lib        Module.symvers   sound     vmlinux.o
user@workstation:~/linux$
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://theiotlearninginitiative.gitbook.io/coba/linux-kernel-development-environment.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
