📄 linux-2_6_14下usb驱动移植心得 - luofuchong - it博客网.htm
字号:
</P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"
align=left><SPAN lang=EN-US
style="FONT-SIZE: 9pt; COLOR: #555555; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"> </SPAN>
<SPAN
style="FONT-SIZE: 9pt; COLOR: #555555; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">│
│<SPAN lang=EN-US> Device
Drivers ---> <BR></SPAN>│ │<SPAN lang=EN-US>
Generic Driver Options --->
<BR></SPAN>│<SPAN lang=EN-US><*> Hotplug firmware
loading support <BR> </SPAN>│ │<SPAN lang=EN-US>
Block devices --->
<BR> </SPAN>│ │<SPAN lang=EN-US>
<*> Low Performance USB Block driver <BR> </SPAN>│
│<SPAN lang=EN-US> SCSI device
support ---> <BR> </SPAN>│ │<SPAN lang=EN-US>
<*> SCSI generic support <BR></SPAN>│ │<SPAN
lang=EN-US> [*] Probe all LUNs on each SCSI device
<BR> </SPAN>│ │<SPAN lang=EN-US>
USB support --->
<BR> </SPAN>│ │<SPAN lang=EN-US><*> Support for Host-side USB
<BR></SPAN>│ │<SPAN lang=EN-US>[*] USB device filesystem
<BR> </SPAN>│ │<SPAN lang=EN-US><*> OHCI HCD support
<BR></SPAN>│ │<SPAN lang=EN-US><*> USB Mass Storage support
<BR> </SPAN>│ │<SPAN lang=EN-US>[*] USB Monitor
<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"
align=left><SPAN
style="FONT-SIZE: 9pt; COLOR: #555555; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">3、加入了<SPAN
lang=EN-US>MSDOS fs</SPAN>和<SPAN lang=EN-US>VFAT fs</SPAN>的支持。<SPAN
lang=EN-US><o:p></o:p></SPAN></SPAN> </P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"
align=left><SPAN lang=EN-US
style="FONT-SIZE: 9pt; COLOR: #555555; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"> </SPAN>
<SPAN
style="FONT-SIZE: 9pt; COLOR: #555555; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">│
│<SPAN lang=EN-US> File
systems ---> <BR> </SPAN>│ │<SPAN lang=EN-US>
DOS/FAT/NT Filesystems --->
<BR> </SPAN>│
┌─────────────────────────────────────────────────────────────────────┐ │<SPAN
lang=EN-US><BR> </SPAN>│ │<SPAN lang=EN-US>
<*> MSDOS fs support
</SPAN>│ │<SPAN lang=EN-US><BR> </SPAN>│ │<SPAN lang=EN-US>
<*> VFAT
(Windows-95) fs support
</SPAN>│ │<SPAN lang=EN-US><BR> </SPAN>│ │<SPAN lang=EN-US>
(936) Default codepage
for FAT
</SPAN>│ │<SPAN lang=EN-US><BR> </SPAN>│ │<SPAN lang=EN-US>
(cp936) Default iocharset for
FAT </SPAN>│
│<SPAN lang=EN-US><BR> </SPAN>│ │<SPAN lang=EN-US>
< > NTFS file system support
<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"
align=left><SPAN
style="FONT-SIZE: 9pt; COLOR: #555555; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">做完这些后,插入<SPAN
lang=EN-US>u</SPAN>盘后,内核应该可以识别到<SPAN lang=EN-US>u</SPAN>盘,出现:<SPAN
lang=EN-US><BR>usb 1-1: new full speed USB device using s3c2410-ohci and address
3<BR>ub(1.3): GetMaxLUN returned 0, using 1 LUNs <o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"
align=left><SPAN
style="FONT-SIZE: 9pt; COLOR: #555555; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">但是,还有下面一句出错提示:<SPAN
lang=EN-US><BR>/dev/ub/a: unknown partition table <o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"
align=left><SPAN
style="FONT-SIZE: 9pt; COLOR: #555555; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">再次查看了贴子上大虾们的讨论,提到:“使能<SPAN
lang=EN-US>CONFIG_MSDOS_PARTITION</SPAN>选项”,再仔细查找,发现配置选项如下:<SPAN
lang=EN-US><BR></SPAN>│ │<SPAN lang=EN-US>
File systems ---><BR></SPAN>│ │<SPAN lang=EN-US>
Partition Types
---> <BR> </SPAN>│ │<SPAN lang=EN-US> [*]
PC BIOS (MSDOS partition tables) support<BR></SPAN>加上这个后应该就可以挂载<SPAN
lang=EN-US>usb</SPAN>上的<SPAN lang=EN-US>MSDOS</SPAN>分区了<SPAN
lang=EN-US><o:p></o:p></SPAN></SPAN> </P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"
align=left><SPAN
style="FONT-SIZE: 9pt; COLOR: #555555; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">以下是我的内核插入<SPAN
lang=EN-US>u</SPAN>盘后的提示信息:<SPAN lang=EN-US><BR>usb 1-1: new full speed USB
device using s3c2410-ohci and 2<BR>ub(1.2): GetMaxLUN returned 0, using 1
LUNs<BR>/dev/ub/a: p1<BR></SPAN>表示<SPAN lang=EN-US>usb</SPAN>设备已经挂载到<SPAN
lang=EN-US>/dev/ub/a/part1</SPAN>目录下<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN>
</P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"
align=left><SPAN lang=EN-US
style="FONT-SIZE: 9pt; COLOR: #555555; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">4.</SPAN>
<SPAN
style="FONT-SIZE: 9pt; COLOR: #555555; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">加入中文字体库(可惜在我的板上还是没能正常显示中文<SPAN
lang=EN-US>~_~</SPAN>,知道的朋友麻烦告诉我一声,大家一起探讨)<SPAN lang=EN-US><BR> </SPAN>│
│<SPAN lang=EN-US> Native Language Support
---> <BR> </SPAN>│ │<SPAN lang=EN-US><*>
Simplified Chinese charset (CP936, GB2312) <BR> </SPAN>│
│<SPAN lang=EN-US><*> NLS UTF8 <o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"
align=left><SPAN
style="FONT-SIZE: 9pt; COLOR: #555555; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">以下是挂载<SPAN
lang=EN-US>usb</SPAN>设备后的显示:<SPAN lang=EN-US><BR>[root@luofuchong /]# mount -t
vfat -o iocharset=cp936 /dev/ub/a/part1 /mnt<BR>[root@luofuchong /]# ls
/mnt<BR>cramfs-1.1.tar.gz netkit-base-0.17.tar.gz
thttpd-2.25b.tar.gz<BR>lfc
settings.dat
. . I. .. . .txt <o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"
align=left><SPAN
style="FONT-SIZE: 9pt; COLOR: #555555; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">三、一点心得。<SPAN
lang=EN-US><o:p></o:p></SPAN></SPAN> </P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"
align=left><SPAN
style="FONT-SIZE: 9pt; COLOR: #555555; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">1、如果想知道内核有没有识别出<SPAN
lang=EN-US>u</SPAN>盘的话可以执行命令:<SPAN lang=EN-US>cat /proc/partitions
</SPAN>,看看插入<SPAN lang=EN-US>USB</SPAN>前后分区信息有什么不同就知道了。<SPAN
lang=EN-US><o:p></o:p></SPAN></SPAN> </P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"
align=left><SPAN
style="FONT-SIZE: 9pt; COLOR: #555555; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><BR>2、另外,如果想让内核把它当成<SPAN
lang=EN-US>SCSI</SPAN>设备来处理的话,只要把上面:<BR><SPAN lang=EN-US
style="FONT-SIZE: 9pt; COLOR: #555555; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"> </SPAN><SPAN
style="FONT-SIZE: 9pt; COLOR: #555555; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">│
│<SPAN lang=EN-US> Device
Drivers ---> </SPAN><SPAN
lang=EN-US> <BR> </SPAN>│ │<SPAN lang=EN-US>
Block devices --->
<BR> </SPAN>│ │<SPAN lang=EN-US>
<*> Low Performance USB Block driver <BR></SPAN></SPAN>的 Low
Performance USB Block driver这个选项去掉,然后把:<BR><SPAN lang=EN-US
style="FONT-SIZE: 9pt; COLOR: #555555; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"> </SPAN><SPAN
style="FONT-SIZE: 9pt; COLOR: #555555; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">│
│<SPAN lang=EN-US> Device
Drivers ---></SPAN></SPAN><BR> │ │<SPAN lang=EN-US>
SCSI device support
---> <BR> │
│
<*>SCSI disk support<BR>的SCSI disk
support这个选项选上,重新编译内核就行。<BR>注:<BR> 个人觉得使用usb设备的话Low Performance
USB Block driver比SCSI disk要好,自己看着办吧^_^ <BR></SPAN><BR></SPAN><SPAN
style="FONT-SIZE: 9pt; COLOR: #555555; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">3、最后,一般都会新建一个<SPAN
lang=EN-US>/dev/sda1</SPAN>的链接指向<SPAN
lang=EN-US>usb</SPAN>设备的挂载点的,可以在启动文件中使用命令ln -s xxx xxx来建立这个链接。<BR><SPAN
lang=EN-US> <o:p></o:p></SPAN></SPAN> </P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"
align=left><SPAN
style="FONT-SIZE: 9pt; COLOR: #555555; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">四、<BR> 呵呵,说了一大堆的废话,希望不要见怪。毕竟我对<SPAN
lang=EN-US>usb</SPAN>设备了解不多,如果有什么说错的地方请各位大虾见谅。其实关于<SPAN
lang=EN-US>usb</SPAN>驱动的移植在网上有不少的贴,我在这里只对针对我的经历作一点总结而已,希望能对大家有一点的帮助<SPAN
lang=EN-US>^_^<o:p></o:p></SPAN></SPAN> </P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN
lang=EN-US><o:p> </o:p> </SPAN></P>
<DIV class=postDesc>posted on 2007-01-24 13:21 <A
href="http://www.cnitblog.com/luofuchong/">lfc</A> 阅读(461) <A
href="http://www.cnitblog.com/luofuchong/archive/2007/06/17/22265.html#Post">评论(3)</A>
<A
href="http://www.cnitblog.com/luofuchong/admin/EditPosts.aspx?postid=22265">编辑</A> <A
href="http://www.cnitblog.com/luofuchong/AddToFavorite.aspx?id=22265">收藏</A> <A
href="http://www.cnitblog.com/luofuchong/services/trackbacks/22265.aspx">引用</A>
</DIV></DIV><IMG height=1
src="linux-2_6_14下USB驱动移植心得 - luofuchong - IT博客网.files/22265.jpg" width=1> <!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<rdf:Description
rdf:about="http://www.cnitblog.com/luofuchong/archive/2007/01/24/22265.html"
dc:identifier="http://www.cnitblog.com/luofuchong/archive/2007/01/24/22265.html"
dc:title="linux-2.6.14下USB驱动移植心得"
trackback:ping="http://www.cnitblog.com/luofuchong/services/trackbacks/22265.aspx" />
</rdf:RDF>
-->
<SCRIPT type=text/javascript>
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('AjaxHolder$scriptmanager1', document.getElementById('Form1'));
Sys.WebForms.PageRequestManager.getInstance()._updateControls(['tAjaxHolder$UpdatePanel1'], [], [], 90);
//]]>
</SCRIPT>
<DIV id=AjaxHolder_UpdatePanel1><A
name=pagedcomment></A><!--done--><BR><B>评论:</B>
<DIV class=feedbackNoItems></DIV>
<DIV class=feedbackItem>
<DIV class=feedbackListSubtitle><A title="permalink: re: linux-2.6.14下USB驱动移植心得"
href="http://www.cnitblog.com/luofuchong/archive/2007/06/17/22265.html#22272">#</A> <A
name=22272></A>re: linux-2.6.14下USB驱动移植心得 2007-01-24 15:55 | <A
id=AjaxHolder_Comments_CommentList_ctl00_NameLink target=_blank>ruru</A><BR>
<DIV align=left><*> Low Performance USB Block driver
沒錯,把這個去掉,就可以出現scsi了~早上貼錯了^^"" <A
onclick='return SetReplyAuhor("ruru")'
href="http://www.cnitblog.com/luofuchong/archive/2007/06/17/22265.html#post">回复</A> <A
title=查看该作者发表过的评论 href="http://www.cnitblog.com/comment?author=ruru"
target=_blank>更多评论</A><BR><A id=AjaxHolder_Comments_CommentList_ctl00_DeleteLink
href="javascript:__doPostBack('AjaxHolder$Comments$CommentList$ctl00$DeleteLink','')"></A> <A
id=AjaxHolder_Comments_CommentList_ctl00_EditLink></A></DIV></DIV></DIV>
<DIV class=feedbackItem>
<DIV class=feedbackListSubtitle><A title="permalink: re: linux-2.6.14下USB驱动移植心得"
href="http://www.cnitblog.com/luofuchong/archive/2007/06/17/22265.html#22273">#</A> <A
name=22273></A>re: linux-2.6.14下USB驱动移植心得 2007-01-24 16:05 | <A
id=AjaxHolder_Comments_CommentList_ctl01_NameLink target=_blank>ruru</A><BR>
<DIV align=left>好像把CONFIG_BLK_DEV_UB關掉,<*> Low Performance USB Block
driver 打開,一樣可以使用SCSI~但是另外一個朋友使用,就沒辦法,要直接關掉<*> Low Performance USB Block
driver 才能出現scsi~這部分我再想想看^^ <A onclick='return SetReplyAuhor("ruru")'
href="http://www.cnitblog.com/luofuchong/archive/2007/06/17/22265.html#post">回复</A> <A
title=查看该作者发表过的评论 href="http://www.cnitblog.com/comment?author=ruru"
target=_blank>更多评论</A><BR><A id=AjaxHolder_Comments_CommentList_ctl01_DeleteLink
href="javascript:__doPostBack('AjaxHolder$Comments$CommentList$ctl01$DeleteLink','')"></A> <A
id=AjaxHolder_Comments_CommentList_ctl01_EditLink></A></DIV></DIV></DIV>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -