Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool ReadSector(unsigned char cylinder, unsigned char head, unsigned char sector)
- {
- //Seek(cylinder, head);
- ReadTransfer();
- MotorOn();
- for (int i = 0; i<5; i++)
- {
- SendData(CMD_READ);
- SendData(0 | (head<<2));
- SendData(cylinder);
- SendData(head);
- SendData(sector);
- SendData(2);
- SendData(18);
- SendData(27);
- SendData(0xFF);
- WaitIRQ();
- ReadData(); //st0
- ReadData(); //st1
- ReadData(); //st2
- ReadData(); //cylinder
- ReadData(); //head
- ReadData(); //sector
- ReadData(); //Sektorgröße
- if(inb(MSR) & 0xC0)
- {
- MotorOff();
- return true;
- }
- }
- MotorOff();
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment