Chinaunix首页 | 论坛 | 博客
  • 博客访问: 53706
  • 博文数量: 24
  • 博客积分: 1480
  • 博客等级: 上尉
  • 技术积分: 250
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-12 16:20
文章分类

全部博文(24)

文章存档

2010年(24)

我的朋友

分类: 嵌入式

2010-06-21 15:07:54

内核配置时使用smdk2410的默认配置. U盘不能挂载!

    插拔U盘提示信息为:
$ usb 1-1: USB disconnect, address 2
usb 1-1: new full speed USB device using s3c2410-ohci and address 3
usb 1-1: configuration #1 chosen from 1 choice

查看partitions下的分区信息,没有出现USB设备
root@kevin /proc
$ cat partitions
major minor  #blocks  name

  31     0       1024 mtdblock0
  31     1       3072 mtdblock1
  31     2      40960 mtdblock2
  31     3      20480 mtdblock3

root@kevin /dev
$ ls u*
urandom         usbdev1.1_ep00  usbdev1.2       usbdev1.2_ep01
usbdev1.1       usbdev1.1_ep81  usbdev1.2_ep00  usbdev1.2_ep82


[b]解决方法:[/b]

   重新配置内核, 启用SCSI device support, SCSI相关模块最好编译进内核,不要以module形式编译.
   以上是网上提供的方法,但是问题还是没有解决,因为自己的内核还少了一个配置选项
   Device Drivers --> USB support --> USB Mass Storage support

   插上U盘后,显示:
usb 1-1: new full speed USB device using s3c2410-ohci and address 3
usb 1-1: configuration #1 chosen from 1 choice
scsi1 : SCSI emulation for USB Mass Storage devices
scsi 1:0:0:0: Direct-Access              USB Flash Disk   1.06 PQ: 0 ANSI: 0 CCS

sd 1:0:0:0: [sda] 129312 512-byte hardware sectors (66 MB)
sd 1:0:0:0: [sda] Write Protect is off
sd 1:0:0:0: [sda] Assuming drive cache: write through
sd 1:0:0:0: [sda] 129312 512-byte hardware sectors (66 MB)
sd 1:0:0:0: [sda] Write Protect is off
sd 1:0:0:0: [sda] Assuming drive cache: write through
sda: sda1
sda: p1 exceeds device capacity
sd 1:0:0:0: [sda] Attached SCSI removable disk


用dmesg查看信息:
dmesg
sd 0:0:0:0: [sda] 129312 512-byte hardware sectors (66 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 06 00 00
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] 129312 512-byte hardware sectors (66 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 06 00 00
sd 0:0:0:0: [sda] Assuming drive cache: write through
sda: sda1
sda: p1 exceeds device capacity
sd 0:0:0:0: [sda] Attached SCSI removable disk
selected clock c03200b4 (pclk) quot 27, calc 113169


root@kevin /
$ cat proc/partitions
major minor  #blocks  name

  31     0       1024 mtdblock0
  31     1       3072 mtdblock1
  31     2      40960 mtdblock2
  31     3      20480 mtdblock3
   8     0      64656 sda
   8     1      64656 sda1



u盘设备名为sda1.
$ mount -t vfat sda1 /mnt
Unable to load NLS charset cp43

FAT: codepage cp437 not found
mount: mounting sda1 on /mnt failed: Invalid argument

内核缺少cp437字符集. 重新配置内核, 在filesystems-->native language support-> 中选择Codepage 437和其他的一些常用的字符集.

重新mount
root@kevin /
$ mount -t vfat /dev/sda1 /mnt/usb

内核的设置,

Device Drivers --->

| │ Block devices --->

│ │ <*> Low Performance USB Block driver

的 Low Performance USB Block driver这个选项去掉,然后把:

│ │ Device Drivers --->

│ │ SCSI device support --->

│ │ <*>SCSI disk support

│ │ Device Drivers --->

│ │ Generic Driver Options --->

│<*> Hotplug firmware loading support

│ │ Block devices --->

│ │ <*> Low Performance USB Block driver

│ │ SCSI device support --->

│ │ <*> SCSI generic support

│ │ [*] Probe all LUNs on each SCSI device

│ │ USB support --->

│ │<*> Support for Host-side USB

│ │[*] USB device filesystem

│ │<*> OHCI HCD support

│ │<*> USB Mass Storage support

│ │[*] USB Monitor

加入了MSDOS fs和VFAT fs的支持。

│ │ File systems --->

│ │ DOS/FAT/NT Filesystems --->

│ │ │ <*> MSDOS fs support

│ │ │ │ <*> VFAT (Windows-95) fs support

│ │ │ │ (936) Default codepage for FAT

│ │ │ │ (cp936) Default iocharset for FAT

│ │ │ │ < > NTFS file system support

1、如果想知道内核有没有识别出u盘的话可以执行命令:cat /proc/partitions ,看看插入USB前后分区信息有什么不同就知道了。

2、另外,如果想让内核把它当成SCSI设备来处理的话,只要把上面:

│ │ Device Drivers --->

│ │ Block devices --->

│ │ <*> Low Performance USB Block driver

的 Low Performance USB Block driver这个选项去掉,然后把:

│ │ Device Drivers --->

│ │ SCSI device support --->

│ │ <*>SCSI disk support 的SCSI disk support这个选项选上,重新编译内核就行


原文网址

阅读(713) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~