免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: benlan
打印 上一主题 下一主题

如何调试linux内核 [复制链接]

论坛徽章:
0
11 [报告]
发表于 2005-05-19 15:30 |只看该作者

如何调试linux内核

我执行[root@localhost linux-2.6.10]# ./vmlinux mem=64M ubd0=root_fs.rh-7.2-full.cow,root_fs.rh-7.2-full.pristine.20020312 ubd1=swap

Checking for the skas3 patch in the host...not found
Checking for /proc/mm...not found
Checking PROT_EXEC mmap in /tmp...OK
Linux version 2.6.10 (root@localhost.localdomain) (gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)) #2 Thu May 19 10:49:31 CST 2005
Built 1 zonelists
Kernel command line: mem=64M ubd0=root_fs.rh-7.2-full.cow,root_fs.rh-7.2-full.pristine.20020312 ubd1=swap root=98:0
PID hash table entries: 512 (order: 9, 8192 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 62080k available
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
Checking for host processor cmov support...Yes
Checking for host processor xmm support...No
Checking that ptrace can change system call numbers...OK
Checking syscall emulation patch for ptrace...missing
Checking that host ptys support output SIGIO...Yes
Checking that host ptys support SIGIO on close...No, enabling workaround
Checking for /dev/anon on the host...Not available (open failed with errno 2)
NET: Registered protocol family 16
mconsole (version 2) initialized on /root/.uml/UvUwFO/mconsole
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
md: md driver 0.90.1 MAX_MD_DEVS=256, MD_SB_DISKS=27
NET: Registered protocol family 2
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 4096 bind 8192)
NET: Registered protocol family 1
NET: Registered protocol family 17
NET: Registered protocol family 8
NET: Registered protocol family 20
Initializing stdio console driver
tracing thread pid = 10027

到这里就没有了,看example应该到

Initializing stdio console driver
Initializing software serial port version 0
serial line 0 assigned pty /dev/ptyp2
ssl receive thread is pid 2444
devfs: v0.96 (20000430) Richard Gooch (rgooch@atnf.csiro.au)
devfs: devfs_debug: 0x0
devfs: boot_options: 0x0
VFS: Mounted root (ext2 filesystem) readonly.
Mounted devfs on /dev
INIT: version 2.76 booting
/etc/rc.d/rc.S: Testing filesystem status: Read-only file system
Parallelizing fsck version 1.15 (18-Jul-1999)
/dev/ubd/0: clean, 29389/131072 files, 389992/524288 blocks
Remounting root device with read-write enabled.
/dev/ubd/0 on / type ext2 (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
none on /proc type proc (rw)
Updating module dependencies for Linux 2.3.99-pre8-1um:
can't locate module slip
can't locate module ppp
can't locate module bsd_comp
Starting PCMCIA services: module directory /lib/modules/2.3.99-pre8-1um/pcmcia \
not found.
INIT: Entering runlevel: 3
Going multiuser...
Configuring umn as 192.168.0.253...
Activating IPv4 packet forwarding...
Starting /sbin/rpc.portmap...
Mounting remote file systems...
Starting daemons:  syslogd klogd inetd lpd mountd nfsd
Starting sendmail daemon (/usr/sbin/sendmail -bd -q15m)...
451 /etc/sendmail.cf: line 0: cannot open: No such file or directory
Loading the iBCS module...
insmod: iBCS: no module by that name found
/var/lib/apache/sbin/apachectl start: httpd started
Starting Samba...
Setting time zone...done


Welcome to Linux 2.3.99-pre8-1um.

darkstar login: root
Password:

我的下面的这段咋么没了??/
javascript:emoticon('')
javascript:emoticon('')

论坛徽章:
0
12 [报告]
发表于 2005-05-22 02:38 |只看该作者

如何调试linux内核

原帖由 "albcamus" 发表:
我是用2.6.10的内核,集成了UML。编译过去了,照着Documentation/uml/下的HOWTO文档做就行了,不过那文档可真老啊。我又搞不懂ubd/loop/root_fs是什么东东,还没运行起来。

忙完这几天,再搞


albcamus老大,偶的user mode linux已经好了,用了最简单的一种方法:编译内核是就是 make menuconfig=um ,这一步以后,会在当前目录下产生个配置文件,也就是.config文件,这一步可以不执行,直接用
http://www.linode.com/forums/viewtopic.php?p=2895#2895
这里的.config文件
然后make linux ARCH=um 编译出linux可执行文件

不懂ubd/loop/root_fs是什么东东
也就是说你的uml下个文件系统下来,如root_fs.rh6......bz2 root_fs_debian...bz2 等,在下载页的文件系统下载下来,然后bunzip2

最后一步的执行  ./linux ubd0=root_fs.................
这是我这几天玩了以后,找到的最简单的方法了 ,祝你好运了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP