From 021b1e61da72a756bc8f87b139948c264ab03d85 Mon Sep 17 00:00:00 2001 From: phk Date: Mon, 8 May 1995 02:08:33 +0000 Subject: Recognize slice type #6 as dos handle OnTrack Disk manager correctly. --- lib/libdisk/chunk.c | 6 +++--- lib/libdisk/disk.c | 11 ++++++++--- lib/libdisk/libdisk.h | 6 +++--- lib/libdisk/write_disk.c | 17 ++++++++++++++--- 4 files changed, 28 insertions(+), 12 deletions(-) (limited to 'lib/libdisk') diff --git a/lib/libdisk/chunk.c b/lib/libdisk/chunk.c index 77bcc00..54630be 100644 --- a/lib/libdisk/chunk.c +++ b/lib/libdisk/chunk.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: chunk.c,v 1.9 1995/05/07 01:25:22 jkh Exp $ + * $Id: chunk.c,v 1.10 1995/05/07 01:28:16 jkh Exp $ * */ @@ -173,7 +173,7 @@ Insert_Chunk(struct chunk *c2, u_long offset, u_long size, char *name, chunk_e t } int -Add_Chunk(struct disk *d, u_long offset, u_long size, char *name, chunk_e type, +Add_Chunk(struct disk *d, long offset, u_long size, char *name, chunk_e type, int subtype, u_long flags) { struct chunk *c1,*c2,ct; @@ -264,7 +264,7 @@ Print_Chunk(struct chunk *c1,int offset) for(;i'); for(;i<10;i++) putchar(' '); - printf("%p %8lu %8lu %8lu %-8s %-8s 0x%02x ", + printf("%p %8ld %8lu %8lu %-8s %-8s 0x%02x ", c1, c1->offset, c1->size, c1->end, c1->name, chunk_n[c1->type],c1->subtype); if (c1->flags & CHUNK_ALIGN) putchar('='); diff --git a/lib/libdisk/disk.c b/lib/libdisk/disk.c index 1912fdc..f38a99f 100644 --- a/lib/libdisk/disk.c +++ b/lib/libdisk/disk.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: disk.c,v 1.16 1995/05/04 07:00:54 phk Exp $ + * $Id: disk.c,v 1.17 1995/05/06 03:28:29 phk Exp $ * */ @@ -53,6 +53,7 @@ Int_Open_Disk(char *name, u_long size) struct disk *d; struct dos_partition *dp; void *p; + u_long offset = 0; strcpy(device,"/dev/r"); strcat(device,name); @@ -94,8 +95,10 @@ Int_Open_Disk(char *name, u_long size) if (dp->dp_start+dp->dp_size >= size) continue; if (!dp->dp_size) continue; - if (dp->dp_typ == DOSPTYP_ONTRACK) + if (dp->dp_typ == DOSPTYP_ONTRACK) { d->flags |= DISK_ON_TRACK; + offset = 63; + } } free(p); @@ -109,7 +112,7 @@ Int_Open_Disk(char *name, u_long size) if (dl.d_ntracks && dl.d_nsectors) d->bios_cyl = size/(dl.d_ntracks*dl.d_nsectors); - if (Add_Chunk(d, 0, size, name,whole,0,0)) + if (Add_Chunk(d, -offset, size, name,whole,0,0)) warn("Failed to add 'whole' chunk"); for(i=BASE_SLICE;id_partitions[j].p_size = c2->size; dl->d_partitions[j].p_offset = c2->offset; dl->d_partitions[j].p_fstype = c2->subtype; - } dl->d_bbsize = BBSIZE; @@ -84,6 +83,10 @@ Write_FreeBSD(int fd, struct disk *new, struct disk *old, struct chunk *c1) dl->d_partitions[RAW_PART].p_size = c1->size; dl->d_partitions[RAW_PART].p_offset = c1->offset; + if(new->flags & DISK_ON_TRACK) + for(i=0;id_partitions[i].p_size) + dl->d_partitions[i].p_offset += 63; dl->d_magic = DISKMAGIC; dl->d_magic2 = DISKMAGIC; dl->d_checksum = dkcksum(dl); @@ -189,9 +192,17 @@ Write_Disk(struct disk *d1) else dp[j].dp_flag = 0; } - for(i=0;ibootmgr) -- cgit v1.1