non-DOS Floppy Disk format

Posted on 1997-05-19
Medium Priority
Last Modified: 2013-11-19
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.
Question by:frogger
  • 4
  • 3
  • 2

Accepted Solution

mbhakta earned 200 total points
ID: 1301652
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.

Author Comment

ID: 1301653
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?

Expert Comment

ID: 1301654
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.

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.


Author Comment

ID: 1301655
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?

Expert Comment

ID: 1301656
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.

Author Comment

ID: 1301657
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.

Expert Comment

by:The Master
ID: 1301658
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.

Author Comment

ID: 1301659
any help that you could give would be greatly appreciated!

Expert Comment

by:The Master
ID: 1301660
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!

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month14 days, 17 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question