LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 619|回复: 2

系统调用编译成功之后为什么还是这样呀???

[复制链接]
发表于 2004-2-14 12:49:37 | 显示全部楼层 |阅读模式
我写了个函数,也按要求修改了
unistd.h
sys.c
entry.S
经过编译生成了bzImage文件了,然后修改grub为
default=1
timeout=5
splashimage=(hd0,4)/boot/grub/splash.xpm.gz
title RedHat Linux9.0
        root (hd0,4)
        kernel /boot/vmlinuz-2.4.20-8-old ro root=/dev/hda?
        initrd /boot/initrd-2.4.20-8.img-old
title RedHat Linux9.0 -- new
        root (hd0,4)
        kernel /boot/bzImage ro root=/dev/hda?
        initrd /boot/initrd-2.4.20-8.img
title WINDOS XP
        rootnoverify (hd0,0)
        chainloader +1
了,可是进入新内核之后,用函数调用系统调用功能,却还是有这样的错误:
try.c: In function `mycall':
try.c:2: `__NR_mycall' undeclared (first use in this function)
try.c:2: (Each undeclared identifier is reported only once
try.c:2: for each function it appears in.)
我该怎么处理呀?????急急急,等待高手解答
发表于 2004-2-14 21:20:11 | 显示全部楼层
我想“__NR_mycal”应该是你自己定义的系统调用吧。l这是C语言的编译器把你的系统调用当成了函数来处理,它当然会找不到这个函数了。
真正的系统调用是用软中断的方式来处理的。你得用汇编把自定义的系统调用的地址(好象记得是这样)压入堆栈,再call 0x80。
 楼主| 发表于 2004-2-15 15:01:47 | 显示全部楼层
网上一大堆文章是这样说的呀,我按这样的步骤做的……
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表