non-DOS Floppy Disk format

I am trying to read a non DOS disk format ie it doesn't
have 512 bytes per sector. (I am assuming this as whenever
a try a read sector [INT 25h?]  I get - bad sector found).

I know you can alter the Floppy disk parameters by altering the  contents of a table ( I managed to deduce that much) whose address is stored at vector 1Eh - I just don't know how you are supposed to change the table to as I cannot find out what the contents of the table are. Do you have to do this under assembler?
Or is there a driver that you can use to do this?

I am using Win95 and WINNT both of which have different approaches to accessing disks. I have no trouble accessing standard DOS format disks using the Win95 and WINNT approaches ie CreateFile and DeviceIoControl.

If I change the contents of the table (or point to a different table - which I think is the safer course of action ) Can I then use the original APIs (CreateFile - DeviceIoControl) to access the disk as normal?

Is there an API set I should be investigating?

Any help that anyone can give me would be a help.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

This is a pretty low-level issue you are talking about. There are various ways of approaching the problem. One way of doing it is to write your own floppy driver which can send messages to the device instead of going to the default floppy driver itself. It is possible to set communication between the UI and your driver. You might need to use the 95/NT DDK . The technique to do this is totally different for NT and 95. No , you don't need to do it in assembly. Plain C should be okay to get there. The DDK gives several examples of floppy drivers in the storage section of the src, check it out. But be warned !!! you might find DDK document less clear and scanty compared to the SDK help files you are used to.

Generally , under 95 you can access the non-standard device be writing a VxD altenately, NT supports kernel mode drivers.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
froggerAuthor Commented:
What I need to know is how to do it? I have already investigated the DDK which as you say is very cryptic and all the samples are undocumented. I wouldn't be able to tell you which one was for a floppy driver. And I seriously doubt any of them deal with sector sizes of 256 bytes and 14 sectors per track. (Why the disk has this format I don't know)

I can use a shareware program called MAXI-disk which runs on 3.11 and 95 and that has no problem reading and writing sectors of 256 bytes in size (and it doesn't use its own driver on the 95 platform).

What I am asking is
a) How do you configure for a sector size of 256 bytes and with sectors of 14 sectors per track?
b) Can I then use int 25 and int 26 type calls to read and write sectors?
The number of bytes per sectors  information is kept in your partition table. Other information is supported inside the boot sector. If you change the no. of sectors in this structure and also other relavent information you should be able to create your own boot record info.

Yes, int 25 and 26 can help you read and write info. If you want to attempt to r/w in real mode refer to the thunking topics under MSDN.

DDK is not well documented. I would suggest referring to some 3rd party tools like VToolsD which rectify most of the bugs and errors DDK has left behind , at least most of the bugs related to Scatter gather buffers related to the stuff you are planning to do.
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

froggerAuthor Commented:
I didn't realise that Floppy disks had partition tables. Also
the disks I am looking at do not have a Boot sector or even a
FAT. Files (?) appear to be stored in fixed sectors. ie FileA
in Tracks(Cylinders?) 1 and 2, FileB in 3 and 4 etc. I did say
it was not DOS!

Are there any other 3rd party tools related to what I wish to do
that you think are worth investigating?
Sorry about the partition table. I forgot you are looking for floppy tools. Well, the only way I know to get this going is either at boot time or thru a VxD where you force the sector size to whatever you want. If the FAT has been already allocated with 512 bytes /sector then executing this VxD will cause data error on the floppy. Either you will have to write your own format tool which will set the sector size to your choice and later execute the VxD to read/write the contents from the floppy.
froggerAuthor Commented:
That is my problem. I know I need to change the sector size but I do not know how I am supposed to do it. non of the examples in the DDK do such a thing (or not that I noticed). What I was hoping I could do was this.
1) Change sector size to 256 bytes and number of sectors to 14.
2) use DeviceIoControl and CreateFile to do the equivalent of an int 25h and int 26h call (on 95 it is done through VWIN32.VXD)
3) Change the sector size back to the original value.
The MasterCommented:
I have absolutely no idea if this will help you or not, so if not please forgive my intrusion...but I once wrote a program to read macintosh disks on a pc.  I forget how I did it, and it may be moot because a mac disk may be 512 bytes/sector.  But if they're not, I can go back and look at how I did it for you.
froggerAuthor Commented:
any help that you could give would be greatly appreciated!
The MasterCommented:
Well, sorry.  It seems that the mac sector sizes must have been 512 bytes.  I went back and looked at my old code, and it was calling a routine defined in bios.h as _bios_disk().  Neither the header file nor the function exist anymore (at least in VC5), but I'm sure that function was reading normal sectors.

Sorry, and good luck!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.