September 16th, 2003, 09:42 AM
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.
September 16th, 2003, 11:58 AM
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.
September 16th, 2003, 12:57 PM
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!
September 16th, 2003, 05:00 PM
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.
September 17th, 2003, 01:46 AM
Thanks mate, that was what I was lookin' for!