The common port used for operating the hard disk is 1f0h ~ Port 1f7h

Source: Internet
Author: User

The common port used for operating the hard disk is 1f0h ~ Port 1f7h. The meaning of each port is as follows:
Port Number read or write specific meaning
1 f0h read/write is used to transmit read/write data (the content is a byte of data being transferred)
1f1h read is used to read error codes
1f2h read/write: number of sectors to be read/written
1f3h
1f4h read/write is used to store the low 8-bit bytes of the read/write cylindrical disk.
1f5h read/write is used to store the high 2-bit bytes of the read/write cylindrical disk (the High 6-bit constant is 0)
1 f6h read/write is used to store the disk number and head number to be read/written.
7th-bit constant is 1
The 6th-bit constant is 0.
5th-bit constant is 1
0 represents the first hard disk. 1 represents the second hard disk.
3rd ~ 0 bits are used to store the head number to read/write
1f7h read is used to store the status after the read operation
7th-bit controller busy
6th-bit disk drive ready
5th-bit write error
The 4th-bit search is complete.
When the 3rd-bit value is 1, the slice buffer is not ready.
Whether the 2nd-bit disk data is correctly read
For a 1st-bit disk, set this field to 1 every week after conversion,
The command before 0th bits ends due to an error
Write this port as the command port to issue the specified command
Format the track for 50 h
Try to read the sector for 20 h
For 21 h, you do not need to verify whether the sector is ready and directly read the sector
For 22 h, try to read the long fan area (for the early hard disk, each fan may not be 512 bytes, but the value between 128 bytes and 1024)

For 23 h, you can directly read the long fan area without verifying whether the slice is ready.
Try to write a sector for 30 h
Write the sector directly for 31 h without verifying whether the sector is ready
Try to write a long fan area for 32 h
Write the long fan area directly for 33 H without verifying whether the slice is ready
Note: of course, after reading this table, you will find that this read/write port method is actually based on the hard disk read/write method of the head, cylinder, and sector, however, the read/write Method for hard disks larger than 8 GB is also through the port 1f0h ~ ^_^ Implemented by 1f7h

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.