Solved

non-DOS Floppy Disk format

Posted on 1997-05-19
9
282 Views
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.
0
Comment
Question by:frogger
  • 4
  • 3
  • 2
9 Comments
 
LVL 4

Accepted Solution

by:
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.
0
 

Author Comment

by:frogger
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?
0
 
LVL 4

Expert Comment

by:mbhakta
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.
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:frogger
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?
0
 
LVL 4

Expert Comment

by:mbhakta
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.
0
 

Author Comment

by:frogger
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.
0
 
LVL 2

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.
0
 

Author Comment

by:frogger
ID: 1301659
Master,
any help that you could give would be greatly appreciated!
0
 
LVL 2

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!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

829 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