diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 1995-05-01 04:05:27 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 1995-05-01 04:05:27 +0000 |
| commit | 20c9844ca086de197a688babdd6d24a1e040c3d2 (patch) | |
| tree | c46a25276d72afe90b217d8e55e20c80503b4c84 /lib/libdisk/write_disk.c | |
| parent | ee1cbe818ee354bed5175859a9fcbbf002040312 (diff) | |
Notes
Diffstat (limited to 'lib/libdisk/write_disk.c')
| -rw-r--r-- | lib/libdisk/write_disk.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/lib/libdisk/write_disk.c b/lib/libdisk/write_disk.c index c97727c8cad5..818076a3ca9e 100644 --- a/lib/libdisk/write_disk.c +++ b/lib/libdisk/write_disk.c @@ -151,7 +151,6 @@ Write_Disk(struct disk *d1) dp[j].dp_ssect = 0xff; dp[j].dp_shd = 0xff; dp[j].dp_scyl = 0xff; - } else { dp[j].dp_ssect = i % d1->bios_sect; i -= dp[j].dp_ssect++; @@ -163,26 +162,22 @@ Write_Disk(struct disk *d1) i -= dp[j].dp_scyl; dp[j].dp_ssect |= i >> 2; } + printf("S:%lu = (%x/%x/%x)", c1->offset,dp[j].dp_scyl,dp[j].dp_shd,dp[j].dp_ssect); i = c1->end; - if (i >= 1024*d1->bios_sect*d1->bios_hd) { - dp[j].dp_esect = 0xff; - dp[j].dp_ehd = 0xff; - dp[j].dp_ecyl = 0xff; - } else { - dp[j].dp_esect = i % d1->bios_sect; - i -= dp[j].dp_esect++; - i /= d1->bios_sect; - dp[j].dp_ehd = i % d1->bios_hd; - i -= dp[j].dp_ehd; - i /= d1->bios_hd; - dp[j].dp_ecyl = i; - i -= dp[j].dp_ecyl; - dp[j].dp_esect |= i >> 2; - - } + dp[j].dp_esect = i % d1->bios_sect; + i -= dp[j].dp_esect++; + i /= d1->bios_sect; + dp[j].dp_ehd = i % d1->bios_hd; + i -= dp[j].dp_ehd; + i /= d1->bios_hd; + if (i>1023) i = 1023; + dp[j].dp_ecyl = i; + i -= dp[j].dp_ecyl; + dp[j].dp_esect |= i >> 2; + printf(" E:%lu = (%x/%x/%x)\n", c1->end,dp[j].dp_ecyl,dp[j].dp_ehd,dp[j].dp_esect); |
