SEO Header Title

Free Diagnosis

Two Reasons
To Use MjM: 

 
1. FREE Diagnosis

2. No Data Recovery, No Fee.

All data recovery work undertaken by MjM is under a free diagnosis and a no recovery no-fee policy. If it is not possible to recover your data, then there is no fee for you to pay. If you need market leading data recovery services please telephone us now on

0800 072 3282
 
OR
 

 

Serviced UK Areas

We have recovered data for
customers from all over the UK,
including the towns and cities
below, but please note that our
Data Recovery Labs are
based in Letchworth, Herts
and all media will need to
be delivered there.

Ashford Leicestershire
Basildon Lincoln
Bath Lincolnshire
Bedford Liverpool
Bedfordshire London
Belfast Luton
Berkshire Maidstone
Birmingham Manchester
Blackburn Merseyside
Blackpool Middlesbrough
Bolton Milton Keynes
Bournemouth Newcastle-upon-
Tyne
Bradford Norfolk
Brighton Northampton
Bristol Northamptonshire
Buckingham Northumberland
Buckinghamshire Norwich
Cambridge Nottingham
Cambridgeshire Nottinghamshire
Cardiff Oldham
Chelmsford Oxbridge
Cheshire Oxford
Chester Oxfordshire
Colchester Peterborough
Cornwall Plymouth
Coventry Poole
Cumbria Portsmouth
Derby Preston
Derbyshire Reading
Devon Rotherham
Doncaster Rutland
Dover Scarborough
Dudley Sheffield
Durham Shropshire
East Sussex Somerset
Edinburgh Southampton
Essex Stafford
Glasgow Staffordshire
Gloucester Stoke
Gloucestershire Stoke-on-Trent
Greater Manchester Stratford-upon
-Avon
Guildford Suffolk
Hampshire Sunderland
Harrogate Surrey
Herefordshire Sussex
Hertford Tyne-and-Wear
Hertfordshire Warwickshire
Huddersfield West Midlands
Hull Wiltshire
Ipswich Winchester
Isle-of-Wight Windsor
Kingston upon Hull Wolverhampton
Lancashire Worcestershire
Leeds York
Leicester Yorkshire
ATA Registers

ATA Port Map

When programming directly to a hard disk, a full understanding of the interface between the hard disk and the computer is required.

ATA Port Map and Descriptions

A hard disk that complies with ATA/ATAPI standards will have 9 user accessible registers. For arguments sake we will number these P00 - P08, the function of each register is described below, note that some registers have a different name and purposes depending whether the register is being written to or when it's contents are being read by the computer. Also, the ports may contain different or Missing information when DATA and NONDATA commands are sent. For example, when sending an IDENTIFY_DEVICE (ECh) only the command register needs to be set. Note also that once the command register has been written to, the drive will execute the command immediately. So the correct procedure is;

  1. Wait for the drive to enter 'READY' state - Status Register = 50h
  2. Set Registers P00-P06 with the correct vales
  3. Set the command register P07 with the command code
  4. Wait for the drive to set DRQ state - This means that data is ready in the buffer
  5. Read the buffer
  6. -> step 4
  7. Process finished

If an error condition is encountered, bit 1 of the status register is set. More information about the error can be found by querying the ERROR register. set the other registers with the correct data, with the command register being set last. The drive will then run the command and return the information to it's buffer ready to be read 2 bytes at a time at P00.

Hard Disks Port Registers

Port list and description of functions.

    Function
Port Size Read Mode Write Mode
P00 16 bit Read Data Data to Write
P01 8 bit Error Register Feature Register
P02 8 bit Sector Count Register Sector Count Register
P03 8 bit LBA Low register LBA Low Register
P04 8 bit LBA Middle Register LBA Middle Register
P05 8 bit LBA High Register LBA High Register
P06 8 bit Drive and Head register Drive and Head Register
P07 8 bit Status Register Command register
P08 8 bit Alt Status Register Device Control Register

Status register Flags

When reading the status register, it shows the current status of the drive. The status register is 8 bit and each bit is described below

  • BSY (busy) - Self explanatory - The drive is 'busy' with the previous command.
  • DRDY (device ready) - The drive is ready for the next command as long as DSC is set
  • DF (Device Fault) - The hard disk has developed a fault that prevents it from completing the command.
  • DSC (seek complete) - The last seek command has completed successfully.
  • DRQ (Data Transfer Requested) - Data is in the drive's buffer memory waiting to be read.
  • CORR - This bit is obsolete
  • IDX - This bit is obsolete)
  • ERR (error) - There was an error processing the last command (see below)

For example if the status register reads 80 (50h) this is 01010000 in binary which shows DRDY and DSC flags as set - the drive is ready for the next command.

Error register Flags

When an error occurs, it is best to read the ALT_STATUS register, if the value is not even then an Error Event has occurred. The exact code can be read from the ERROR_REGISTER. The register is 8 bit and each bit is described below. the value returned when the bit in the error register is set.

  • BBK - Bad block mark - A bad block mark was detected ID field for the sector being read.
  • UNC - Uncorrectable Error - An error encountered that could not be corrected
  • MC - Media Changed (Not used for Fixed Hard Disk Drives)
  • IDNF ID mark Not Found - The ID field for the sector could not be found.
  • MCR Media Change Requested (Not used for Fixed Hard Disk Drives)
  • ABRT (command aborted or not recognised) - The last command was aborted because of a drive status error or the last command was not recognised.
  • TNF (Track 0 Not Found) Track 0 was not found during a Recalibrate command.
  • AMNF (Address Mark Not Found) The data address mark was not found after finding the correct ID field

e.g. If error register reads 04h this is 00000100 binary indicating the ABRT flag set - the drive did not recognise the last command or an error occurred whilst processing it.

For drives that support the CFA command set, it is possible to get precise information about the error using the CFA REQUEST EXTENDED ERROR CODE.

 

 

 

 

 

Testimonials

 

Excellent and speedy service. A very professional company to deal with.

Stuart Rickards - CS Systems Ltd

 


 

 
Further testimonials and ratings can be viewed at ITProfessionals.