1 / 20

Trace Linux Kernel Source

Trace Linux Kernel Source. Spring, 2008. Outline. Introduction Kernel Source Resources for Tracing Linux How to compile Linux Kernel Presentation. Original UNIX System Structure. system programs. kernel. hardware. Outline. Introduction Kernel Source Resources for Tracing Linux

Download Presentation

Trace Linux Kernel Source

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Trace Linux Kernel Source Spring, 2008

  2. Outline • Introduction • Kernel Source • Resources for Tracing Linux • How to compile Linux Kernel • Presentation

  3. Original UNIX System Structure system programs kernel hardware

  4. Outline • Introduction • Kernel Source • Resources for Tracing Linux • How to compile Linux Kernel • Presentation

  5. Kernel Source • Source code web site: • http://www.kernel.org • Source code version: • X.Y.Z • 2.2.17 • 2.4.0 • 2.6.24 • Distributions: • ftp://linux.cis.nctu.edu.tw/distributions/iso • RED HAT , Debian, Mandrake…

  6. Source Code Organization • init • ipc • lib • mm • kernel • net • fs • include • arch • drivers • Document

  7. Source Code Organization (Cont.)

  8. Outline • Introduction • Kernel Source • Resources for Tracing Linux • How to compile Linux Kernel • Presentation

  9. Resources for Tracing Linux • E-Books • KernelAnalysis-HOWTO: • http://www.linux.org/docs/ldp/howto/KernelAnalysis-HOWTO.html • The Linux Kernel: • http://www.tldp.org/LDP/tlk/tlk.html • Linux Kernel 2.4 Internals: • http://www.moses.uklinux.net/patches/lki.html • LinuxHQ: • http://www.linuxhq.com

  10. Resources for Tracing Linux • Books • Understanding the Linux Kernel, 3nd Edition D. P. Bovet and M. Cesati, O'Reilly & Associates. • Linux Core Kernel – Commentary, In-Depth Code Annotation, S. Maxwell, Coriolis Open Press, 1999. • The Linux Kernel, Version 0.8-3, D. A Rusling, 1998. • Linux Kernel Internals, 2nd edition, M. Beck et al., Addison-Wesley, 1998. • Linux Kernel, R. Card et al., John Wiley & Sons, 1998. • Linux Device Drivers, 2nd Edition: O’Reilly/歐萊禮(中文) • Linux 核心研究篇:學貫

  11. Resources for Tracing Linux • Windows下工具 • UltraEdit • 基礎工具 • VisualStudio • Source Browser, find in files • Unix下工具 • grep: “grep [option] …pattern… [file] ” • ex : grep –ri return rtlcore.c • 無敵的指令,雖然可能找很久 • ctags: “find -name ‘*.[ch]’ | xargs ctags” • 這樣檔案tags裡就有各種關鍵字的索引了 • cflow: “cflow –r fun_name *.c” • 產生call graph • c2html: “c2html < file.c > file.html”

  12. Resources for Tracing Linux • Source code browser • cscope (http://cscope.sourceforge.net/) • GNU Global • http://www.gnu.org/software/global/) • LXR • Source code navigator http://lxr.linux.no/source/ • function, struct, macro

  13. Resources for Tracing Linux • 結構圖繪制工具 • Jude • http://objectclub.esm.co.jp/Jude/

  14. Outline • Introduction • Kernel Source • Resources for Tracing Linux • How to compile Linux Kernel • Presentation

  15. How to compile Linux Kernel • make mrproper • 刪除一些以前留下來的 .o 檔案 • make menuconfig(make xconfig、make gconfig) • 建立 Makefile (挑選核心參數)

  16. How to compile Linux Kernel • make clean • 將以前曾經進行過的 *.o 檔案刪除掉 • make bzImage • 製作出核心檔案 • make modules • 製作出模組相關的檔案 • make modules_install • 開始安裝模組 • /lib/modules • cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.24-x • 移動新核心到 /boot 裡面 • Edit /etc/lilo.conf to reflect the boot image • Reflect to the loader

  17. How to compile Linux Kernel • http://linux.vbird.org/linux_basic/0540kernel.php#compile

  18. Outline • Introduction • Kernel Sourc • Reference • Trace tool • Presentation

  19. Presentation • 基礎知識介紹 • 主要的 data structure • 重要的 function • related system call • 版本比較

  20. File system • Filesystem 1 : • basic concept • important data structure • file • inode • dentry • Vfsmount • Nameidata • function • path_walk • Filesystem 2: • function • ext2_new_block • system call • ext2 vs ext3

More Related