- Download Linux kernel tree
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git linux-2.6.git
- Update Linux kernel tree
$ git pull
- Prepare to build Linux kernel by reusing old Linux kernel config
$ make oldconfig
- View Linux kernel config
- Build Linux kernel
- Install Linux kernel modules
- Install Linux kernel
- Build initial ramdisk
- Update GRUB
- Browse source code
$ cscope -Rk
- Run new Linux kernel in QEMU
- In QEMU, enter Ctrl+Alt+2 to get into QEMU monitor
- To check everything is ok
Steps to build and run Linux kernel using Eclipse/CDT and QEMU
- Install Eclipse/CDT and disable indexer
- Create new C Makefile project with default location pointing to linux-2.6
- Build Linux kernel in Eclipse
- Configure Eclipse debugger to use C/C++ application as vmlinuz, stop on startup at start_kernel(), use gdbserver with connection type tcp/1234
- Run QEMU with GDB-stub
- Run Linux kernel in Eclipse
- Debug in Eclipse will stop at start_kernel
No comments:
Post a Comment