Linux¶
Linux x86 Program Start-Up¶
This tutorial explains the hidden execution path between running a command in a shell and reaching the main() function in a C program. It is an essential resource for debugging issues that occur during the initialization phase of a process.
- ELF Auxiliary Vector: A mechanism used by the loader to pass system information (like page size and UID) to the process.
- Thunks: Small code snippets used to manage Position Independent Code (PIC) by helping the program find the Global Offset Table (GOT).
- Hooks: Demonstration of how to use attributes like
__attribute__((constructor))or sections like.init_arrayto run code before or aftermain.
Linux Memory Management Guide¶
Official docs for the Linux MM subsystem. Covers virtual memory, demand paging, and allocation for kernel/user-space.
- Optimization: Details on HugeTLB, Transparent Hugepages, and zswap (compressed swap cache).
- Efficiency: Features like KSM (merging identical pages) and Multi-Gen LRU for smarter page reclamation.
- Advanced: Covers NUMA policies, DAMON (access monitoring), and userfaultfd for custom page fault handling.
- Config: Managed via
sysctland/proc/sys/vm/.