Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12604 Discussions

How to read/write multiple sector of ATA hard disk

Altera_Forum
Honored Contributor II
1,099 Views

Hi,all:

I want to read and write multiple sector of ATA hard disk with nios2,and i can read and write one sector only(the first sector under LBA addressing),anyone can tell me how to do?Following is some code and message:

Code:

 

 

 

Read HD ID:

<div class='quotetop'>QUOTE </div>

buffer2[1]=3fff.=================Number of logical cylinders

buffer2[3]=10.==================Number of logical heads

buffer2[6]=3f. ==================Number of logical sectors per logical track

buffer2[10]=3546.=============Serial number (20 ASCII characters)

buffer2[19]=2020.=============Serial number (20 ASCII characters)

buffer2[22]=4.==============Number of vendor specific bytes available on READ/WRITE LONG cmds

buffer2[23]=332e.=============Firmware revision (8 ASCII characters)

buffer2[26]=2020.=============Firmware revision (8 ASCII characters)

buffer2[27]=5354.=============Model number (40 ASCII characters)

buffer2[46]=2020.=============Model number (40 ASCII characters)

buffer2[47]=8010.============[7..0]00h =Reserved //[7..0]01h-FFh = Maximum number of sectors that can be transferred per interrupt on READ/WRITE MULTIPLE commands(1)

buffer2[51]=200.============[15-8] PIO data transfer cycle timing mode

buffer2[52]=200.

buffer2[53]=7.

buffer2[54]=ffff.=============Number of current logical cylinders

buffer2[55]=1.==============Number of current logical heads

buffer2[56]=1.============Number of current logical sectors per track

buffer2[57]=ffff.==============Current capacity in sectors

buffer2[58]=0.===============Current capacity in sectors

buffer2[59]=10.===========[15-9] Reserved [8]1=Multiple sector setting is valid [7..0] xxh=Current* * * * * * * * * * * * * * * * * * * * * * * * * * * setting for number of sectors that can be transferred per interrupt on R/W* * * * * * * * * * * * * * * * * * * * * * * * * * Multiple command

buffer2[60]=a780.===Total number of user addressable sectors (LBA mode only)

buffer2[61]=254.====Total number of user addressable sectors (LBA mode only)

buffer2[62]=0.

buffer2[63]=407.====[15-8] Multiword DMA transfer mode active[7..0] Multiword DMA transfer modes* * * * * * * * * * * * * * * * * * * * * * * * * supported

buffer2[64]=3.=======Advanced PIO transfer modes supported

buffer2[65]=78.======Minimum Multiword DMA transfer cycle time per word

buffer2[66]=78.

buffer2[67]=f0.=======Minimum PIO transfer cycle time without flow control

buffer2[68]=78.========Minimum PIO transfer cycle time with IORDY flow control

buffer2[80]=7e.=================Major version number

buffer2[81]=0.

buffer2[82]=346b.==================Command set supported.

buffer2[83]=4b09.================Command set supported.[/b]

Help me,please!

Thank you very much.

0 Kudos
0 Replies
Reply