home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************/
- /* Program: DRIVETBL */
- /* Author: Greg Thielen, Innovative Systems Design */
- /* Date written: October 4, 1990 */
- /* Compiler: Microsoft C 6.0 */
- /* Description: Display Fixed Disk Drive Table. */
- /****************************************************************************/
-
- #pragma pack(1)
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <dos.h>
-
- char *version = "DRIVETBL Version 1.00";
- char *copyright = "(C) Copyright Innovative Systems Design, 1990";
-
- void tbl_detail(int, struct DRIVE_TBL _far *);
-
- struct DRIVE_TBL {
- int cyl;
- char heads;
- int rsv1;
- int precomp;
- char rsv2;
- char cntrl;
- char rsv3;
- char rsv4;
- char rsv5;
- int land;
- char sect;
- char rsv6;
- };
-
- main()
- {
- int x;
- struct DRIVE_TBL _far *ptr;
-
- printf(" Number of Number Number Write Landing Number Formatted\n");
- printf("Type Cylinders of Heads Precompensation Zone of Sectors Capacity\n");
-
- printf("\n------------------------- Installed Drive Types --------------------------\n");
- ptr = (struct DRIVE_TBL _far *) _dos_getvect(0x41);
- tbl_detail(0, ptr);
-
- ptr = (struct DRIVE_TBL _far *) _dos_getvect(0x46);
- tbl_detail(1, ptr);
-
- FP_SEG(ptr) = 0xE000; /* Segment and offset to drive table entry 1 */
- FP_OFF(ptr) = 0x025D;
-
- printf("\n-------------------------- Drive Table Entries ---------------------------\n");
- for (x = 1; x < 34; x++)
- {
- tbl_detail(x, ptr++);
- }
-
- exit(0);
- }
-
- void tbl_detail(int x, struct DRIVE_TBL _far *ptr)
- {
- long fmtcap;
-
- fmtcap = (long) (ptr->heads * ptr->cyl) * (long) (ptr->sect * 512) / 1000000L;
- printf(" %3i %5i %3i %5i %5i %3i %5liM\n",
- x, ptr->cyl, ptr->heads, ptr->precomp, ptr->land, ptr->sect, fmtcap);
- return;
- }
-