標題: proting IDE driver for uclinux/linux [打印本頁] 作者: tommywgt 時間: 2007-2-2 01:06 PM 標題: proting IDE driver for uclinux/linux 我在Xilinx FPGA(EDK8.2)引用了MicroBlaze 32 bits RISC CPU, 可以RUN uclinux, 現在我又設計了一個非標準的IDE, 我自己寫個程式去R/W HD, 400G的也沒問題, 我也寫了一個FAT32 file system透過FAT32的LIB我所做的檔案操作, 使得HD接到WINDOWS也可以RUN的很正常. 但是問題來了, 這些自己寫的HD LIB無法跟uclinux KERNEL結合, 以致於無法直接跟系統資源結合, 也無法在VFS內mount這個device? - ^/ ]) V, e, C7 r4 p: ~6 Q" n$ J" b. `7 G+ f0 \
有人能夠清楚的詳列在LINUX下porting IDE driver的步驟嗎?作者: tommywgt 時間: 2007-2-7 05:54 PM 標題: [Linux] proting SATA using ATA driver 這一段是說明如何用ata driver改成sata, 照道理來講就是改drivers/ide這一段的code就對了.0 J$ g: y; D, X* t1 Z: ?: t v Q
有人能再補充更多的嗎? . t; q0 y' ?& f8 A7 x9 G7 w$ ]& ?0 \% _! }4 a6 z6 k. U2 L/ E
Driver Overview: Linux kernels have two ATA ("IDE") driver sets: " p6 }- s/ K$ `+ Y ) E; F# {7 o+ } N' G"drivers/ide": This is the traditional ATA driver set, maintained by Bartlomiej Zolnierkiewicz (before that, Andre Hedrick). Contrary to popular belief, it includes low-level drivers for many common SATA chipsets.+ z& L$ V; f& K
% a; i9 |- f" P: O$ t+ E& a7 uOptionally, on top of drivers/ide block-device (generic mass storage access) drivers, one can load drivers to provide software-level suport for BIOS services enabling various types of manufacturer-specific software RAID (called "fakeraid", below): 5 {4 O" g3 {" O + T3 _9 t' }/ z/ Z% kFor 2.4 kernels, Linux's software-RAID (fakeraid) driver collection is called "ataraid", which has subdrivers for the various manufacturers' different software RAID schemes. Using ataraid results in your partitions being addressed using a /dev/ataraid/d0p1 (etc.) device-naming convention. Note: Support greatly improved circa-2.4.23. 0 A: ^* L* ]! N3 R& @$ g* q. ^ ) Z; a' q& s6 {7 B$ @+ HFor 2.6 kernels, Linux's software-RAID (fakeraid) driver collection is called "dmraid" (Device Mapper RAID). So far (Sept 2004), Promise Fasttrack, HighPoint 37X, Intel ICH5/6, LSI, and SiI 3112A/Medley are supported: http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/ 7 N1 w" Y! o* O% L( G5 T$ _7 i2 C* ?
1 h' I" C& m ] p+ qI'm pretty sure manufacturers' proprietary drivers, where available, are designed to fit the above framework. q! \ S8 u0 i( w1 {# ?0 i
# |' q0 k, v. }
"libata": This is the newer ATA driver set for selected SATA chipsets only, maintained by Jeff Garzik, leveraging the kernel's well-tested SCSI layer. Garzik developed it in the 2.6 kernel series. 2.4 support was available only with a backported patch until libata's inclusion in 2.4.27 and later. * ~8 O; k- g& T0 R. P9 Y- Q 9 T. p* A( K/ b( Clibata causes each SATA port appear as a new SCSI bus. There are individual low-level drivers for the individual SATA chipsets, e.g., ahci, ata_adma, ata_piix, sata_nv, sata_promise, sata_sil, sata_sx4, sata_svw, sata_via, sata_vsc.作者: tommywgt 時間: 2007-2-7 05:58 PM 標題: hd spec 另外這有二個很重要的網站 , }" B) L2 n& o) a) W4 `& W. H( zwww.t10.org SCSI 0 Q$ u, g" ?2 ~www.t13.org ATAPI3 P/ E' {$ e2 z" C( E
0 ?% @1 w9 Y8 O) f1 D& S O
我在design HD controller時就是根據這二個網站資料的作者: kevin 時間: 2007-2-8 11:30 AM
我想你的問題是如何寫 Uclinux ide/ATA 的 driver. ! z2 u& M" V) d Z3 g, x( i8 s7 Z可以參考O'Reilly "Linux Device Drivers" book." ~- A5 ~( y; F2 O3 Y9 u: i2 b
code example 在 http://examples.oreilly.com/linuxdrive3/作者: tommywgt 時間: 2007-2-8 11:40 AM
好巧...這本書我有也... ' I. m. L$ U; H& R8 M: b) }4 h 8 p7 T- ?6 N- D不過還是謝了 / J% _1 |" O! }3 _6 G, E! E# F, _9 U/ I3 {2 X' e5 T" ^7 H
大大願意在這跟大家分享的話論壇的後進都會感謝你的...作者: tommywgt 時間: 2007-5-8 04:04 PM
沒人回也...我自己推一下好了, 不然只好找時間自己回了...鳴作者: windflowerz 時間: 2007-5-9 03:54 AM
我隻能幫妳頂一下,非常抱歉,幫不暸忙哦作者: jacky002 時間: 2008-1-26 09:50 PM
因為你是用uCLinux,所以我首先會問你有沒有將MMU的設定關掉,在我記憶中uCLinux是不支援MMU的。 ; ~- K6 a: y" x# X1 D$ e0 O2 v. u9 h3 ]
其次,你是用ATAPI或是SCSI的driver layer去寫這個driver的。建議Driver path最好還是使用SCSI會比較好,其實底層都類似,只不過SCSI再上層多做了一層,轉了一層SCSI command,也補強之前ATAPI的部分不足。 ( F q+ w- a3 r8 k% i9 p1 ^: i. Q: T, q' r/ N# u, n/ j
給你參考,希望對你有所幫助。作者: olduncle 時間: 2010-4-19 10:37 AM
除了看書之外,最實際的方法就是參考别家的Source code - ]1 g6 e! m# ]% ]1 E2 }Linux的源碼就有很可供參考,不管是legacy IDE或是掛在SCSI下的libata 5 ]2 Y, M! t( y6 L) `3 c* E' z) U看個2~3隻driver,你就會清楚ATA的interface需要哪些structure及private function point. . n7 ?) ?. I# a* ]+ Q6 O而且Lnux本身就支援許多Filesystem,除非你是要hack filesystem,否則只要porting driver就夠了。作者: olduncle 時間: 2010-4-19 10:38 AM
除了看書之外,最實際的方法就是參考别家的Source code / R, \( H3 V0 y" OLinux的源碼就有很可供參考,不管是legacy IDE或是掛在SCSI下的libata 1 F! [; z8 l/ ?. B+ U$ @5 ?看個2~3隻driver,你就會清楚ATA的interface需要哪些structure及private function point. ! X5 [* [1 m0 s3 Q! H) R! t) m而且Lnux本身就支援許多Filesystem,除非你是要hack filesystem,否則只要porting driver就夠了。