理解linux kernel的一些文档文献

过年到现在已经很久了,没整理过一篇文章,感觉又是要太监了。其实,一方面出于自己太过于懒惰,又总是在迷茫,一方面,自己的知识也是越说越觉得浅。本可以像网上哪些所谓“原创”博客那些,从doc,sample里抄两段,网上翻译两段,然后说得隐晦一点,以彰显自己的才气,无奈过不了自己这一关,毕竟自己吃过这样的苦,也正在吃苦中,所以希望尽量写些有用的,不然就只好摘录一些有用的东西。例如如果没有告诉我学习linux内核应该从makefile入手,我就不会因为庞大的makefile编译系统而节节败退了。


不知道有多少除了在www.kernel.org下载内核之外,不知道有kernelnewbies.org,以及KernelAnalysis-HOWTO


被许多许多装逼犯误导,导致我们这些自学者走了很多弯路。


kernelnewbies.org上一些书籍的推荐:

  • Essential Linux Device Drivers by Sreekrishnan Venkateswaran seehttp://www.pearson.ch/Informatik/PrenticeHall/1471/9780132396554/Essential-Linux-Device-Drivers.aspx

  • Linux Kernel in a Nutshell by Greg Kroah-Hartman, http://www.kroah.com/lkn/, online: html

    • about configuring, building, installing, upgrading the kernel

  • Linux Device Drivers 3rd Edition, 2005, by Jonathan Corbet, Alessandro Rubini, and Greg Kroah-Hartman,O'Reilly Reference, online:pdf ,html

    • This book is a must read for device driver writing, and more generally, a good understanding of the Linux kernel subsystems involved with device driver writing. Topics such as building modules, debugging techniques, character device drivers, block device drivers, network device drivers, PCI subsystem, USB subsystem, concurrency and race conditions, time and memory management are covered by this book.

  • Linux Kernel Development 2nd Edition, by Robert Love (Novell Press, ISBN : 0-672-32720-1) seeNovell Press Reference

    • This book is more general than Linux Device Drivers, and covers more parts of the kernel: scheduling, virtual memory management, etc.

  • Understanding The Linux Kernel 3rd Edition (O'Reilly and associates. ISBN: 0-596-00565-2)

    • This book is more general than Linux Device Drivers, and covers more parts of the kernel: scheduling, virtual memory management, etc.

  • Understanding The Linux Virtual Memory Manager, by Mel Gorman (Prentice Hall, ISBN 0131453483)

    • available online, see Understand The Linux Virtual Memory Manager, online

    • This book is specifically dedicated to the virtual memory manager of the Linux kernel, and so goes into deep details about the internals of this important but complex subsystem of the kernel. It clearly is a must read for the ones interested in memory management.

  • Porting device drivers to 2.6, by Jonathan Corbet

    • available online, see Driver Porting, on LWN

    • Not really a book, but it is so complete and interesting that it can be considered as such.

  • Understanding Linux Network Internals 1st Edition, 2005 (O'Reilly, ISBN 0-596-00255-6)

  • The Linux Kernel Primer: A Top-Down Approach for x86 and PowerPC Architectures, by Claudia Salzberg Rodriguez, Gordon Fischer, Steven Smolski (Prentice Hall PTR, 2005/7/19)

    • Covers 2.6 with a focus on i386 and PPC architectures

    • Code walkthrough

  • Linux kernel poster


我已经整理好了下载,请查看http://download.csdn.net/user/gyj0754


linux内核启动过程,可以按以下查阅源代码:

|startup_32:
   |start_kernel
      |lock_kernel
      |trap_init
      |init_IRQ
      |sched_init
      |softirq_init
      |time_init
      |console_init 
      |#ifdef CONFIG_MODULES 
         |init_modules 
      |#endif 
      |kmem_cache_init 
      |sti 
      |calibrate_delay 
      |mem_init
      |kmem_cache_sizes_init
      |pgtable_cache_init
      |fork_init
      |proc_caches_init 
      |vfs_caches_init
      |buffer_init
      |page_cache_init
      |signals_init 
      |#ifdef CONFIG_PROC_FS 
        |proc_root_init 
      |#endif 
      |#if defined(CONFIG_SYSVIPC) 
         |ipc_init
      |#endif 
      |check_bugs      
      |smp_init
      |rest_init
         |kernel_thread
         |unlock_kernel
         |cpu_idle

  • startup_32 [arch/i386/kernel/head.S]
  • start_kernel [init/main.c]
  • lock_kernel [include/asm/smplock.h]
  • trap_init [arch/i386/kernel/traps.c]
  • init_IRQ [arch/i386/kernel/i8259.c]
  • sched_init [kernel/sched.c]
  • softirq_init [kernel/softirq.c]
  • time_init [arch/i386/kernel/time.c]
  • console_init [drivers/char/tty_io.c]
  • init_modules [kernel/module.c]
  • kmem_cache_init [mm/slab.c]
  • sti [include/asm/system.h]
  • calibrate_delay [init/main.c]
  • mem_init [arch/i386/mm/init.c]
  • kmem_cache_sizes_init [mm/slab.c]
  • pgtable_cache_init [arch/i386/mm/init.c]
  • fork_init [kernel/fork.c]
  • proc_caches_init
  • vfs_caches_init [fs/dcache.c]
  • buffer_init [fs/buffer.c]
  • page_cache_init [mm/filemap.c]
  • signals_init [kernel/signal.c]
  • proc_root_init [fs/proc/root.c]
  • ipc_init [ipc/util.c]
  • check_bugs [include/asm/bugs.h]
  • smp_init [init/main.c]
  • rest_init
  • kernel_thread [arch/i386/kernel/process.c]
  • unlock_kernel [include/asm/smplock.h]
  • cpu_idle [arch/i386/kernel/process.c]

The last function ''rest_init'' does the following:

  1. launches the kernel thread ''init''
  2. calls unlock_kernel
  3. makes the kernel run cpu_idle routine, that will be the idle loop executing when nothing is scheduled

In fact the start_kernel procedure never ends. It will execute cpu_idle routine endlessly.

Follows ''init'' description, which is the first Kernel Thread:

|init
   |lock_kernel
   |do_basic_setup
      |mtrr_init
      |sysctl_init
      |pci_init
      |sock_init
      |start_context_thread
      |do_init_calls
         |(*call())-> kswapd_init
   |prepare_namespace
   |free_initmem
   |unlock_kernel
   |execve




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值