Your SlideShare is downloading. ×
Linux Kernel Overview
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Linux Kernel Overview

15,416

Published on

Published in: Technology
3 Comments
16 Likes
Statistics
Notes
No Downloads
Views
Total Views
15,416
On Slideshare
0
From Embeds
0
Number of Embeds
12
Actions
Shares
0
Downloads
0
Comments
3
Likes
16
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. © 2010-14 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Kernel Overview
  • 2. 2© 2010-14 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. What to Expect? W's of Kernel Linux Architecture Linux Kernel Startup Linux Kernel Functionality Linux Kernel Configuration Linux Kernel Compilation
  • 3. 3© 2010-14 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. What is a Kernel? Core of a System The Operating System
  • 4. 4© 2010-14 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. OS Core OS Core could be further classified as the following major functionalities Inter Process Communication Minimal Memory Management Low-level Process Management & Scheduling Low-level Input / Output
  • 5. 5© 2010-14 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Types of Kernels Micro kernel Also called the Modular kernel Contains only the OS Core Other OS stuff are typically provided as services Examples: Amoeba, Mach, QNX Monolithic kernel Contains all the OS related stuff Either built into it statically or loaded dynamically Examples: VxWorks, Linux
  • 6. 6© 2010-14 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Micro vs Monolithic Advantages Micro Kernel Flexible Modular Easy to implement Monolithic Kernel Performance
  • 7. 7© 2010-14 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Architecture User Space (is the usage platform) System Call I/F (the connector) Kernel Space (provides functionalities & facilities to use) Hardware (is what is to be used)
  • 8. 8© 2010-14 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Architecture Details User Space Memory where user processes run Doing typical computation tasks And accesses kernel space for privileged tasks Through System Call interface Kernel Space This is protected space Place of all privileged happening I/O access, Memory access, … (System Resources access) Kernel processes can access User processes but not vice versa These levels are achieved by processor states How does system call switches user to kernel space? Check Which space is executing command from root? Do we need these levels and system calls if the kernel image and root file system are read only?
  • 9. 9© 2010-14 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Kernel Startup CPU / Platform specific Initialization CPU Speed Setup MMU Setup Board Id Setup Minimal Driver Initialization: FS specific Mounting Root File System Remaining Driver Initialization Doing Initcall & Freeing Initial Memory Moving to User Space by Jumping to the first user process init
  • 10. 10© 2010-14 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Kernel Functional Overview Process Management Memory Management Device Management Storage Management Network Management
  • 11. 11© 2010-14 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Kernel Source Let's get down to the Source Code
  • 12. 12© 2010-14 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Kernel Build System Key components Makefile Kconfig Configuring the Makefile Setting up the kernel version (specially for the Desktops) For Cross Compilation, need to setup ARCH CROSS_COMPILE Or, invoke make with these options
  • 13. 13© 2010-14 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Kernel Configuration Methods make config make menuconfig make xconfig Others make defconfig make oldconfig make <board_specific>_defconfig Check: Where is the menuconfig target?
  • 14. 14© 2010-14 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Kernel Configuration Code Maturity level Options General Setup Loadable Module Support Block Layer Networking Device Drivers File Systems Kernel Hacking Security Options Cryptographic Options Library Routines
  • 15. 15© 2010-14 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Kernel Compilation Cleaning Methods make clean – Simple clean make mrproper – Complete sweep clean, incl. Configs Also called Building the Kernel After configuring the kernel, we are all set to build it Build Methods make vmlinux – To build everything configured for a kernel image make modules – To build only configured modules make – To build everything configured (kernel image & modules) make modules_prepare – To only prepare for building modules
  • 16. 16© 2010-14 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Kernel Images Kernel Image should be understood by Stage 2 Bootloader Default kernel compilation builds vmlinux vmlinux is understood only by the desktop bootloaders So, for embedded systems, we would typically have to do the following Creating linux.bin using <cross>-objcopy Example: arm-linux-objcopy -O binary vmlinux linux.bin And then, convert it into the bootloader specific image using some bootloader utility. For u-boot, it is done using mkimage Example: mkimage -A arm -O linux -T kernel -C none -a 20008000 -e 20008000 -n “Custom” -d linux.bin uImage.arm
  • 17. 17© 2010-14 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Linux Kernel Arguments console root initrd mem resume ...
  • 18. 18© 2010-14 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. What all have we learnt? W's of Kernel Linux Architecture Linux Kernel Startup Linux Kernel Functionality Linux Kernel Configuration Linux Kernel Compilation
  • 19. 19© 2010-14 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Any Queries?

×