Read sectors of a hard disk without INT 13

Programming, for all ages and all languages.
Post Reply
Hercules
Posts: 15
Joined: Sun Dec 01, 2013 6:08 am

Read sectors of a hard disk without INT 13

Post by Hercules »

How to read sector of a HDD without use INT?
User avatar
bwat
Member
Member
Posts: 359
Joined: Fri Jul 03, 2009 6:21 am

Re: Read sectors of a hard disk without INT 13

Post by bwat »

Disassemble the int 13h handler and see.
Every universe of discourse has its logical structure --- S. K. Langer.
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Read sectors of a hard disk without INT 13

Post by iansjack »

It doesn't give a very good impression when you ask a question that is fairly comprehensively answered on the Wiki. Honestly, if you can't find the answer to your question with a little research then you'll be happier with a less demanding hobby.
User avatar
nerdguy
Member
Member
Posts: 70
Joined: Wed Oct 30, 2013 8:11 am

Re: Read sectors of a hard disk without INT 13

Post by nerdguy »

Looking at your question it seems you're using Protected Mode or Long Mode,
There are a lot of operating systems that do this checkout the projects section.
Also you didn't search the wiki
http://wiki.osdev.org/ATA_read/write_sectors
Also there is an existing question
http://forum.osdev.org/viewtopic.php?t=12268
As a lazy, old, stupid way you can switch back to pure real mode (I think v8086 has some complications regarding this, Win 95 suffered crashes and halts during Disk access) and use int 0x13 normally and then switch back to protected mode.
When you say, "I wrote a program that crashed Windows," people just stare at you blankly and say, "Hey, I got those with the system, for free." - Linus Torvalds
64 bit Kernel in early development
http://github.com/nerdguy12/core64
Hercules
Posts: 15
Joined: Sun Dec 01, 2013 6:08 am

Re: Read sectors of a hard disk without INT 13

Post by Hercules »

nerdguy wrote:Looking at your question it seems you're using Protected Mode or Long Mode,
There are a lot of operating systems that do this checkout the projects section.
Also you didn't search the wiki
http://wiki.osdev.org/ATA_read/write_sectors
Also there is an existing question
http://forum.osdev.org/viewtopic.php?t=12268
As a lazy, old, stupid way you can switch back to pure real mode (I think v8086 has some complications regarding this, Win 95 suffered crashes and halts during Disk access) and use int 0x13 normally and then switch back to protected mode.
How to switch back to protected mode at windows operating systems after use INT 13h?
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: Read sectors of a hard disk without INT 13

Post by thepowersgang »

You don't. If you're running under windows, you let it do the disk access. If you're running in your own 32-bit OS, you use native drivers (ATA and FDD drivers are quite simple). If you're running in a boot loader, then you may switch between real and protected modes and use the BIOS. Instructions on how to do so are in the Intel Manuals.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Post Reply