[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference 7.286::atarist

Title:Atari ST, TT, & Falcon
Notice:Please read note 1.0 and its replies before posting!
Moderator:FUNYET::ANDERSON
Created:Mon Apr 04 1988
Last Modified:Tue May 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1433
Total number of notes:10312

516.0. "C/xbios format problem" by AYOV27::FAMIS_DEVSYS () Thu Jun 22 1989 07:22

Hi, can anyone help me regarding the use of an xbios call.

I am trying to write a 'FAT' format program in C (Laser), the format
part of the program (I'm trying 10 sectors 81 tracks) works fine. 
My problem arises when I try to create the boot block. I make a call
to Protobt(buf,serialno,disktype,execflag) where

disktype 0 - single sided 180K 40 tracks
         1 - double  "    360K  "  "
         2 - single  "    360K 80  "
         3 - double  "    720K 80  "

I need to know what disktype to use (it's obviously none of the above,
how much should I expect from 10 sectors 81 tracks ?).

The macro for Protobt in osbind.h is...

	xbios(18,buf,serialno,disktype,execflag)

Sooo if anyone knows what disktype I need to specify (and how they know!)
please shout......

			Thanks in advance,

				Andrew
T.RTitleUserPersonal
Name
DateLines
516.1You might have to roll your own boot block.5319::LOMICKAJJeff LomickaThu Jun 22 1989 11:253
I think you'll have to foramt your own boot block.  Do you have the
format?  You can loot it up in any MSDOS documentation.

516.2Oh wellAYOV27::FAMIS_DEVSYSThu Jun 22 1989 12:216
    Jeff, thanks for the reply - I have no idea how to format my own
    boot block or access to documentation, I seem to recall seeing a
    book 'Atari ST disk drive internals' or something like that. Looks
    like I'll have to buy it!!, thanks anyway...
    
    		Andrew
516.3BOOTBLOCK Program hereCALYPS::SHARPETue Jul 04 1989 16:4663
    Andrew, here is a program that I use to format floppy's on my ST.  I
    lifted most of the code from on of the START magazines if I remember
    correctly.  It has the BOOTBLOCK info you want in it.  Have Fun!
    
    Mike Sharpe
/*
	Program to format a floppy disk with a disk name
*/
#include <osbind.h>
#include <stdio.h>

main()
{
	static char buf[20000];
	int i;
	long l;

	for (i=0; i<81; i++) {
		printf("\rFormat track %02d", i); fflush(stdout);
		if (Flopfmt(buf, 0L, 1, 10, i, 0, 1, 0x87654321L, 0xe5e5))
			printf("  Error on track %02d", i);
		if (Flopfmt(buf, 0L, 1, 10, i, 1, 1, 0x87654321L, 0xe5e5))
			printf("  Error on track %02d", i);

	}
	for (i=0; i<10*512; i++)
		buf[i] = 0;
	puts("Zero track 0 & 1");
	Flopwr(buf, 0L, 1, 1, 0, 0, 10);
	Flopwr(buf, 0L, 1, 1, 0, 1, 10);
	Flopwr(buf, 0L, 1, 1, 1, 0, 10);
	Flopwr(buf, 0L, 1, 1, 1, 1, 10);

	puts("Build prototype boot block");
	Protobt(buf, 0x01000000L, 3, 0);
	/* buf[X] = Y where X and Y are DECIMAL EQUIVELENTS of HEX VALUES */
	/* now change the number of sectors */
	buf[19] = 64;
	buf[20] = 06;
	/* now change the sectors per track entry.  (10 not 9) */
	buf[24] = 10;

	puts("Write it to disk");
	Flopwr(buf, 0L, 1, 1, 0, 0, 1);

	/* buf[X] = Y where X and Y are DECIMAL EQUIVELENTS of HEX VALUES */

	/* begin entering the disk name here */

	/* put zeros into floppy buffer here */
	for (i=0; i<10*512; i++)
			buf[i] = 0;
	printf("Enter Disk Name here: ");
	/* input disk name here */
	scanf("%s", buf);
	/* put end of disk name byte in buffer here */
	buf[11] = 08;
	Flopwr(buf, 0L, 1, 2, 0, 1, 1);

	/* end disk name entry here */

}