How to build own kernel for CoLinux?

Q19. How do I build my own kernel for CoLinux?

The kernel included with CoLinux should work for most people, but some people mi
ght need to roll their own. Here is a quick overview of how to make a Linux-2.4.
27 kernel that works with CoLinux. I'm running Gentoo, and I'm building from wit
hin my coLinux environment, but the general idea should work for everybody.

Set up a development environment with GCC 3.3.3 (or earlier). The 2.4.27 and ear
lier kernel sources won't compile with GCC 3.4.1. Under Gentoo, you can install
GCC 3.3.3 with "emerge '=gcc-3.3.3'", and then you can switch between GCC 3.4.1
and 3.3.3 with gcc-config.

Get 2.4 kernel sources and extract them to /usr/src. CoLinux 0.6.1 was released
against 2.4.26, so that is the safest version, but I've been using 2.4.27 for a
while now with no problems. Under Gentoo, use "emerge vanilla-sources".

Get the coLinux-0.6.1 source tarball. Extract it on your development platform.

Patch the kernel with the coLinux patch:

cd /usr/src/linux

patch -p1 < (extraction-point)/colinux-20040529/patch/linux

Fix anything that didn't patch correctly. On my machine, /Makefile didn't patch
(just edit Makefile and add "-co-0.6.1" at the end of the "EXTRAVERSION = " line
), and drivers/block/Makefile didn't patch (add "obj-$(CONFIG_BLK_DEV_PBD) += co
bd.o" somewhere).

Copy the default config from the coLinux sources:

cd /usr/src/linux

cp (extraction-point)/colinux-20040529/conf/linux-config .config

Configure your kernel as needed with menuconfig ("make menuconfig").

You probably don't want to mess with Processor Type - coLinux can crash if the k
ernel tries to use processor features that coLinux isn't expecting the kernel to
mess with. You can enable /dev/cpu/*/cpuid, but I suggest not messing with anyt
hing else. Make sure to leave COPIC Support enabled.

Under General Setup, don't enable PCI, ISA, EISA, MCA, etc., unless you want coL
inux and Windows to fight over hardware. Do leave Cooperative Mode enabled.

Under Block Devices, leave coLinux block device support enabled.

Under Network Device Support, leave Coooperative Virtual Ethernet driver support
enabled.

Under Console Drivers, leave coLinux Pseudo-VGA text console enabled.

For Gentoo, make sure to enable /proc, /dev, automatically mount /dev, and disab
le /dev/pts.

Apply any other patches as needed. I applied the CIFS VFS patch to replace the d
ated SMBFS module.

make dep && make vmlinux modules modules_install

Back up the vmlinux that was installed with coLinux.

Copy /usr/src/linux/vmlinux to your Windows coLinux directory (overwrite the ori
ginal vmlinux that was installed with coLinux).

Restart coLinux.

http://www.linuxfans.org/bbs/viewthread.php?tid=119238
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章