|
Lines 132-138
Link Here
|
| 132 |
static int bd_opendisk(struct open_disk **odp, struct i386_devdesc *dev); |
132 |
static int bd_opendisk(struct open_disk **odp, struct i386_devdesc *dev); |
| 133 |
static void bd_closedisk(struct open_disk *od); |
133 |
static void bd_closedisk(struct open_disk *od); |
| 134 |
static int bd_bestslice(struct open_disk *od); |
134 |
static int bd_bestslice(struct open_disk *od); |
| 135 |
static void bd_checkextended(struct open_disk *od, int slicenum); |
135 |
static void bd_checkextended(struct open_disk *od, int slicenum, int basenum); |
| 136 |
|
136 |
|
| 137 |
/* |
137 |
/* |
| 138 |
* Translate between BIOS device numbers and our private unit numbers. |
138 |
* Translate between BIOS device numbers and our private unit numbers. |
|
Lines 512-518
Link Here
|
| 512 |
sizeof(struct dos_partition) * NDOSPART); |
512 |
sizeof(struct dos_partition) * NDOSPART); |
| 513 |
od->od_nslices = 4; /* extended slices start here */ |
513 |
od->od_nslices = 4; /* extended slices start here */ |
| 514 |
for (i = 0; i < NDOSPART; i++) |
514 |
for (i = 0; i < NDOSPART; i++) |
| 515 |
bd_checkextended(od, i); |
515 |
bd_checkextended(od, i, i); |
| 516 |
od->od_flags |= BD_PARTTABOK; |
516 |
od->od_flags |= BD_PARTTABOK; |
| 517 |
dptr = &od->od_slicetab[0]; |
517 |
dptr = &od->od_slicetab[0]; |
| 518 |
|
518 |
|
|
Lines 624-635
Link Here
|
| 624 |
} |
624 |
} |
| 625 |
|
625 |
|
| 626 |
static void |
626 |
static void |
| 627 |
bd_checkextended(struct open_disk *od, int slicenum) |
627 |
bd_checkextended(struct open_disk *od, int slicenum, int basenum) |
| 628 |
{ |
628 |
{ |
| 629 |
char buf[BIOSDISK_SECSIZE]; |
629 |
char buf[BIOSDISK_SECSIZE]; |
| 630 |
struct dos_partition *dp; |
630 |
struct dos_partition *dp; |
| 631 |
u_int base; |
631 |
u_int base; |
| 632 |
int i, start, end; |
632 |
int i, start; |
| 633 |
|
633 |
|
| 634 |
dp = &od->od_slicetab[slicenum]; |
634 |
dp = &od->od_slicetab[slicenum]; |
| 635 |
start = od->od_nslices; |
635 |
start = od->od_nslices; |
|
Lines 651-667
Link Here
|
| 651 |
continue; |
651 |
continue; |
| 652 |
if (od->od_nslices == MAX_SLICES) |
652 |
if (od->od_nslices == MAX_SLICES) |
| 653 |
goto done; |
653 |
goto done; |
| 654 |
dp->dp_start += base; |
654 |
if (dp->dp_typ == DOSPTYP_EXT) { |
| 655 |
bcopy(dp, &od->od_slicetab[od->od_nslices], sizeof(*dp)); |
655 |
dp->dp_start += od->od_slicetab[basenum].dp_start;; |
| 656 |
od->od_nslices++; |
656 |
bcopy(dp, &od->od_slicetab[od->od_nslices], sizeof(*dp)); |
|
|
657 |
} else { |
| 658 |
dp->dp_start += base; |
| 659 |
bcopy(dp, &od->od_slicetab[od->od_nslices], sizeof(*dp)); |
| 660 |
od->od_nslices++; |
| 661 |
} |
| 657 |
} |
662 |
} |
| 658 |
end = od->od_nslices; |
|
|
| 659 |
|
663 |
|
| 660 |
/* |
664 |
/* |
| 661 |
* now, recursively check the slices we just added |
665 |
* now, recursively check the slices we just added |
| 662 |
*/ |
666 |
*/ |
| 663 |
for (i = start; i < end; i++) |
667 |
for (i = start; i < start + NDOSPART; i++) |
| 664 |
bd_checkextended(od, i); |
668 |
bd_checkextended(od, i, basenum); |
| 665 |
done: |
669 |
done: |
| 666 |
return; |
670 |
return; |
| 667 |
} |
671 |
} |