Download linux kernel from www.kernel.org

1. wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.1.3.tar.gz

2. tar -xzvf linux-4.1.3.tar.gz

3. patch -p1 patch-4.1.3

After downloading the linux kernel from https://www.kernel.org/ , it contains the following file structure.

  1. arch. This directory contains architecture-specific files. You will see separate subdirectories under arch/
    for processors such as ARM, Motorola 68K, s390, MIPS, Alpha, SPARC, and IA64.
  2. block. This primarily contains the implementation of I/O scheduling algorithms for block storage devices.
  3. crypto. This directory implements cipher operations and the cryptographic API, used, for example, by
    some WiFi device drivers for implementing encryption algorithms.
  4. Documentation. This directory has brief descriptions of various kernel subsystems.
  5. drivers. Device drivers for numerous device classes and peripheral controllers reside in this directory. The
    device classes include character, serial, Inter-Integrated Circuit (I2C), Personal Computer Memory Card
    International Association (PCMCIA), Peripheral Component Interconnect (PCI), Universal Serial Bus (USB),
    video, audio, block, Integrated Drive Electronics (IDE), Small Computer System Interface (SCSI), CDROM,
    network adapters, Asynchronous Transfer Mode (ATM), Bluetooth, and Memory Technology Devices
    (MTD). Each of these classes live in a separate subdirectory under drivers/.
  6. fs. This directory contains the implementation of filesystems such as EXT3, EXT4, reiserfs, FAT, VFAT,
    sysfs, procfs, isofs, JFFS2, XFS, NTFS, and NFS.
  7. include. Kernel header files live here. Subdirectories prefixed with asm contain headers specific to the
    particular architecture. So the directory include/asm-x86/ contains header files pertaining to the x86
    architecture, whereas include/asm-arm/ holds headers for the ARM architecture.
  8. init. This directory contains high-level initialization and startup code.
  9. ipc. This contains support for Inter-Process Communication (IPC) mechanisms such as message queues,
    semaphores, and shared memory.
  10. kernel. The architecture-independent portions of the base kernel can be found here.
  11. lib. Library routines such as generic kernel object (kobject) handlers and Cyclic Redundancy Code (CRC)
    computation functions stay here.
  12. mm. The memory management implementation lives here.
  13. net. Networking protocols reside under this directory. Protocols implemented include Internet Protocol
    version 4 (IPv4), IPv6, Internetwork Protocol eXchange (IPX), Bluetooth, ATM, Infrared, Link Access
    Procedure Balanced (LAPB), and Logical Link Control (LLC).
  14. scripts. Scripts used during kernel build reside here.
  15. security. This directory contains the framework for security.
  16. sound. The Linux audio subsystem is based in this directory.
  17. usr. This currently contains the initramfs implementation.