Jump to content
IGNORED

FORMATting with SIO


Recommended Posts

Hiya, I remember trying to format a disk from a small self-booting machine-code program using SIO, but although my program would set the correct code for single-density (720 128-byte sectors) formatting (code 33 or 21h), when i put in the code (for loc. 770 - DCOMND) for double-density (1040 128-byte sectors, (true medium-density)) the disk would not format, I can't remember what operation code I used as I can't seem to find it anywhere, but whatever I used was obviously wrong.

Does anyone have this op. code they can tell me, oh, & any 'true double-density (720 256-byte sectors) op. codes I might need, incl. the true DD format op. code,

Thankyou very much to all that can help me.

Link to comment
Share on other sites

$22 is 'format medium' (130k).

 

$21 is 'format single' on 810 and 1050, but for the remaining majority of drives, this is 'format default', i.e. the disk will format to the current density. If the current density is SD, it will format to SD, if DD, it will be DD.

 

You can select densities with $4F 'write PERCOM block' command. The PERCOM block is 12 bytes describing the density, its description is f.e. here http://www.atarimagazines.com/compute/issue65/insight_atari.php

 

The procedure is:

 

1) $53 get status to see if the drive is there

 

2) if single or double, do $4F send percom to determine density

 

3) if medium, do $22 format medium

 

4) if single or double, do $21 format disk.

 

The tricky part is that drives often accept PERCOM blocks for densities they can't realize. For example, Top Drive 1050 accepts 80 tracks. So, a good formatter should, after step 2) above, retrieve the PERCOM block back (using $4E), calculate the real number of sectors out of both, and compare. Then only if they match, proceed with formatting.

Edited by drac030
  • Like 1
Link to comment
Share on other sites

If you use SIO to format with all you get is a blank disk, if you want to actually write files or data to the disk afterwards, you'll have to use XIO 254 command with the CIO instead of the SIO. _OR_ supply the boot and VTOC sectors yourself afterwards just like DOS'es XIO 254 does it.

 

MyDOS has a real problem allowing disk density changes during format using XIO 254, doing it from the DUP.SYS menu it's not a problem at all, but it won't often work using XIO from BASIC or stand alone M/L programs. You may have some luck doing Enhanced density with AUX1 set to one and AUX2 set to zero as the tech.doc descrbes over at Mathy's MyDOS page, but no guarantees - this bug is pure evil. Doing a density change format to SD or DD is a lost cause unless you first change the drive's table entries to reflect those values in two places within DOS code - it can be done. If you need those locations, ask and I'll dig up the info for you.

Link to comment
Share on other sites

  • 2 weeks later...

Many thanks all, $22 was the main value I was looking for although the true double-density value & method will come in handy.

Just out of curiosity, the reason I wrote a formatting program was because I was trying to maximise the room on a typical disk; for single-density disks non-dos then you can format it medium-density, then copy your single-density program onto this medium-density disk, and you'll have 320 128-byte sectors from 721-1040 for more storage, ofcourse one can only boot a program of which starts on sector 721 using a start-sector selection boot program (alas, something I have programmed). You can also do exactly the same with DOS disks, format a disk medium-density, & use a sector copier to transfer all 720 sectors from the single-density DOS-disk making sure you copy all of the special FMS sectors in the process, ofcourse, one would think all that needs doing is to use medium-density FORMATted DOS disks, but many items of software specifically requires a single-density format and won't work in medium-density. This way you can have 720 sectors of your disk using DOS FMS, and the final 320 sectors non-file system space, where you can put a single-boot file, obviously only bootable using the start-sector select booter program.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...