|
|
1.1 ! root 1: Floppy disk param notes ! 2: ! 3: Current driver ! 4: ! 5: fd_attach_com { ! 6: ! 7: recal, abort if error (do some retries); ! 8: get status (MID, WP, etc.); ! 9: get struct fd_disk_info (fd_format_info.fd_disk_info) via MID; ! 10: for(fd_format_info.density_info.density= 4 to 1) { ! 11: seek to read_id_cyl (should ++); ! 12: if read_id works ! 13: goto found_dens; ! 14: } ! 15: ! 16: found_dens: ! 17: if density = none { ! 18: disk unformatted: ! 19: ! 20: // get defaults for density, sect_size ! 21: density = fd_format_info.fd_disk_info.max_density; ! 22: sect_size = fd_get_sectsize_info(density)[0].sect_size ! 23: set_density_info(density); ! 24: set_sector_size(sect_size); ! 25: return; ! 26: } ! 27: ! 28: mark disk as formatted to allow reading; ! 29: for each legal sect_size for the fd_sectsize_info for this density { ! 30: set_sector_size(sect_size); ! 31: do a retry loop { ! 32: read(test_sector++); ! 33: if good ! 34: goto found_sect_size; ! 35: } ! 36: } ! 37: mark disk unformatted; ! 38: return; ! 39: ! 40: found_sect_size: ! 41: return good; ! 42: ! 43: } ! 44: ! 45: set_density_info(int density) ! 46: { ! 47: // don't have to save sect_size; sectsize_info won't change by the ! 48: // time we need it... ! 49: ! 50: save current sect_size from fd_format_info.sectsize_info.sect_size; ! 51: find fd_density_info for spec'd density, write it to ! 52: fd_format_info.density_info; ! 53: set_sect_size(saved_sect_size); ! 54: if density == none ! 55: mark disk unformatted; ! 56: } ! 57: ! 58: set_sect_size(sect_size) ! 59: { ! 60: validate that this sect_size is legal for current ! 61: fd_format_info.density_info; ! 62: set fd_format_info.sectsize_info; ! 63: set disk formatted; ! 64: } ! 65: ! 66: ......................... ! 67: ! 68: what are all of these weird structs? ! 69: ! 70: fd_disk_info (fd_disk_info_t): fd_extern.h ! 71: maps media_id to tracks_per_cyl and num_cylinders. ! 72: One per media_id in fdDiskInfo[]. ! 73: ! 74: fd_sectsize_info (fd_sectsize_info_t): fd_extern.h ! 75: contains ector size, 82077 sector size codem sects_per_track, gap. ! 76: One of these for each legal density/sectsize combo in ssi_Xmb[]. ! 77: ! 78: fd_density_info (fd_density_info_t) : fd_extern.h ! 79: Maps density to capacity and mfm. ! 80: One per density in fdDensityInfo[]. ! 81: ! 82: fd_format_info (fd_format_info_t, fdFormatInfo_t) : fd_extern.h ! 83: Contains all current info about inserted disk. ! 84: fd_disk_info, fd_density_info, fd_sectsize_info, total_sects, flags. ! 85: Obtained via ioctl(FDIOCGFORM). ! 86: ! 87: fdDensitySectsize_t : FloppyTypes.h ! 88: maps density to an array of legal fd_sectsize_info's. ! 89: One per legal density in fdDensitySectsize[]. ! 90: ! 91: fdDriveInfo_t : FloppyPublic.h ! 92: drive_info (for ioctl(DKIOCGINFO)), seek, settle, unload time. ! 93: One per drive type (only one) in fdDriveInfo[]. ! 94:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.