LDD3 study note 0
2016-12-11 15:31
435 查看
LDD3 study note 0
This document shares a development environment to debug kernel using qemu.0. How to learn Linux kernel
You maybe have many ways to learn Linux kernel, but I think the only way to learnLinux kernel is keeping thinking and keeping writing codes. There are so many
modules in kernel, maybe at first we do not know how to start, what to write.
I think at first what to write is not important, the important thing is to
understand basic kernel knowledge, as now everyday we will see so many open
source codes, the only unchangeable or more stable thing is basic knowledge of
kernel related. Let’s start up from the basic things
Here I suggest to use LDD3 to learn these basic knowledge. We will try to rewrite
the modules in this book to get a new understanding about Linux kernel.
1. Environment setting
Normally it is very hard to debug kernel, so here I suggest you to learn anddebug kernel using virtual machine, qemu is a good tool to help us to do this
work.
In my previous blogs, this was one which tell us how to using qemu to debug
kernel in my way.
http://blog.csdn.net/scarecrow_byr/article/details/40707323
However, the file system in that blog is not a very good one
as there are some useful tools it did not have,
Now I got a new root file system, which includes the basic user space tools to
debug kernel. You can download it here:
https://github.com/wangzhou/kernel_debug_using_qemu.git
Above repo also includes a script to run qemu in command line. I just use the
root file system as a memory file system. So if you write something when the
system is booting up, what you wrote will be lost when you shutdown your qemu.
There is another script called put_file_in_mini.sh. When you wrote a kernel
module and compiled it to a ko, you can use the script to put the ko to the root
file system. The work flow of this script is very simple, it just extracts the
compressed file system, put the file(e.g. your ko) to file system, and at last
compress the file system back.
In fact, there is other ways to get a root file system for your debug environment,
for example, you can use a nfs as a root file system. In nfs way: 1. you need
configure your networking for host and guest to let qemu be able to access one
directory in you host, which includes the file system; 2. you need configure qemu
to use nfs to get root file system. If having time, we can try this way later.
相关文章推荐
- LDD3 study note 1
- LDD3 study note 2
- LDD3 study note 3
- GPON study note_part1
- C++ Primer Study Note 系列[1]-chapter1快速入门
- EF english study note
- Study Note: Logistic Regression(2)
- Linux Shell study note
- window phone programming in VS -study note
- study note of CCS
- LinuxStudyNote(10)-Linux常用命令(2)-文件处理命令(5)删除空目录命令rmdir
- LinuxStudyNote(34)-Linux常用命令(9)shutdown关机重启命令
- LinuxStudyNote(43)-RPM包查询命令、查询是否安装、查询包详细信息、查询包中文件安装位置、查询系统文件属于哪个rpm包、查询软件包的依赖性
- DOJO Study Note(1) - 入门篇
- Study note about bulk import and export data in MSSQL
- w3c_html_study_note_5.26
- [学习笔记]Thinking in Java (the 2nd edition) Study Note (3)
- Study Note: Logistic Regression(2)
- [Study Note] Maintainable MVC Series
- [Study Note] TDD: Consistent test structure (测试代码的结构一致性)