当前位置: 动力学知识库 > 问答 > 编程问答 >

assembly - How to know Bios drive no. for 3rd master SATA hard disk?

问题描述:

Uptill now I was using IDE hard disk and was able to access using BIOS calls and even LBA 28 direct hardware aceess usng PIO mode without need of any O.S. call.

Now I have purchased new SATA 500 GB hard disk and it is my only hard disk attached to SATA 1 port. My BIOS is showing it as 3rd Master Hard disk and primary and secondary master are absent.

Now I have installed MS DOS 5.0 on first partition which runs okay.

But now I can use only DOS INT 25h TO READ HARD DISK sectors starting from logical sector 0. This means I can not read any hidden sectors including Master Boot Record.

When I use BIOS int 13H calls to read hard disk using drive 80H it does not return any error, but reads nothing. If I use drive 83H it gives drive does not exists error. If I use DOS functions I can access my HDD as drive c ( drive 2) But can not be use to read MBR.

If I shall use MS extension for int 13H I must know the BIOS drive no.

Can anybody tells me how to find drive no. of 3rd Master Harddisk ?

Or which Port I have to use to access HDD using LBA 40 ( 01f0 does not work) in compatibilty mode ?

网友答案:

Ralf Brown's Interrupt List recommends hooking INT 13h and invoking INT 25h to see what BIOS drive number MS-DOS uses:

A method to detect the actual assignments of logical drive numbers to physical BIOS drive units (for example to detect the boot drive), is to temporarily mount an INT 13h handler recording the used DL drive unit for any INT 13/AH=02h read operations and discarding any attempts to access actual floppy drives. Then call INT 25h for all the appropriate DOS drives and watch the results recorded by the INT 13h interceptor.
分享给朋友:
您可能感兴趣的文章:
随机阅读: