I need DPT values..

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

I need DPT values..

Post by bubach »

Does anyone have the diskette parameter table values for the common floppy disks formats?
Those values should be found at 0x000FEFC7 and contain f.ex. gap lenght etc. The problem is that I don't trust the computers, BOCHS for example always gives me 1.44mb fdd values, even if i configure it with only a 720kb floppy.

/ Christoffer
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
AxelDominatoR

Re:I need DPT values..

Post by AxelDominatoR »

http://www.charmed.com/txt/floppy.txt

Scroll down to a struct named: default_drive_params

The table right there holds most of the informations you seek, I think.

Axel
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:I need DPT values..

Post by bubach »

I had a look and it doesn't seem to contain the same values as the DPT, it would be easier for me to have the exact table values as my code is made in that way.. :(
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
Dex4u

Re:I need DPT values..

Post by Dex4u »

@bubach, do you mean these ?.

Code: Select all

;
; 256 byte sectors (default)
parmtable dw   2a1h,2a1h,2a1h,2a1h   ; Diskette params, see DISKPARAM struc
   db   0,0,0,0
   db   20,20,20,20
   db   81h,81h,81h,81h
   db   80,80,80,80
   dw   2201h,2201h,2201h,2201h
   dw   00028h,00028h,00028h,00028h
   db   0fh,0fh,0fh,0fh
   db   10,10,10,10
;
; 1024 byte sectors
;
parmtable2 dw   2a1h,2a1h,2a1h,2a1h   ; Diskette params, see DISKPARAM struc
   db   0,0,0,0
   db   20,20,20,20
   db   81h,81h,81h,81h
   db   80,80,80,80
   dw   0a03h,0a03h,0a03h,0a03h
   dw   0c48ch,0c48ch,0c48ch,0c48ch
   db   0fh,0fh,0fh,0fh
   db   10,10,10,10

sop = $ - parmtable2
[/code
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:I need DPT values..

Post by bubach »

Nope. But thanks anyway.. If I find it, I'll post it here.
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:I need DPT values..

Post by distantvoices »

Might tehse values be of interrest for you?

From MInix source code, so the minix copyright stuff applies:

Code: Select all

/* Seven combinations of diskette/drive are supported.
 *
 * # Drive  diskette  Sectors  Tracks  Rotation Data-rate  Comment
 * 0  360K    360K      9       40     300 RPM  250 kbps   Standard PC DSDD
 * 1  1.2M    1.2M     15       80     360 RPM  500 kbps   AT disk in AT drive
 * 2  720K    360K      9       40     300 RPM  250 kbps   Quad density PC
 * 3  720K    720K      9       80     300 RPM  250 kbps   Toshiba, et al.
 * 4  1.2M    360K      9       40     360 RPM  300 kbps   PC disk in AT drive
 * 5  1.2M    720K      9       80     360 RPM  300 kbps   Toshiba in AT drive
 * 6  1.44M   1.44M    18   80     300 RPM  500 kbps   PS/2, et al.
 *
 * In addition, 720K diskettes can be read in 1.44MB drives, but that does
 * not need a different set of parameters.  This combination uses
 *
 * X  1.44M   720K   9   80     300 RPM  250 kbps   PS/2, et al.
 */
PRIVATE char gap[NT] =
   {0x2A, 0x1B, 0x2A, 0x2A, 0x23, 0x23, 0x1B}; /* gap size */
PRIVATE char rate[NT] =
   {0x02, 0x00, 0x02, 0x02, 0x01, 0x01, 0x00}; /* 2=250,1=300,0=500 kbps*/
PRIVATE char nr_sectors[NT] =
   {9,    15,   9,    9,    9,    9,    18};   /* sectors/track */
PRIVATE int nr_blocks[NT] =
   {720,  2400, 720,  1440, 720,  1440, 2880}; /* sectors/diskette*/
PRIVATE char steps_per_cyl[NT] =
   {1,    1,    2,    1,    2,    1,     1};   /* 2 = dbl step */
PRIVATE char mtr_setup[NT] =
   {1*HZ/4,3*HZ/4,1*HZ/4,4*HZ/4,3*HZ/4,3*HZ/4,4*HZ/4}; /* in ticks */
PRIVATE char spec1[NT] =
   {0xDF, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF}; /* step rate, etc. */
PRIVATE char test_sector[NT] =
   {4*9,  14,   2*9,  4*9,  2*9,  4*9,  17};   /* to recognize it */

#define b(d)   (1 << (d))   /* bit for density d. */

here is the url to the complete driver:
http://minix1.hampshire.edu/src/kernel/floppy.c
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:I need DPT values..

Post by bubach »

Thanks alot! It seems to be the stuff I wanted (taking a closer look later).

/ Christoffer
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
Post Reply