sector i/o in C

Discussion in 'Programmer's Corner' started by urchik, Mar 9, 2007.

  1. urchik

    Thread Starter Member

    Mar 8, 2007
    12
    0
    hello, i'm programming a software to read a sector at a time or write certain data to certain sectors at a time ... like MBR for example. Back in the day I used Borland C with the help of dos.h and bios.h to do this job. I cannot use Borland anymore due to certain limitations that it has thus I'm using Visual Studio 2003 which fully supports stdio.h and C.

    Can anymore direct me what library I can use or code, anything.
     
  2. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    4
    Windows won't allow you to access disk directly through bios or similar dos library. You have to go through Windows API. There are not many direct (raw functions provided to do what you want, but you could try looking here and see whether it would be enough to do what you need.

    Failing that, you could try direct IOCTL or even (this is the extreme) writing your own filter driver.
     
  3. urchik

    Thread Starter Member

    Mar 8, 2007
    12
    0
    i was thinking of using DOS... like boot up from disk A using ms win 95/98 boot disk and use it in dos...I would like to read NTFS data by reading it using a sector at a time. Does that help?
     
  4. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    4
    I don't think VS2003 supports DOS code anymore. It could do console application, but that is just Windows program that looks like DOS command prompt.

    What's wrong with you Borland compiler (and what version)? Why don't you just use that?
     
  5. urchik

    Thread Starter Member

    Mar 8, 2007
    12
    0
    i used borland turbo c 2.01 ... which is the latest one they had that supports true 16 bit - 32 bit programming. I tried to use Borland C++ but many functions do not work. Plus the borland compiler im using for some reason does not read sectors off of a hard disk. By using dos.h and bios.h I was able to read memory and floppy disks... using the same code for hard disks does not work and gives me either an error or something else.

    You see DOS.H was probably designed to read FAT16-32 disks, I need a code to read NTFS and others.

    THanks and let me know if anyone here knows anything to help me.
     
  6. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    4
    What version of Borland C++? Up to 3.1 you could do DOS program. Apart from that, I don't think it did any DOS program. So what's wrong with your TC 2.01?
     
Loading...