#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Netherlands
    Posts
    12
    Rep Power
    0

    Question Direct Disk Access: HELP!!!


    Does somebody know how you can directly access a floppy disk or H-Disk with C, C++ code? Example:

    'I want to read out Sector 25 from C:' or
    'I want to write variable A$ to Sector 2 of A:'

    Can somebody help me, please?
    Last edited by PimVelders; September 16th, 2003 at 09:45 AM.
  2. #2
  3. Contributing User

    Join Date
    Aug 2003
    Location
    UK
    Posts
    5,109
    Rep Power
    1802
    It may depend what OS you are using, and which file system.

    In 16bit DOS (real DOS, rather than DOS on Windows) there are BIOS functions for low level disk access. In Windows however it is more difficult (at least I hope it is), because the protected mode OS does not provide access priviliges for such low level access (for good reason!). I imagine that you will need to write a kernel level driver, for which you need a DDK. Also bear in mind that disks have different formats, e.g. FAT, NTFS, etc. and that you can seriously harm your data doing this, or even the ability to boot your machine.

    Clifford
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Netherlands
    Posts
    12
    Rep Power
    0
    Hi Clifford,

    My goal was to create a new kind of File System. I already knew the file systems FAT, FAT12, FAT16, FAT32, NTFS, EFS, NFS, Ext2 and almost all other FS'es that exist, but I think they all suck. NTFS is close, but I wanted more, so i created my own. I already made the FS, but only for Image use. So, I only need a piece of code to Low-Level access a disk so i can really use my FS. Anyway, what's a 'DDK', and where can I find one? Really appreciate your response!
  6. #4
  7. Contributing User

    Join Date
    Aug 2003
    Location
    UK
    Posts
    5,109
    Rep Power
    1802
    You are either brave, foolish, or genius.

    Betamax was better than VHS, which is little comfort when you are standing in Blockbuster.

    However, more constructively - a DDK is a Device-driver Developement Kit. It is available from Microsoft. Start here: http://msdn.microsoft.com/library/de...ntro_44iv.asp. While checking this reference, I noticed the IFS Kit (Installable File System development kit). This sounds like what you are looking for, but unless you are targeting Win2K Server, you may be out of luck. Also unless you have a full MSDN subscription (expensive), which you don't otherwise you'd know what the DDK was, you may find it very hard to get the DDK/IFS versions required to support older versions of Windows. Microsoft are dropping support for 9x/NT, and even parts of 2K like they stink.

    Getting Windows to recognise an alternate file system would be no mean feat I think. At this low level you will also find that Windows 9x, and NT/2k/XP have very little in common, so multi-platform support may be hard. The file system and the OS are closely linked. On the other hand, with Linux you get the source code and tools to build it, so you can screw around to your hearts content, which is probably what you should do.

    Clifford
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Netherlands
    Posts
    12
    Rep Power
    0

    Thanks!


    Thanks mate, that was what I was lookin' for!

IMN logo majestic logo threadwatch logo seochat tools logo