Skip to content

Basic

Build

Building Linux with Clang/LLVM

Generate compile_commands.json

$ ./scripts/clang-tools/gen_compile_commands.py

Install (Replace Distro Default Kernel)

Get distro's kernel config, upon which you make customized configuration.

$ cp -v /boot/config-x.xx.xx .config
$ make menuconfig # make customized configuration

Build kernel:

$ make -j$(nproc)

Install the modules and kernel. Note that initramfs size should be small, or OOM will happen during boot. Pass INSTALL_MOD_STRIP=1 to modules_install make target.

$ sudo make INSTALL_MOD_STRIP=1 modules_install
$ sudo make install

Optionally, edit /etc/default/grub to enable some kernel commandline paremeters:

Take nosmap as an example:

GRUB_CMDLINE_LINUX_DEFAULT="nosmap"

Formatted String

Pointers printed without a specifier extension (i.e unadorned %p) are hashed to give a unique identifier without leaking kernel addresses to user space.

Use %px to print unmodified addresses.

Deadline Task Scheduling

An EEVDF CPU scheduler for Linux

Deadline Task Scheduling - Documentation

System Calls

madvise