fdisk.c (25378) | fdisk.c (26389) |
---|---|
1/* 2 * Mach Operating System 3 * Copyright (c) 1992 Carnegie Mellon University 4 * All Rights Reserved. 5 * 6 * Permission to use, copy, modify and distribute this software and its 7 * documentation is hereby granted, provided that both the copyright 8 * notice and this permission notice appear in all copies of the --- 415 unchanged lines hidden (view full) --- 424 print_part(which); 425} 426 427static struct dos_partition mtpart = { 0 }; 428 429static void 430print_part(int i) 431{ | 1/* 2 * Mach Operating System 3 * Copyright (c) 1992 Carnegie Mellon University 4 * All Rights Reserved. 5 * 6 * Permission to use, copy, modify and distribute this software and its 7 * documentation is hereby granted, provided that both the copyright 8 * notice and this permission notice appear in all copies of the --- 415 unchanged lines hidden (view full) --- 424 print_part(which); 425} 426 427static struct dos_partition mtpart = { 0 }; 428 429static void 430print_part(int i) 431{ |
432struct dos_partition *partp = ((struct dos_partition *) &mboot.parts) + i; | 432 struct dos_partition *partp; 433 u_int64_t part_mb; |
433 | 434 |
435 partp = ((struct dos_partition *) &mboot.parts) + i; |
|
434 435 if (!bcmp(partp, &mtpart, sizeof (struct dos_partition))) { 436 printf("<UNUSED>\n"); 437 return; 438 } | 436 437 if (!bcmp(partp, &mtpart, sizeof (struct dos_partition))) { 438 printf("<UNUSED>\n"); 439 return; 440 } |
441 /* 442 * Be careful not to overflow. 443 */ 444 part_mb = partp->dp_size; 445 part_mb *= secsize; 446 part_mb /= (1024 * 1024); |
|
439 printf("sysid %d,(%s)\n", partp->dp_typ, get_type(partp->dp_typ)); | 447 printf("sysid %d,(%s)\n", partp->dp_typ, get_type(partp->dp_typ)); |
440 printf(" start %ld, size %ld (%ld Meg), flag %x\n", | 448 printf(" start %ld, size %ld (%qd Meg), flag %x\n", |
441 partp->dp_start, | 449 partp->dp_start, |
442 partp->dp_size, partp->dp_size * secsize / (1024 * 1024), | 450 partp->dp_size, 451 part_mb, |
443 partp->dp_flag); 444 printf("\tbeg: cyl %d/ sector %d/ head %d;\n\tend: cyl %d/ sector %d/ head %d\n" 445 ,DPCYL(partp->dp_scyl, partp->dp_ssect) 446 ,DPSECT(partp->dp_ssect) 447 ,partp->dp_shd 448 ,DPCYL(partp->dp_ecyl, partp->dp_esect) 449 ,DPSECT(partp->dp_esect) 450 ,partp->dp_ehd); --- 867 unchanged lines hidden --- | 452 partp->dp_flag); 453 printf("\tbeg: cyl %d/ sector %d/ head %d;\n\tend: cyl %d/ sector %d/ head %d\n" 454 ,DPCYL(partp->dp_scyl, partp->dp_ssect) 455 ,DPSECT(partp->dp_ssect) 456 ,partp->dp_shd 457 ,DPCYL(partp->dp_ecyl, partp->dp_esect) 458 ,DPSECT(partp->dp_esect) 459 ,partp->dp_ehd); --- 867 unchanged lines hidden --- |