一、移植环境 主 机:Fedora 14 (kernel-2.6.33.7) 开发板:FL2440(nandflash:K9F1G08 128MB) 编译器:arm-linux-gcc-4.3.2 二、移植步骤 2.6.33.7内核中对USB设备的支持已经非常全面了,这里只需要配置他就可以了,配置完后重新编译内核烧到开发板上。具体步骤如下:
1、配置内核。 - Device Drivers --->
-
SCSI device support --->
-
< > RAID Transport Class
-
<*> SCSI device support
-
< > SCSI target support
-
[*] legacy /proc/scsi/ support
-
*** SCSI support type (disk, tape, CD-ROM) ***
-
<*> SCSI disk support
-
< > SCSI tape support
-
< > SCSI OnStream SC-x0 tape support
-
< > SCSI CDROM support
-
<*> SCSI generic support
-
< > SCSI media changer support
-
[*] HID Devices --->
-
--- HID Devices
-
-*- Generic HID support
-
[ ] HID debugging support
-
[ ] /dev/hidraw raw HID device support
-
*** USB Input Devices ***
-
<*> USB Human Interface Device (full HID) support
-
[ ] PID device support
-
[*] /dev/hiddev raw HID device support
-
[*] USB support --->
-
{*} Support for Host-side USB
-
[ ] USB verbose debug messages
-
[ ] USB announce new devices
-
*** Miscellaneous USB options ***
-
[*] USB device filesystem
-
[*] USB device class-devices (DEPRECATED)
-
<*> OHCI HCD support
-
<*> USB Mass Storage support
2.启动。发板启动时候出现如下提示信息,可以看到sda就是U盘设备了,sda1是U盘的一个分区。 - scsi0 : usb-storage 1-1.4:1.0
-
yaffs_read_super: isCheckpointed 0
-
VFS: Mounted root (yaffs filesystem) on device 31:3.
-
Freeing init memory: 144K
-
scsi 0:0:0:0: Direct-Access Generic USB SD Reader 1.00 PQ: 0 ANSI: 0 CCS
-
sd 0:0:0:0: Attached scsi generic sg0 type 0
-
sd 0:0:0:0: [sda] 3994624 512-byte logical blocks: (2.04 GB/1.90 GiB)
-
sd 0:0:0:0: [sda] Write Protect is off
-
sd 0:0:0:0: [sda] Assuming drive cache: write through
-
sd 0:0:0:0: [sda] Assuming drive cache: write through
-
sda: sda1
-
sd 0:0:0:0: [sda] Assuming drive cache: write through
-
sd 0:0:0:0: [sda] Attached SCSI removable disk
3.挂载U盘。但是失败了。 - # mount /dev/sda1/ mnt/usb
- mount: mounting /dev/sda1/ on mnt/usb failed
4. 错误分析处理。首先查看/dev/目录下并没有sda1节点所以出错,我们查看/proc/partitions/目录发现sda1的主设备号是8,次设备号是1,那么我们就创建这个设备的节点,b代表块设备,最后再执行mount命令,没有出错. - # cat proc/partitions
- major minor #blocks name
-
31 0 128 mtdblock0
- 31 1 384 mtdblock1
- 31 2 3072 mtdblock2
- 31 3 61440 mtdblock3
- 31 4 512 mtdblock4
- 31 5 60928 mtdblock5
- 8 0 1997312 sda
- 8 1 1997188 sda1
-
#mknod /dev/sda1 b 8 1
- #mont /dev/sda1 /mnt/usb
5.U盘挂载成功,可以查看U盘的内容,即表示开发板可以驱动USB。
- #ls /mnt/usb
-
st-ndt
-
hello.txt
-
E1002stdV3.1.0.7.install.bin
2011-01-26 |