In-depth technology research: finding new ways to recover data, accessing firmware, writing programs, reading bits off the platter, recovering data from dust.

Forum rules

Please do not post questions about data recovery cases here (use this forum instead). This forum is for topics on finding new ways to recover data. Accessing firmware, writing programs, reading bits off the platter, recovering data from dust...
Post a reply

Hdd read/write int 13h(extended)

April 3rd, 2010, 14:49

Hello guys .

I dont know if this the correct place to put this or not.
tell me to remove if its souldnt be here .

I need a source code which can read /write and ofcourse get drive geometry
thru int 13h .
using avaiable direct port access driver for windows if any of you have or
can code such a program and interest to help
please cotact me with your target price offer.
I offer fast and secure payment for this .

Thank you all.

Re: Hdd read/write int 13h(extended)

April 3rd, 2010, 17:09

Persia2500 wrote:Hello guys .

I dont know if this the correct place to put this or not.
tell me to remove if its souldnt be here .

I need a source code which can read /write and ofcourse get drive geometry
thru int 13h .
using avaiable direct port access driver for windows if any of you have or
can code such a program and interest to help
please cotact me with your target price offer.
I offer fast and secure payment for this .

Thank you all.


As far as i know, there is no easy and safe way to access BIOS interrupts under windows (or under any MT OSes).
If you want to use BIOS interrupts, you should do it under DOS environment.
Google for int13, and you will found codes of course in assembly language. :)

Janos

Re: Hdd read/write int 13h(extended)

April 5th, 2010, 2:58

There are open source drivers to give you direct access to ports under windows.
http://www.torry.net/pages.php?id=227
spacifically I checked "smallport"
http://www.torry.net/vcl/system/portaccess/smport.zip

it worked ok.this is the driver working in "HDD REPAIR 2" (not sure about the name)
and some others if you can recall.
The problem is I'm totally unfamiliar with int 13h
extension, and you know how scary it looks without proper setup.
Only if I could find the code which works under dos or anything else making it to
work under windows is easy as far as it uses the extended 13h interface not the old one.
My goal is to be able to store and read back small data on SA like (software serial numbers )
not changing SA addressing layout. I wonder if there is, for example, any firmware test routine
available from udma interface, which could be abused to do this indirectly(without int 13h) ?
I don't care if it writes in smart log file area or where ever else as long as it dosnt impact normal
hdd functionality. you know if there is any other specific restriction to this ?
or you know about any hhd rom image I could use with emulator
to learn more about the boot process? this is a comercial project so if you need (NDA) or negotiate
price for any thing spasific you can do so before head .

Thank you again

Re: Hdd read/write int 13h(extended)

April 7th, 2010, 5:56

My information about this is limited to what I have learned here from you, guru, doomer, and other guys I don't have a full insight of what it takes to do this. So I appreciate you guys advice, correction or direction.

Re: Hdd read/write int 13h(extended)

April 8th, 2010, 21:30

U do not need int13.
If u want to do DR or anything HDD related, study ata specs at T13.org and write low level HDD access routines.
I wrote the low level routines in assembly and built a higher level prog on those routines in C++.

pepe

Re: Hdd read/write int 13h(extended)

April 9th, 2010, 18:34

Same here as Pepe. I modified winio.dll to suit my needs, and then call through c# for ease of use. Any reasonable attempt at coding some basic ATA commands will take less than an hour. The understanding gained by doing it will be priceless.

Re: Hdd read/write int 13h(extended)

April 10th, 2010, 14:40

:idea:

Re: Hdd read/write int 13h(extended)

April 13th, 2010, 17:27

Well ,
When In the Older Golden Dos Period We Had Interrupts ,Long Time Back When i Used To Write Antivirus Software for fun i USe To Use Int 13 Also ,I Mean whats the Big Deal Here ,Have You Read a Book From Ray About DOS Int .Also For HDD As Pepe Has Put It together Its Useless for HDD Specific Work Better Read the Entire ATA Set And Thier Usage ,Stuff Like MHDD Have Fully Utilized This and Made a successful Software .

Re: Hdd read/write int 13h(extended)

June 29th, 2010, 11:49

Thank you guys for your help.
Are you sure that Its possible to read/write data on firmware area (for example where smart log is placed ) using ATA interface ? I need to over write one of the firmware routines start address to call my own function
or atleast store some small data on SA.
Thanks again.

Re: Hdd read/write int 13h(extended)

June 29th, 2010, 16:38

Persia, if you couldn't do it through the ata interface the vendor would never be able to update in the field. Products like the PC3000 or SD would not be so user friendly. Pepe, what was that idea face for? You should see what I am working on now ;)
Shawn

Re: Hdd read/write int 13h(extended)

June 30th, 2010, 19:58

