没/usr/src/linux-2.4怎编译内核支持SATA
没有/usr/src/linux-2.4,我怎么编译内核?我买的盒装的redhat9,现在由于要使用silicon image的3112芯片的SATA卡用来上串行硬盘,下了C语言的驱动,准备编译内核,但没有/usr/src/linux-2.4
这个目录,怎么办?
# pwd
/usr/src
# ls -al
×ÜÓÃÁ¿ 16
drwxr-xr-x 4 root root 40961ÔÂ 27 00:16 .
drwxr-xr-x 15 root root 40961ÔÂ 26 20:36 ..
drwxr-xr-x 2 root root 4096 2003-01-25debug
drwxr-xr-x 7 root root 40961ÔÂ 27 00:16 redhat
555,怎么办?还有,我能不能把这个siimage.c和siimage.h编译成.o的模块动态加载呀,我不用串行硬盘启动,我用普通ide硬盘作系统的。
lspci的结果
00:09.0 Unknown mass storage controller: CMD Technology Inc Silicon Image SiI 3112 SATARaid Controller (rev 02)
看样子是认不得这个卡
dmesg
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
VP_IDE: IDE controller at PCI slot 00:07.1
VP_IDE: chipset revision 6
VP_IDE: not 100% native mode: will probe irqs later
VP_IDE: VIA vt82c686a (rev 1b) IDE UDMA66 controller on pci00:07.1
ide0: BM-DMA at 0xc000-0xc007, BIOS settings: hda:DMA, hdb:pio
ide1: BM-DMA at 0xc008-0xc00f, BIOS settings: hdc:pio, hdd:DMA
SiI3112 Serial ATA: IDE controller at PCI slot 00:09.0
PCI: Found IRQ 9 for device 00:09.0
SiI3112 Serial ATA: chipset revision 2
SiI3112 Serial ATA: not 100% native mode: will probe irqs later
ide2: MMIO-DMA at 0xc880d000-0xc880d007, BIOS settings: hde:pio, hdf:pio
ide3: MMIO-DMA at 0xc880d008-0xc880d00f, BIOS settings: hdg:pio, hdh:pio
hda: ST34342A, ATA DISK drive
blk: queue c03c9f40, I/O limit 4095Mb (mask 0xffffffff)
hdd: CD-RW IDE1610, ATAPI CD/DVD-ROM drive
hde: no response (status = 0xfe)
hdg: no response (status = 0xfe)
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
hda: task_no_data_intr: status=0x51 { DriveReady SeekComplete Error }
hda: task_no_data_intr: error=0x04 { DriveStatusError }
hda: 8404830 sectors (4303 MB) w/128KiB Cache, CHS=523/255/63, UDMA(33)
ide-floppy driver 0.99.newide
Partition check:
hda: hda1 hda2 hda3
ide-floppy driver 0.99.newide
md: md driver 0.90.0 MAX_MD_DEVS=256, MD_SB_DISKS=27
md: Autodetecting RAID arrays.
md: autorun ...
md: ... autorun DONE.
那这样的话,是不是我插上硬盘还是能认成hde和hdg?我不用raid. 原来没装源码,已装
现在问题是不知如何搞上驱动
如何安装.c的串行硬盘卡驱动?
不知道要编译内核还是GCC搞成.o文件?可我用GCC,提示出错,原因不明。编译内核我不知道如何把这些.c文件搞定呀?
补充一下,只有两个文件,siimage.c和siimage.h,没有Makefile呀
在redhat9下用gcc siimage.c
最后几行如下(上面的看不到,太长):
siimage.c:826: warning: (near initialization for `siimage_pci_tbl')
siimage.c:826: warning: excess elements in struct initializer
siimage.c:826: warning: (near initialization for `siimage_pci_tbl')
siimage.c:826: warning: excess elements in struct initializer
siimage.c:826: warning: (near initialization for `siimage_pci_tbl')
siimage.c:826: warning: excess elements in struct initializer
siimage.c:826: warning: (near initialization for `siimage_pci_tbl')
siimage.c:827: warning: excess elements in struct initializer
siimage.c:827: warning: (near initialization for `siimage_pci_tbl')
siimage.c:830: variable `driver' has initializer but incomplete type
siimage.c:830: conflicting types for `driver'
/usr/include/linux/ide.h:357: previous declaration of `driver'
siimage.c:831: unknown field `name' specified in initializer
siimage.c:831: warning: excess elements in struct initializer
siimage.c:831: warning: (near initialization for `driver')
siimage.c:832: unknown field `id_table' specified in initializer
siimage.c:832: warning: excess elements in struct initializer
siimage.c:832: warning: (near initialization for `driver')
siimage.c:833: unknown field `probe' specified in initializer
siimage.c:833: warning: excess elements in struct initializer
siimage.c:833: warning: (near initialization for `driver')
/usr/include/linux/ide.h:702: warning: array `ide_hwifs' assumed to have one element
siimage.c:830: storage size of `driver' isn't known
/usr/include/linux/ide.h:552: storage size of `timer' isn't known
/usr/include/linux/ide.h:553: storage size of `wrq' isn't known 没有安装内核源码吧,2.4上是识别为SCSI硬盘 这是官方网站的说明,
Installing the SATA Open Source Driver under Redhat 8.0
If you have a SATA 8.0 CD:
To install the software on a SATA drive there is an important detail. The PCI scan order must be reversed if there are IDE devices on the motherboard.
At boot time
Boot:Linux ide=reverse
at booting time this will assure the SATA drive becomes the target drive.
. At bootstrap configuration time
add ide=reverse(graphical interface)
or
.insert an append=”ide=reverse” on lilo.conf
Seagate drives require:(until Seagate fix is done)
Boot: Linux ide=reverse ide=nodma
It automatically reverts to dma after installation
Or Download Full Source Code from:
http://www.linuxdiskcert.org/.siimage/kernel-2.4.18-14.src.rpm
Here are the detailed instructions to build the kernel(s):
Make a copy (or move) the src.rpm to /usr/src/redhat/SRPMS
cd /usr/src/redhat/SRPMS; rpm –ikernel.2.4.18-src.rpm
cd ../SPECS; rpmbuild –bakernel-2.4.18-14.lad.spec or
rpmbuild -ba --without smp --without debug --without bigmem --target\
i686 kernel-2.4.18-3.lad.spec (if you know which kernel you want)
New kernel tree will show up in/usr/src/redhat/BUILD/kernel-2.4.18/linux
(note that the whole source tree kernel replaces (overlays) the old one. If you want to see the differences I suggest do an“mv kernel-2.4.18 kernel-2.4.18.ori” on usr/src/redhat/BUILD before doing the rpmbuild.
”diff –urN kernel-2.4.18 kernel-2.4-18.ori > kernel.2.4.18.lad.patch”
mv usr/src/redhat/BUILD/kernel-2.4.18/linux /usr/src/linux-2.4.18.
Optionally:
rpmbuild –ba will create many RPMs and it will place them into the directory /usr/src/redhat/RPMS.The RPMS can then be shipped to customers if you want to bypass step 1,2,3 and 4. In that case you start with the proper RPM on /usr/src/redhat/RPMS/arch as shown below.
Then you install them using RPM.
cd /usr/src/redhat/RPMS/i386
rpm –i*.rpm
cd /usr/src/linux-2.4.18;
make oldconfig;make dep; make bzImage
make modules; make modules_install
cd arch/i386/boot; mv bzImage /boot/vmlinuz-2-4-18
cd /boot; mkinitrd /boot/inirtd-2.4.18.img 2.4.18
NOTES:
#1: Reversing IDE scanning still apply if you want to boot from a SATA disk drive.
可我也是在官方下的驱动呀,其他地方还没驱动:(我的只有siimage.c和siimage.h两个文件,没什么rpm包,连readme都没有!而且还有 一个非open source的raid驱动,5m多,可我只能下1m多就下不了了,那个破网站只有2k/s的速度,还只能用浏览器,不能用flashget。晕。但是那里面可以看见能在rh9下安装的。不过是raid,我不用raid的呀:(
晕,? 到kernel.org下载个内核就行了,新的内核应该支持si的sata 好象有道理,我在网上经过不间断的努力,在
http://www.linuxquestions.org/questions/showthread.php?s=&forumid=18&threadid=142366
看到说2.6.2-rc3好象可以。
也不知道是2.6.2-rc3本来支持还是怎么的,反正我看上面说2.6.2编译时没有这个选项,尽管本来就有siimage.c。
I'm in the process of configuring 2.6.2. I have a SATA hard disk I want to use and I have a Silicon Image chipset pci controller card. I can't seem to find the option to enable SATA support for Silicon Image. I find siimage.c in another category but I would like to use libata. I've looked /drivers/scsi in the kernel sources and the driver for SATA using Silicon Image is there but I can't find it in make menuconfig.
有人说可以这样
you need to disable CLEAN_COMPILE in code maturity level options, as the silicon sata driver is marked "broken"... but it might work anyway.
I just tried the same, but I have a Silicon on-board SATA thing, which doesn't seem to be supported(?)
不知CLEAN_COMPILE是什么,在哪关。
页:
[1]