Author Topic: FDC floppy t80ds detection  (Read 2800 times)

0 Members and 1 Guest are viewing this topic.

Offline freemac

  • CPC6128
  • ****
  • Posts: 178
  • Country: 00
  • Liked: 152
FDC floppy t80ds detection
« on: 13:59, 14 September 15 »


I'm currently refactoring my FDC instruction set (CoreAmstrad/MiST-board), and I have some littles questions :  ::)
* for detecting a double sided 80 track data dsk, I have just to do a cat ? I currently succeed that with PARADOS only...
* then what can I do to validate drive |B ? (as PARADOS does manage only drive |A with multiple dsk format...)
* A read-ID called several times quickly does give sector ID in order ? EndOfCylinder flag is usefull ?
* MT (multi track) option does change track as listed in dsk format : track 0 side 0, track 0 side 1, track 1 side 0, ... ?
* MT (multi track) option does apply only on READ_ID command ?
* To detect a double sided disk, what have I to implement : Head (with US0 US1), H of CHRN or TS (two side (zero seem YES)) ?


And somes more, about protection disk : :D
* ST0 and ST1 in dsk format are valid both for READ_ID and READ_DATA commands ?
* And not existing Track returns a certain CHRN value ?
* Command reading DELETED TRACK does effect as reading DATA TRACK ? (it seems not having difference in dsk file format definition)
« Last Edit: 15:04, 14 September 15 by freemac »

Online arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.112
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 1952
Re: FDC floppy t80ds detection
« Reply #1 on: 16:01, 14 September 15 »
For FDC read the documentation ;)

http://www.classiccmp.org/dunfield/r/765.pdf

Read about the IBM system 34 disc format, the structure of the mfm data ;)

This tells you about end of cylinder, and multi track.

For detecting double sided: Why? The dsk format describes if disc is double sided or not.
If you need to use fdc there is no conclusive method. You could try the "two side" state of st3, you can read an id on both sides (no id on side 2 could mean it's single sided, but also that the track you tested is not formatted on side 2), you could read a sector on both sides and compare the data.

For drive B, you can check if it becomes ready or not when motor is on (but same if no disc in the drive). For 3" drives there is a special combination of st3 that means no drive (CPM uses this), but not true for 3.5" drives.

Multiple read ids do give the ids in order, but doesn't start on first id of track. End of cylinder is not used here.
How can you know the number and start? You could see if they repeat. Or you could do a read sector on an id that doesn't exist in the track to sync to the index, then do read ids, but they you don't know the number. Use read track with a large number to read some of the mfm data and interpret it.

st0/st1 in dsk is used for read data/read deleted data. the data error in id field is valid for read_id.
not existing track sometimes returns the same value, best to try and read id and look for an error (missing address mark).

read data and read deleted data: read the pdf. It describes it.

EDIT: Best way. Test on real hardware!
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline freemac

  • CPC6128
  • ****
  • Posts: 178
  • Country: 00
  • Liked: 152
Re: FDC floppy t80ds detection
« Reply #2 on: 17:47, 14 September 15 »

For detecting double sided: Why? The dsk format describes if disc is double sided or not.
I think I'll try something like
Quote
|DIRDOS,"A0"
|DIRDOS,"A1"


Thanks a lot  8)

Offline freemac

  • CPC6128
  • ****
  • Posts: 178
  • Country: 00
  • Liked: 152
Re: FDC floppy t80ds detection
« Reply #3 on: 10:24, 15 September 15 »


I did some tests and found my own test-bench about testing double-side/80track disks (currently failing in my project CoreAmstrad r004.2)

I do use ROMDOS rdosxl48.rom in x06, and PROTEXT in x01

I tested several disks :
* 80tds (DATA, 80 tracks double sided) do not display 750KB during a CAT but works everywhere (it is a standard running in original Amstrad ROMs, cat does list 40tss, but running a file using certain code you access 80tds fully)
* DOS D2 : does run in |B
* IBM 80tds : does run in |B
* simple 40tss : does run in |A and |B

ROMDOS is really cool

