News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

direct access to hard drive sectors

Started by ritz, March 31, 2005, 04:55:28 PM

Previous topic - Next topic

ritz

I would like a simple example on how to access sectors on a hard drive (read&write). Have written plenty of programs in MASM and am trying my hand at MASM32. I have written programs in MASM32 that can access a floppy but not a hard drive. It must be possible because I have seen C programs that do it but the source code always has some INCLUDE or EXTERNAL not found when I try to compile the source code. I would appreciate any help with a code example or at least a direction to look in.

Tedd

For DOS programs it was fairly simple as you could just use the BIOS INT 13.
Newer versions of windows place security restrictions on what you're allowed to access - drive sectors being one of them.
That's not to say it isn't possible, but I'm assuming it'll require a system-level service (as in vxd.)
No snowflake in an avalanche feels responsible.

The_Grey_Beast

Check out the MSDN Library. Maybe you'll find out there what you're looking for (try searching for hard drive sectors).  :U


Opcode

Hi!

Use the CreateFile function.
Take a look in the section Physical Disks and Volumes in
the page http://msdn.microsoft.com/library/en-us/fileio/base/createfile.asp

Regards,
Opcode

Danesh

#5
Direct access to hard drive is almost impossible in Windows due to its multitasking characteristics. Unlike DOS (as Tedd mentioned BIOS Int 13h) in Windows you can not find any API function to access HD directly and while Windows manages it well, there is no need to do that...

thomasantony

Code your own OS :bdg . My OS has reached an FDD driver and a minimal FAT12 driver.

Thomas
There are 10 types of people in the world. Those who understand binary and those who don't.


Programmer's Directory. Submit for free