Persia2500 wrote:Thank you guys for your help.
Are you sure that Its possible to read/write data on firmware area (for example where smart log is placed ) using ATA interface ? I need to over write one of the firmware routines start address to call my own function
or atleast store some small data on SA.
Thanks again.

I'm not a programmer, but AIUI the ATA spec provides a firmware download command, but no upload. However, there are several command codes reserved for Vendor Specific Commands, which of course are not publically available.

In fact you can sometimes see VSC errors when you try to run Western Digital's Data Lifeguard diagnostic on an external drive (whose USB-SATA bridge doesn't pass vendor specific commands).

Re: Hdd read/write int 13h(extended)

July 23rd, 2010, 18:13

I assume that if you know where to read and the meaning of data you are reading it's possible to read sectors using int13h without any special codes,
here is part of int13h ref., I added a small code clarify ..
data segment
buff db 512 dup(?)
code segment
assume cs:code,ds:data,es:data
main proc far
; Function Table
; 00h Reset Disk Drives
; 01h Check Drive Status
; 02h Read Sectors From Drive
; 03h Write Sectors To Drive
; 04h Verify Sectors
; 05h Format Track
; 08h Read Drive Parameters
; 09h Initialize Disk Controller
; 0Ah Read Long Sectors From Drive
; 0Bh Write Long Sectors To Drive
; 0Ch Move Drive Head To Cylinder
; 0Dh Reset Disk Drives
; 10h Test Whether Drive Is Ready
; 11h Recalibrate Drive
; 14h Controller Diagnostic
; 15h Read Drive Type
; 41h EXT Test Whether Extensions Are Available
; 42h EXT Read Sectors From Drive
; 43h EXT Write Sectors To Drive
; 44h EXT Verify Sectors
; 45h EXT Lock/Unlock Drive
; 46h EXT Eject Drive
; 47h EXT Move Drive Head To Sector
; 48h EXT Read Drive Parameters
; 49h EXT Detect Media Change


start:
;+ ES:BX .boot sector info (Buffer Address Pointer)
mov es,ax
mov bx,offset buff
mov ah,2 ;Read Sectors
mov al,1 ;Sectors To Read Count
mov ch,0 ;Track
mov cl,0 ;Sector
mov dh,0 ;Head
mov dl,80h ;1st hard disk
int 13h ;call

the above is to read sector 0,0,0 into buffer


mov bx,offset buff
mov ah,3 ;Write Sector
mov al,1
mov ch,0
mov cl,3 ; sector3
mov dh,0
mov dl,080h ; 1st hard disk
int 13h ;call

This is to write it somewhere else like 3,0,0


this is good, for example, if you want to put password check before letting the system the boot (how ever not for real world application since it can be easily restored )my information about hdd is very limited, but I think it should be easily possible to use an interrupt sniffer likehttp://www.perisoft.net/bushound/
(please share if you know of some free or cheaper alternative )to check the registers before the call(which tries to write smart log whatever ..) revealing the TSH, even if they use negative sector (an expert here told me they might use negative sector not using 0 ) however since they build the translator themselves. Theysure call the interrupt with some out of bound secret positive value which then might be translated to somewhere before 0 the ata might offer simple and great functions however since it very likely use bios facilities I can't get why you think Int13h is stone age.

I havent tried to scan invalid sectors nore the interupt since by having hot summer days here the very stupid seagate smart log overflow happened to my main coding pc and some others. when i setup to test again after recovery.

Thank you every some of the hints helped alot

Re: Hdd read/write int 13h(extended)

July 23rd, 2010, 19:14

fzabkar wrote:
Persia2500 wrote:Thank you guys for your help.
Are you sure that Its possible to read/write data on firmware area (for example where smart log is placed ) using ATA interface ? I need to over write one of the firmware routines start address to call my own function
or atleast store some small data on SA.
Thanks again.

I'm not a programmer, but AIUI the ATA spec provides a firmware download command, but no upload. However, there are several command codes reserved for Vendor Specific Commands, which of course are not publically available.

In fact you can sometimes see VSC errors when you try to run Western Digital's Data Lifeguard diagnostic on an external drive (whose USB-SATA bridge doesn't pass vendor specific commands).



You are correct about usb bridges how ever I didn't find anything about vendor specific commands IN ATA ref. great if you could direct me to where to read (any abstract version) . before then I think it might not be related to incomplete Implimentation of ATA by usb convertor it might be also because they share access to a bus (using kinda virtual bus) not address able by intrupt since .For pata its like
80h for first and
81h for second
this means that it can't even address 2 drives on 1 cable let alone for usb.
Thank you for the information can you recall any of those errors and can you link them with any specific task ?
im getting the feeling that hdd pros refer to unusual intrupt call as vendor spasific command !
try to check if i can get what you are point at with data lifegaurd.
Thanks again
Post a reply