Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

problem with formatting proprietry floppy disk format

9 views
Skip to first unread message

who

unread,
Dec 29, 2003, 9:34:35 PM12/29/03
to
Hi,

I'm trying to format a floppy disk using biosdisk. The disk format is for
the Ensoniq EPS keyboard (irrelevant, but helps to have an idea of what I'm
trying to do). I have setup all the sector information code, which looks
fine when I write it to a binary image file. However, when I use biosdisk to
write the disk sectors directly, it doesn't work (I mean that it actually
writes something to the disk, although neither DOS or the keyboard can read
it). Note, my program will only work if the floppy disk is already formatted
with the EPS format - sort of like a quick format - if I format the floppy
in the keyboard, then reformat it on the pc using my program it will update
certain sectors which I can verify are correct. What am I doing wrong? Here
is an example of the code, condensed and modified for readability only

int iDrive = 0; // floppy drive
int iResult;
int i;
unsigned char pacSectorData[512];

iResult = biosdisk(0, iDrive, 0, 0, 0, 0, pacSectorData);

// 80 tracks: 0 - 79
for (iTrack = 0; iTrack < 80; iTrack++)
{
// 2 heads: 0 - 1
for (iHead = 0; iHead < 2; iHead++)
{
// 10 sectors: 0 - 9
for (iSector = 0; iSector < 10; iSector++)
{
// if/else to fill the pacSectorDatabuffer with sector data
here...
// ...

// Write the sector
iResult = BiosDisk(3,
iDrive,
iHead,
iTrack,
iSector,
1,
pacSectorData);

// Check error here...

}
}
}

// Retract the head
BiosDisk(2, iDrive, 0, 0, 1, 1, pacSectorData);

Regards,

M


alex

unread,
Jan 1, 2004, 11:25:30 PM1/1/04
to

"who" <som...@somewhere.com> wrote in message
news:%u5Ib.69657$aT.3...@news-server.bigpond.net.au...

> Hi,
>
> I'm trying to format a floppy disk using biosdisk. The disk format is for
> the Ensoniq EPS keyboard (irrelevant, but helps to have an idea of what
I'm
> trying to do). I have setup all the sector information code, which looks
> fine when I write it to a binary image file. However, when I use biosdisk
to
> write the disk sectors directly, it doesn't work (I mean that it actually
> writes something to the disk, although neither DOS or the keyboard can
read
> it).

DOS checks certain parametres inside whats called the BPB block. It is a
table
that resides within the first sector of the disk, at a certain offset within
the
bootstrap code itself. The "Media type" entry is checked first along with
other parametres to make sure the disk is conforming to FAT12 standard.
If one of the parametres is wrong/illegal. It wont recognise the disk.

>Note, my program will only work if the floppy disk is already formatted
> with the EPS format - sort of like a quick format

With its own filesystem I imagine.. What filesystem is used by this piece of
hardware? IS it FAT12 on a non standard formatted floppy? Or some other
proprietry filesystem on a non standard formatted floppy? if you're not
sure,
you'll need to find out, so you know how to interpret the data from the
disk.

- if I format the floppy
> in the keyboard, then reformat it on the pc using my program it will
update
> certain sectors which I can verify are correct. What am I doing wrong?
Here
> is an example of the code, condensed and modified for readability only
>
> int iDrive = 0; // floppy drive
> int iResult;
> int i;
> unsigned char pacSectorData[512];
>
> iResult = biosdisk(0, iDrive, 0, 0, 0, 0, pacSectorData);
>

**** i'd use char *pacSectorData to declare the buffer, then
pacSectorData=malloc(512); to allocate a buffer. final parameter of biosdisk
is expected to be a 16:16 (seg:off) address pointer. not sure if the
compiler will do this automatically for you.. but I would use
&pacSectorData as your final parameter if u want to do it that way
(correct me if i am wrong)

> // 80 tracks: 0 - 79
> for (iTrack = 0; iTrack < 80; iTrack++)
> {
> // 2 heads: 0 - 1
> for (iHead = 0; iHead < 2; iHead++)
> {
> // 10 sectors: 0 - 9
> for (iSector = 0; iSector < 10; iSector++)
> {

**** Cannot use sector 0 in biosdisk() call. start at 1

0 new messages