Chip123 科技應用創新平台

 找回密碼
 申請會員

QQ登錄

只需一步,快速開始

Login

用FB帳號登入

搜索
1 2 3 4
查看: 5839|回復: 9
打印 上一主題 下一主題

proting IDE driver for uclinux/linux

[複製鏈接]
跳轉到指定樓層
1#
發表於 2007-2-2 13:06:59 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
10Chipcoin
我在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?
8 _( H: \1 b1 r$ f1 R2 b8 y. D5 k5 n- w" Y* d% z0 ^2 h: e
有人能夠清楚的詳列在LINUX下porting IDE driver的步驟嗎?

分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享分享 頂 踩 分享分享
2#
 樓主| 發表於 2007-2-7 17:54:28 | 只看該作者

[Linux] proting SATA using ATA driver

這一段是說明如何用ata driver改成sata, 照道理來講就是改drivers/ide這一段的code就對了.
+ l9 X( X+ n5 |- K" P有人能再補充更多的嗎?
; a# a! c" l, ~7 I+ b. i, k6 ]6 M* [3 M& \. Z: O+ Y
Driver Overview: Linux kernels have two ATA ("IDE") driver sets:1 a+ m! K( J6 u

1 ?+ R  r/ b4 B; {1 P; v: i0 J"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.# V' D+ X* M$ x7 w' X( g1 L- ]

/ F5 Q: K) y7 fOptionally, 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):
/ F+ F. W+ G7 k0 M# b9 }2 h( Z" M- P1 l& b: }6 ~
For 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.
, ~' X9 G' z6 b  Q! r& w" B1 r
9 Y5 w" E9 L7 n9 C* MFor 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/ 8 l3 j( Z& ?( H' S( G% m* B" s
1 o/ H8 L& F0 Q% f
I'm pretty sure manufacturers' proprietary drivers, where available, are designed to fit the above framework.
! i: m6 v* B" C' q7 B# }* F, |( N. k5 B, l' |" ~1 X  a0 F5 K/ E: ]2 b
"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.
2 C, ~7 S/ [5 Z2 r* ^, c' `! X3 o/ U& C( _: D$ O0 Y! A$ u
libata 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.
回復

使用道具 舉報

3#
 樓主| 發表於 2007-2-7 17:58:35 | 只看該作者

hd spec

另外這有二個很重要的網站
, t; @, A4 J5 j9 H, owww.t10.org SCSI
0 ]% o6 Q9 A) p9 M) Qwww.t13.org ATAPI
; y- k" ], H# R) n+ @1 V
; ]" `5 \, `$ p' c( i8 [* I我在design HD controller時就是根據這二個網站資料的
回復

使用道具 舉報

4#
發表於 2007-2-8 11:30:23 | 只看該作者
我想你的問題是如何寫 Uclinux ide/ATA 的 driver.! Y1 N0 j" V) ?
可以參考O'Reilly "Linux Device Drivers" book.3 g" J9 y$ g* m8 D; M! e- y
code example 在 http://examples.oreilly.com/linuxdrive3/

評分

參與人數 1Chipcoin +2 收起 理由
tommywgt + 2 在這跟大家分享如何?

查看全部評分

回復

使用道具 舉報

5#
 樓主| 發表於 2007-2-8 11:40:16 | 只看該作者
好巧...這本書我有也.../ w4 B# h9 n" X3 j0 b# I  G
, J+ U& q* K1 P7 r9 r
不過還是謝了
! u7 n: N8 Q+ @" e' g, L9 g0 x2 b) ^9 W2 e6 ~6 b) E9 D
大大願意在這跟大家分享的話論壇的後進都會感謝你的...
回復

使用道具 舉報

6#
 樓主| 發表於 2007-5-8 16:04:41 | 只看該作者
沒人回也...我自己推一下好了, 不然只好找時間自己回了...鳴
回復

使用道具 舉報

7#
發表於 2007-5-9 03:54:10 | 只看該作者
我隻能幫妳頂一下,非常抱歉,幫不暸忙哦
回復

使用道具 舉報

8#
發表於 2008-1-26 21:50:12 | 只看該作者
因為你是用uCLinux,所以我首先會問你有沒有將MMU的設定關掉,在我記憶中uCLinux是不支援MMU的。
- z  S+ s1 g9 u) {& o- x4 x1 @. d4 f* a6 p5 R
其次,你是用ATAPI或是SCSI的driver layer去寫這個driver的。建議Driver path最好還是使用SCSI會比較好,其實底層都類似,只不過SCSI再上層多做了一層,轉了一層SCSI command,也補強之前ATAPI的部分不足。
4 K# \$ G3 h  r* Z7 L1 o: O( w& ]' W6 P4 h7 u  X4 A
給你參考,希望對你有所幫助。
回復

使用道具 舉報

9#
發表於 2010-4-19 10:37:06 | 只看該作者
除了看書之外,最實際的方法就是參考别家的Source code5 C6 L2 d" i- \1 l6 x2 ]3 J' e: V& c
Linux的源碼就有很可供參考,不管是legacy IDE或是掛在SCSI下的libata
+ B7 u( H& c# U4 i, ^6 l- g看個2~3隻driver,你就會清楚ATA的interface需要哪些structure及private function point.
7 b  J# l9 \) j7 ~8 ^而且Lnux本身就支援許多Filesystem,除非你是要hack filesystem,否則只要porting driver就夠了。
回復

使用道具 舉報

10#
發表於 2010-4-19 10:38:54 | 只看該作者
除了看書之外,最實際的方法就是參考别家的Source code; r6 E" `$ @" L3 G; G
Linux的源碼就有很可供參考,不管是legacy IDE或是掛在SCSI下的libata
7 N: b4 Y2 a6 ], q+ c& e$ P) ~看個2~3隻driver,你就會清楚ATA的interface需要哪些structure及private function point.
  Y( s& d& n  n. i9 \* ~0 \* v而且Lnux本身就支援許多Filesystem,除非你是要hack filesystem,否則只要porting driver就夠了。
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 申請會員

本版積分規則

首頁|手機版|Chip123 科技應用創新平台 |新契機國際商機整合股份有限公司

GMT+8, 2024-9-21 11:20 AM , Processed in 0.177010 second(s), 17 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表