Link to home
Start Free TrialLog in
Avatar of frogger
frogger

asked on

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.
ASKER CERTIFIED SOLUTION
Avatar of mbhakta
mbhakta

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of frogger
frogger

ASKER

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.
Avatar of frogger

ASKER

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.
Avatar of frogger

ASKER

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.
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.
Avatar of frogger

ASKER

Master,
any help that you could give would be greatly appreciated!
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!