一、簡介
用戶模式Linux(User ModeLinux,UML)不同于其他Linux虛擬化項目,UML盡量將它自己作為一個普通的程序。從Linux2.6.9版本起,用戶模式Linux(User mode Linux,UML)已隨Linux內(nèi)核源代碼一起發(fā)布,它存放于arch/um目錄下。編譯好UML的內(nèi)核之后,可直接用gdb運行編譯好的內(nèi)核并進行調(diào)試。
參考:http://uml.devloop.org.uk/howto.html
二、編譯內(nèi)核
1、以-O2編譯內(nèi)核
make ARCH=um defconfigmake menuconfig ARCH=ummake ARCH=um
參考:http://user-mode-linux.sourceforge.net/source.html
2、以-O0編譯內(nèi)核
參考:http://blog.chinaunix.net/uid-234303-id-2425015.html
三、根文件系統(tǒng)
1、下載現(xiàn)成的根文件系統(tǒng)
http://fs.devloop.org.uk/
2、制作根文件系統(tǒng)
http://fancymore.com/reading/linux-kernel-debugging.html
http://xiaozu.renren.com/xiaozu/165947/thread/357779815
四、調(diào)試
# gdb ./linux (gdb) handle SIGSEGV pass nostop noPRint (gdb) handle SIGUSR1 pass nostop noprint (gdb) start ubd0=/root/srcpkg/filesystem/CentOS6.x-x86-root_fs mem=256m
http://blog.csdn.net/ztz0223/article/details/7874759
五、常見問題
1、
http://moodlearchive.epfl.ch/2010-2011/mod/forum/discuss.php?d=108781
2、
http://www.lenky.info/archives/2012/04/1471
新聞熱點
疑難解答
圖片精選