QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 4663|回复: 34

如何编译一个通用内核?

  [复制链接]
发表于 2003-7-28 12:58:14 | 显示全部楼层 |阅读模式
我想编译一个能在奔二级以上CPU通用的2.4.21内核,“Processor type and features”选“Pentium-Pro/Celeron/Pentium-II”可以吗?这样能在K6上正常运行吗?Pentium-III、Pentium-4、K7呢?如果想保持通用又想有尽可能好的性能,应该使用什么样的CFLAGS? -O2 -fomit-frame-pointer -falign-functions=4可以吗?请各位不吝赐教。谢谢!!!
发表于 2003-7-30 21:26:45 | 显示全部楼层
if u choose pii, it can runs on p2, p3, p4.
i think u need to choose k6, k7  in order to run on k6, k7.
of course u can choose pentium or 486, but that is not what u want, right?

-O2 -fomit-frame-pointer is good,  i am not sure about -falign-functions=4. i remeber there is a post on this, can u search?
回复

使用道具 举报

 楼主| 发表于 2003-7-30 21:45:42 | 显示全部楼层
也就是说如果我想在P2、P3、P4、K6、K7上运行我的内核,我将不得不把内核编译成pentium?

上面的CFLAGS我就是在那个帖子上看到的。
回复

使用道具 举报

发表于 2003-7-30 21:52:45 | 显示全部楼层
yes. i think so. u can try if p2 kernel can run on k6 and k7.

回复

使用道具 举报

 楼主| 发表于 2003-7-30 22:05:30 | 显示全部楼层
刚好,我还有一台K7,等一下试试。试完再把结果report上来。
回复

使用道具 举报

发表于 2003-7-30 22:08:02 | 显示全部楼层
thx.
回复

使用道具 举报

 楼主| 发表于 2003-7-30 22:11:26 | 显示全部楼层
Dragonfly你抢我的台词。
回复

使用道具 举报

发表于 2003-7-30 22:17:13 | 显示全部楼层
en? no idea. sorry  
回复

使用道具 举报

 楼主| 发表于 2003-7-30 22:40:06 | 显示全部楼层
     上面那句THX是我的台词哦。
回复

使用道具 举报

发表于 2003-7-30 22:57:11 | 显示全部楼层
ic.   .
回复

使用道具 举报

 楼主| 发表于 2003-7-31 23:00:41 | 显示全部楼层
还有一个问题,如果我想改动内核的版本号应该怎么办?像Magic 1.1的内核是linux-2.4.20-1.1,如果我想改成linux-2.4.20-2.2应该怎么改?我试过直接把Makefile的EXTRAVERSION = -1.1custom改成EXTRAVERSION = -2.2,并把目录名从linux-2.4.20-1.1改成linux-2.4.20-2.2,但编译出错。
回复

使用道具 举报

发表于 2003-7-31 23:31:50 | 显示全部楼层
u need not to change the dir name.
u need to change the EXTRAVERSION
and u need to 1) save u .config file somewhere 2) make mrproper or make distclean 3) restore u .config file. 4) compile again.
    
回复

使用道具 举报

 楼主| 发表于 2003-8-1 00:18:39 | 显示全部楼层
2.4.21打ac4补时改目录名没问题,但这回不知道为什么就不可以。总是在tmp_include_depends文件里出现:
/usr/src/linux-2.4.20-2.2/arch/i386/math-emu/exception.h: \
   /usr/src/linux-2.4.20-1.1/arch/i386/math-emu/fpu_emu.h
        @touch /usr/src/linux-2.4.20-2.2/arch/i386/math-emu/exception.h
/usr/src/linux-2.4.20-2.2/arch/i386/math-emu/fpu_asm.h: \
   /usr/src/linux-2.4.20-1.1/include/linux/linkage.h
        @touch /usr/src/linux-2.4.20-2.2/arch/i386/math-emu/fpu_asm.h
/usr/src/linux-2.4.20-2.2/arch/i386/math-emu/fpu_emu.h: \
   /usr/src/linux-2.4.20-1.1/arch/i386/math-emu/fpu_asm.h \
   /usr/src/linux-2.4.20-1.1/arch/i386/math-emu/fpu_system.h \
   /usr/src/linux-2.4.20-1.1/include/asm/sigcontext.h \
   /usr/src/linux-2.4.20-1.1/include/asm/math_emu.h \
   /usr/src/linux-2.4.20-1.1/include/linux/linkage.h \
   /usr/src/linux-2.4.20-1.1/arch/i386/math-emu/fpu_proto.h
        @touch /usr/src/linux-2.4.20-2.2/arch/i386/math-emu/fpu_emu.h
回复

使用道具 举报

发表于 2003-8-1 03:11:43 | 显示全部楼层
tell me what kernel u use, what patch u use, what steps u did. i will try.
回复

使用道具 举报

发表于 2003-8-2 20:40:54 | 显示全部楼层
2.4.20的不行吧。应该用2.4.21的原码吧
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-9-19 18:42 , Processed in 0.054253 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

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