Author Topic: How can read a sector of HDD?  (Read 12117 times)

nobody

  • Guest
How can read a sector of HDD?
« on: October 28, 2008, 08:29:45 AM »
mov ah, 2
mov al, 1         ; How many?
mov ch, 0         ; Cylinder
mov cl, 2       ; Sector
mov dh, 0         ; Head
mov dl, 0               ; Drive
int 0x13
----------------------------------------------
This reads 2th sector of Floppy.

If HDD, the following is the code?
(I wish to read 64th sector of HDD.)

mov ah, 2
mov al, 1
mov ch, 0
mov cl, 64
mov dh, 0
mov dl, 80
int 0x13

nobody

  • Guest
Re: How can read a sector of HDD?
« Reply #1 on: October 28, 2008, 10:08:47 AM »
1. Your code is CHS code - obsolete (OK for obsolete floppy).
2. Address where to read ?
3. OS ? EXE type ? Your "code" will work only from RM in DOS or raw ... maybe also DPMI, but sure not in Linux :-D
4. This looks like a beginners question, not example code :-(

nobody

  • Guest
Re: How can read a sector of HDD?
« Reply #2 on: October 28, 2008, 12:51:57 PM »
Sorry