My test-bench is :
* do insert 40tss in |A, IBM 80tds in |B
* do run PROTEXT : |cp
* Write a file.txt (ESC, write, ESC), and save it on |A [/size](s file.txt)
* reset
* load file.txt in PROTEXT (l file.txt)
* B (equals |B command but in PROTEXT console)
* cat
* s file.txt
* reset
* |B
* |cp
* l file.txt
* FAIL in CoreAmstrad r004.2
I'll retry this test-bench after my next evolve.

Offline freemac

  • CPC6128
  • ****
  • Posts: 178
  • Country: 00
  • Liked: 152
Re: FDC floppy t80ds detection
« Reply #4 on: 11:44, 21 September 15 »

ROMDOS test passed using DOS D2 dsk in |B (t80ds (750KB)) in CoreAmstrad r004.3 8)
- HD is physical head, H is logical head, I turn TS (two sides) into 1 with a dsk is double-sided (not certain)
- I do increment readID SectorID, using MultiTrack when enabled.
- I now read ST1 and ST2 coming from dsk file format, and apply them when I'm not in a "wait state".
- I remark that ROMDOS does make 4KB files when saving a little .bas file instead of 1KB (with original Amstrad ROM), that's correct with DOS D2, but it is strange with simple t40ss DATA dsk.
- IBM dsk has problems using ROMDOS, they cat as t80ds (750KB), but does write simple .bas file in 2KB, so one file on two does run fine only (the others does display "Line Too Long" message), perhaps ROMDOS does not support my IBM dsk.
- FutureOS does now detect somes dsk format but does not list file content at each times...


I found a protected dsk called "Macadam ERE", it has a missing track (a track of size zero), what flag shall have to enable in this case ? and what shall I return as CHRN in command part ? What about sector not found ?


Using MultiTrack enabled, and specially a End of Track (final sector number (not id ?)), how does it works ? Have I to expect a command same relaunch for each sector of the set wanted ?
« Last Edit: 14:58, 21 September 15 by freemac »

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 10.103
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1967
Re: FDC floppy t80ds detection
« Reply #5 on: 19:42, 21 September 15 »
- FutureOS does now detect somes dsk format but does not list file content at each times...


Currently it does detect: System, IBM, Data (all 40 Track, single sided) and Vortex (80 tracks, double sided). Which drive (A-H) you use doesn't matter.


Great to see your project advancing.  :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline freemac

  • CPC6128
  • ****
  • Posts: 178
  • Country: 00
  • Liked: 152
Re: FDC floppy t80ds detection
« Reply #6 on: 10:45, 22 September 15 »
Currently it does detect: System, IBM, Data (all 40 Track, single sided) and Vortex (80 tracks, double sided). Which drive (A-H) you use doesn't matter.
Can I have a virgin Vortex (80tds) dsk image ?  ;)

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 10.103
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1967
Re: FDC floppy t80ds detection
« Reply #7 on: 19:18, 23 September 15 »
Can I have a virgin Vortex (80tds) dsk image ?  ;)


Try this please...



TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline freemac

  • CPC6128
  • ****
  • Posts: 178
  • Country: 00
  • Liked: 152
Re: FDC floppy t80ds detection
« Reply #8 on: 13:02, 28 September 15 »


r004.4 commited : using ROMDOS all is fine now  8)


But I still have an empty calatog using FutureOS...
Vortex dsk is detected also, but cat as 154KB and writing a simple file (save "hello"), this last one is not listed in FutureOS catalog  :picard:


Offline freemac

  • CPC6128
  • ****
  • Posts: 178
  • Country: 00
  • Liked: 152
Re: FDC floppy t80ds detection
« Reply #9 on: 11:52, 29 September 15 »

Yeah, I found something around that.
Here a test sequence :
Quote
do not insert dsk
|a
|ucpm
crash (somes drives access instead of nothing)
Result in several FDC command, somes being x08,
x08 does consume sometimes two results, sometimes one result only.
That case was not implemented in my project ^^'




So here some questions :
- what do you know about optionnal FDC command not totaly consumed ?
- what do you know about parallel FDC commands (I think here only seek can be done in same times cross two drives...)