2 * Copyright (C) Andreas Neuper, Sep 1998.
4 * Licensed under GPLv2, see file LICENSE in this tarball for details.
7 #if ENABLE_FEATURE_SGI_LABEL
11 #define SGI_VOLHDR 0x00
12 /* 1 and 2 were used for drive types no longer supported by SGI */
14 /* 4 and 5 were for filesystem types SGI haven't ever supported on MIPS CPUs */
15 #define SGI_VOLUME 0x06
18 #define SGI_RLVOL 0x09
20 #define SGI_XFSLOG 0x0b
23 #define SGI_ENTIRE_DISK SGI_VOLUME
25 struct device_parameter { /* 48 bytes */
29 unsigned char sparecyl;
30 unsigned short pcylcount;
31 unsigned short head_vol0;
32 unsigned short ntrks; /* tracks in cyl 0 or vol 0 */
33 unsigned char cmd_tag_queue_depth;
34 unsigned char unused0;
35 unsigned short unused1;
36 unsigned short nsect; /* sectors/tracks in cyl 0 or vol 0 */
38 unsigned short ilfact;
39 unsigned int flags; /* controller flags */
40 unsigned int datarate;
41 unsigned int retries_on_error;
42 unsigned int ms_per_word;
43 unsigned short xylogics_gap1;
44 unsigned short xylogics_syncdelay;
45 unsigned short xylogics_readdelay;
46 unsigned short xylogics_gap2;
47 unsigned short xylogics_readgate;
48 unsigned short xylogics_writecont;
54 #define SECTOR_SLIP 0x01
55 #define SECTOR_FWD 0x02
56 #define TRACK_FWD 0x04
57 #define TRACK_MULTIVOL 0x08
58 #define IGNORE_ERRORS 0x10
60 #define ENABLE_CMDTAGQ 0x40
63 unsigned int magic; /* expect SGI_LABEL_MAGIC */
64 unsigned short boot_part; /* active boot partition */
65 unsigned short swap_part; /* active swap partition */
66 unsigned char boot_file[16]; /* name of the bootfile */
67 struct device_parameter devparam; /* 1 * 48 bytes */
68 struct volume_directory { /* 15 * 16 bytes */
69 unsigned char vol_file_name[8]; /* a character array */
70 unsigned int vol_file_start; /* number of logical block */
71 unsigned int vol_file_size; /* number of bytes */
73 struct sgi_partinfo { /* 16 * 12 bytes */
74 unsigned int num_sectors; /* number of blocks */
75 unsigned int start_sector; /* must be cylinder aligned */
79 unsigned int fillbytes;
83 unsigned int magic; /* looks like a magic number */
92 unsigned char scsi_string[50];
93 unsigned char serial[137];
94 unsigned short check1816;
95 unsigned char installer[225];
98 #define SGI_LABEL_MAGIC 0x0be5a941
99 #define SGI_LABEL_MAGIC_SWAPPED 0x41a9e50b
100 #define SGI_INFO_MAGIC 0x00072959
101 #define SGI_INFO_MAGIC_SWAPPED 0x59290700
103 #define SGI_SSWAP16(x) (sgi_other_endian ? fdisk_swap16(x) : (uint16_t)(x))
104 #define SGI_SSWAP32(x) (sgi_other_endian ? fdisk_swap32(x) : (uint32_t)(x))
106 #define sgilabel ((sgi_partition *)MBRbuffer)
107 #define sgiparam (sgilabel->devparam)
113 * Copyright (C) Andreas Neuper, Sep 1998.
114 * This file may be modified and redistributed under
115 * the terms of the GNU Public License.
117 * Sat Mar 20 EST 1999 Arnaldo Carvalho de Melo <acme@conectiva.com.br>
118 * Internationalization
122 static smallint sgi_other_endian; /* bool */
123 static smallint sgi_volumes = 1; /* max 15 */
126 * only dealing with free blocks here
133 static freeblocks freelist[17]; /* 16 partitions can produce 17 vacant slots */
136 setfreelist(int i, unsigned int f, unsigned int l)
138 freelist[i].first = f;
139 freelist[i].last = l;
143 add2freelist(unsigned int f, unsigned int l)
146 for (i = 0; i < 17; i++)
147 if (freelist[i].last == 0)
149 setfreelist(i, f, l);
157 for (i = 0; i < 17; i++)
158 setfreelist(i, 0, 0);
162 isinfreelist(unsigned int b)
166 for (i = 0; i < 17; i++)
167 if (freelist[i].first <= b && freelist[i].last >= b)
168 return freelist[i].last;
171 /* return last vacant block of this stride (never 0). */
172 /* the '>=' is not quite correct, but simplifies the code */
174 * end of free blocks section
177 static const char *const sgi_sys_types[] = {
178 /* SGI_VOLHDR */ "\x00" "SGI volhdr" ,
179 /* 0x01 */ "\x01" "SGI trkrepl" ,
180 /* 0x02 */ "\x02" "SGI secrepl" ,
181 /* SGI_SWAP */ "\x03" "SGI raw" ,
182 /* 0x04 */ "\x04" "SGI bsd" ,
183 /* 0x05 */ "\x05" "SGI sysv" ,
184 /* SGI_ENTIRE_DISK */ "\x06" "SGI volume" ,
185 /* SGI_EFS */ "\x07" "SGI efs" ,
186 /* 0x08 */ "\x08" "SGI lvol" ,
187 /* 0x09 */ "\x09" "SGI rlvol" ,
188 /* SGI_XFS */ "\x0a" "SGI xfs" ,
189 /* SGI_XFSLOG */ "\x0b" "SGI xfslog" ,
190 /* SGI_XLV */ "\x0c" "SGI xlv" ,
191 /* SGI_XVM */ "\x0d" "SGI xvm" ,
192 /* LINUX_SWAP */ "\x82" "Linux swap" ,
193 /* LINUX_NATIVE */ "\x83" "Linux native",
194 /* LINUX_LVM */ "\x8d" "Linux LVM" ,
195 /* LINUX_RAID */ "\xfd" "Linux RAID" ,
203 return SGI_SSWAP16(sgilabel->devparam.nsect);
209 return SGI_SSWAP16(sgilabel->devparam.ntrks);
213 two_s_complement_32bit_sum(unsigned int* base, int size /* in bytes */)
216 unsigned int sum = 0;
218 size /= sizeof(unsigned int);
219 for (i = 0; i < size; i++)
220 sum -= SGI_SSWAP32(base[i]);
224 void BUG_bad_sgi_partition_size(void);
227 check_sgi_label(void)
229 if (sizeof(sgi_partition) > 512) {
230 /* According to MIPS Computer Systems, Inc the label
231 * must not contain more than 512 bytes */
232 BUG_bad_sgi_partition_size();
235 if (sgilabel->magic != SGI_LABEL_MAGIC
236 && sgilabel->magic != SGI_LABEL_MAGIC_SWAPPED
238 current_label_type = LABEL_DOS;
242 sgi_other_endian = (sgilabel->magic == SGI_LABEL_MAGIC_SWAPPED);
244 * test for correct checksum
246 if (two_s_complement_32bit_sum((unsigned int*)sgilabel,
247 sizeof(*sgilabel))) {
248 printf("Detected sgi disklabel with wrong checksum\n");
251 current_label_type = LABEL_SGI;
258 sgi_get_start_sector(int i)
260 return SGI_SSWAP32(sgilabel->partitions[i].start_sector);
264 sgi_get_num_sectors(int i)
266 return SGI_SSWAP32(sgilabel->partitions[i].num_sectors);
272 return SGI_SSWAP32(sgilabel->partitions[i].id);
276 sgi_get_bootpartition(void)
278 return SGI_SSWAP16(sgilabel->boot_part);
282 sgi_get_swappartition(void)
284 return SGI_SSWAP16(sgilabel->swap_part);
288 sgi_list_table(int xtra)
291 int kpi = 0; /* kernel partition ID */
294 printf("\nDisk %s (SGI disk label): %u heads, %u sectors\n"
295 "%u cylinders, %u physical cylinders\n"
296 "%u extra sects/cyl, interleave %u:1\n"
298 "Units = %s of %u * 512 bytes\n\n",
299 disk_device, g_heads, g_sectors, g_cylinders,
300 SGI_SSWAP16(sgiparam.pcylcount),
301 SGI_SSWAP16(sgiparam.sparecyl),
302 SGI_SSWAP16(sgiparam.ilfact),
304 str_units(PLURAL), units_per_sector);
306 printf("\nDisk %s (SGI disk label): "
307 "%u heads, %u sectors, %u cylinders\n"
308 "Units = %s of %u * 512 bytes\n\n",
309 disk_device, g_heads, g_sectors, g_cylinders,
310 str_units(PLURAL), units_per_sector );
313 w = strlen(disk_device);
314 wd = sizeof("Device") - 1;
318 printf("----- partitions -----\n"
319 "Pt# %*s Info Start End Sectors Id System\n",
321 for (i = 0; i < g_partitions; i++) {
322 if (sgi_get_num_sectors(i) || SGI_DEBUG) {
323 uint32_t start = sgi_get_start_sector(i);
324 uint32_t len = sgi_get_num_sectors(i);
325 kpi++; /* only count nonempty partitions */
327 "%2u: %s %4s %9lu %9lu %9lu %2x %s\n",
328 /* fdisk part number */ i+1,
329 /* device */ partname(disk_device, kpi, w+3),
330 /* flags */ (sgi_get_swappartition() == i) ? "swap" :
331 /* flags */ (sgi_get_bootpartition() == i) ? "boot" : " ",
332 /* start */ (long) scround(start),
333 /* end */ (long) scround(start+len)-1,
334 /* no odd flag on end */(long) len,
335 /* type id */ sgi_get_sysid(i),
336 /* type name */ partition_type(sgi_get_sysid(i)));
339 printf("----- Bootinfo -----\nBootfile: %s\n"
340 "----- Directory Entries -----\n",
341 sgilabel->boot_file);
342 for (i = 0; i < sgi_volumes; i++) {
343 if (sgilabel->directory[i].vol_file_size) {
344 uint32_t start = SGI_SSWAP32(sgilabel->directory[i].vol_file_start);
345 uint32_t len = SGI_SSWAP32(sgilabel->directory[i].vol_file_size);
346 unsigned char *name = sgilabel->directory[i].vol_file_name;
348 printf("%2u: %-10s sector%5u size%8u\n",
349 i, (char*)name, (unsigned int) start, (unsigned int) len);
355 sgi_set_bootpartition(int i)
357 sgilabel->boot_part = SGI_SSWAP16(((short)i));
361 sgi_get_lastblock(void)
363 return g_heads * g_sectors * g_cylinders;
367 sgi_set_swappartition(int i)
369 sgilabel->swap_part = SGI_SSWAP16(((short)i));
373 sgi_check_bootfile(const char* aFile)
375 if (strlen(aFile) < 3) /* "/a\n" is minimum */ {
376 printf("\nInvalid Bootfile!\n"
377 "\tThe bootfile must be an absolute non-zero pathname,\n"
378 "\te.g. \"/unix\" or \"/unix.save\".\n");
381 if (strlen(aFile) > 16) {
382 printf("\nName of Bootfile too long (>16 bytes)\n");
385 if (aFile[0] != '/') {
386 printf("\nBootfile must have a fully qualified pathname\n");
389 if (strncmp(aFile, (char*)sgilabel->boot_file, 16)) {
390 printf("\nBe aware, that the bootfile is not checked for existence.\n"
391 "\tSGI's default is \"/unix\" and for backup \"/unix.save\".\n");
392 /* filename is correct and did change */
395 return 0; /* filename did not change */
399 sgi_get_bootfile(void)
401 return (char*)sgilabel->boot_file;
405 sgi_set_bootfile(const char* aFile)
409 if (sgi_check_bootfile(aFile)) {
411 if ((aFile[i] != '\n') /* in principle caught again by next line */
412 && (strlen(aFile) > i))
413 sgilabel->boot_file[i] = aFile[i];
415 sgilabel->boot_file[i] = 0;
418 printf("\n\tBootfile is changed to \"%s\"\n", sgilabel->boot_file);
425 /* I keep SGI's habit to write the sgilabel to the second block */
426 sgilabel->directory[0].vol_file_start = SGI_SSWAP32(2);
427 sgilabel->directory[0].vol_file_size = SGI_SSWAP32(sizeof(sgiinfo));
428 strncpy((char*)sgilabel->directory[0].vol_file_name, "sgilabel", 8);
431 static sgiinfo *fill_sgiinfo(void);
434 sgi_write_table(void)
437 sgilabel->csum = SGI_SSWAP32(two_s_complement_32bit_sum(
438 (unsigned int*)sgilabel, sizeof(*sgilabel)));
439 assert(two_s_complement_32bit_sum(
440 (unsigned int*)sgilabel, sizeof(*sgilabel)) == 0);
442 write_sector(0, sgilabel);
443 if (!strncmp((char*)sgilabel->directory[0].vol_file_name, "sgilabel", 8)) {
445 * keep this habit of first writing the "sgilabel".
446 * I never tested whether it works without (AN 981002).
448 sgiinfo *info = fill_sgiinfo();
449 int infostartblock = SGI_SSWAP32(sgilabel->directory[0].vol_file_start);
450 write_sector(infostartblock, info);
456 compare_start(int *x, int *y)
459 * sort according to start sectors
460 * and prefers largest partition:
461 * entry zero is entire disk entry
465 unsigned int a = sgi_get_start_sector(i);
466 unsigned int b = sgi_get_start_sector(j);
467 unsigned int c = sgi_get_num_sectors(i);
468 unsigned int d = sgi_get_num_sectors(j);
471 return (d > c) ? 1 : (d == c) ? 0 : -1;
472 return (a > b) ? 1 : -1;
477 verify_sgi(int verbose)
479 int Index[16]; /* list of valid partitions */
480 int sortcount = 0; /* number of used partitions, i.e. non-zero lengths */
481 int entire = 0, i = 0;
482 unsigned int start = 0;
483 long long gap = 0; /* count unused blocks */
484 unsigned int lastblock = sgi_get_lastblock();
487 for (i = 0; i < 16; i++) {
488 if (sgi_get_num_sectors(i) != 0) {
489 Index[sortcount++] = i;
490 if (sgi_get_sysid(i) == SGI_ENTIRE_DISK) {
493 printf("More than one entire disk entry present\n");
498 if (sortcount == 0) {
500 printf("No partitions defined\n");
501 return (lastblock > 0) ? 1 : (lastblock == 0) ? 0 : -1;
503 qsort(Index, sortcount, sizeof(Index[0]), (void*)compare_start);
504 if (sgi_get_sysid(Index[0]) == SGI_ENTIRE_DISK) {
505 if ((Index[0] != 10) && verbose)
506 printf("IRIX likes when Partition 11 covers the entire disk\n");
507 if ((sgi_get_start_sector(Index[0]) != 0) && verbose)
508 printf("The entire disk partition should start "
510 "not at diskblock %u\n",
511 sgi_get_start_sector(Index[0]));
512 if (SGI_DEBUG) /* I do not understand how some disks fulfil it */
513 if ((sgi_get_num_sectors(Index[0]) != lastblock) && verbose)
514 printf("The entire disk partition is only %u diskblock large,\n"
515 "but the disk is %u diskblocks long\n",
516 sgi_get_num_sectors(Index[0]), lastblock);
517 lastblock = sgi_get_num_sectors(Index[0]);
520 printf("One Partition (#11) should cover the entire disk\n");
522 printf("sysid=%u\tpartition=%u\n",
523 sgi_get_sysid(Index[0]), Index[0]+1);
525 for (i = 1, start = 0; i < sortcount; i++) {
526 int cylsize = sgi_get_nsect() * sgi_get_ntrks();
528 if ((sgi_get_start_sector(Index[i]) % cylsize) != 0) {
529 if (SGI_DEBUG) /* I do not understand how some disks fulfil it */
531 printf("Partition %u does not start on cylinder boundary\n",
534 if (sgi_get_num_sectors(Index[i]) % cylsize != 0) {
535 if (SGI_DEBUG) /* I do not understand how some disks fulfil it */
537 printf("Partition %u does not end on cylinder boundary\n",
540 /* We cannot handle several "entire disk" entries. */
541 if (sgi_get_sysid(Index[i]) == SGI_ENTIRE_DISK) continue;
542 if (start > sgi_get_start_sector(Index[i])) {
544 printf("Partitions %u and %u overlap by %u sectors\n",
545 Index[i-1]+1, Index[i]+1,
546 start - sgi_get_start_sector(Index[i]));
547 if (gap > 0) gap = -gap;
548 if (gap == 0) gap = -1;
550 if (start < sgi_get_start_sector(Index[i])) {
552 printf("Unused gap of %u sectors - sectors %u-%u\n",
553 sgi_get_start_sector(Index[i]) - start,
554 start, sgi_get_start_sector(Index[i])-1);
555 gap += sgi_get_start_sector(Index[i]) - start;
556 add2freelist(start, sgi_get_start_sector(Index[i]));
558 start = sgi_get_start_sector(Index[i])
559 + sgi_get_num_sectors(Index[i]);
562 printf("%2u:%12u\t%12u\t%12u\n", Index[i],
563 sgi_get_start_sector(Index[i]),
564 sgi_get_num_sectors(Index[i]),
565 sgi_get_sysid(Index[i]));
568 if (start < lastblock) {
570 printf("Unused gap of %u sectors - sectors %u-%u\n",
571 lastblock - start, start, lastblock-1);
572 gap += lastblock - start;
573 add2freelist(start, lastblock);
576 * Done with arithmetics
580 if (!sgi_get_num_sectors(sgi_get_bootpartition())) {
581 printf("\nThe boot partition does not exist\n");
583 if (!sgi_get_num_sectors(sgi_get_swappartition())) {
584 printf("\nThe swap partition does not exist\n");
586 if ((sgi_get_sysid(sgi_get_swappartition()) != SGI_SWAP)
587 && (sgi_get_sysid(sgi_get_swappartition()) != LINUX_SWAP))
588 printf("\nThe swap partition has no swap type\n");
590 if (sgi_check_bootfile("/unix"))
591 printf("\tYou have chosen an unusual boot file name\n");
593 return (gap > 0) ? 1 : (gap == 0) ? 0 : -1;
601 * = 0 : disk is properly filled to the rim
602 * < 0 : there is an overlap
603 * > 0 : there is still some vacant space
605 return verify_sgi(0);
609 sgi_change_sysid(int i, int sys)
611 if (sgi_get_num_sectors(i) == 0) { /* caught already before, ... */
612 printf("Sorry you may change the Tag of non-empty partitions\n");
615 if ((sys != SGI_ENTIRE_DISK) && (sys != SGI_VOLHDR)
616 && (sgi_get_start_sector(i) < 1)
619 "It is highly recommended that the partition at offset 0\n"
620 "is of type \"SGI volhdr\", the IRIX system will rely on it to\n"
621 "retrieve from its directory standalone tools like sash and fx.\n"
622 "Only the \"SGI volume\" entire disk section may violate this.\n"
623 "Type YES if you are sure about tagging this partition differently.\n");
624 if (strcmp(line_ptr, "YES\n") != 0)
627 sgilabel->partitions[i].id = SGI_SSWAP32(sys);
630 /* returns partition index of first entry marked as entire disk */
636 for (i = 0; i < 16; i++)
637 if (sgi_get_sysid(i) == SGI_VOLUME)
643 sgi_set_partition(int i, unsigned int start, unsigned int length, int sys)
645 sgilabel->partitions[i].id = SGI_SSWAP32(sys);
646 sgilabel->partitions[i].num_sectors = SGI_SSWAP32(length);
647 sgilabel->partitions[i].start_sector = SGI_SSWAP32(start);
649 if (sgi_gaps() < 0) /* rebuild freelist */
650 printf("Partition overlap detected\n");
658 for (n = 10; n < g_partitions; n++) {
659 if (!sgi_get_num_sectors(n) ) {
660 sgi_set_partition(n, 0, sgi_get_lastblock(), SGI_VOLUME);
671 for (n = 8; n < g_partitions; n++) {
672 if (!sgi_get_num_sectors(n)) {
674 * 5 cylinders is an arbitrary value I like
675 * IRIX 5.3 stored files in the volume header
676 * (like sash, symmon, fx, ide) with ca. 3200
679 if (g_heads * g_sectors * 5 < sgi_get_lastblock())
680 sgi_set_partition(n, 0, g_heads * g_sectors * 5, SGI_VOLHDR);
687 sgi_delete_partition(int i)
689 sgi_set_partition(i, 0, 0, 0);
693 sgi_add_partition(int n, int sys)
696 unsigned int first = 0, last = 0;
703 if (sgi_get_num_sectors(n)) {
704 printf(msg_part_already_defined, n + 1);
707 if ((sgi_entire() == -1) && (sys != SGI_VOLUME)) {
708 printf("Attempting to generate entire disk entry automatically\n");
712 if ((sgi_gaps() == 0) && (sys != SGI_VOLUME)) {
713 printf("The entire disk is already covered with partitions\n");
716 if (sgi_gaps() < 0) {
717 printf("You got a partition overlap on the disk. Fix it first!\n");
720 snprintf(mesg, sizeof(mesg), "First %s", str_units(SINGULAR));
722 if (sys == SGI_VOLUME) {
723 last = sgi_get_lastblock();
724 first = read_int(0, 0, last-1, 0, mesg);
726 printf("It is highly recommended that eleventh partition\n"
727 "covers the entire disk and is of type 'SGI volume'\n");
730 first = freelist[0].first;
731 last = freelist[0].last;
732 first = read_int(scround(first), scround(first), scround(last)-1,
735 if (display_in_cyl_units)
736 first *= units_per_sector;
738 first = first; /* align to cylinder if you know how ... */
740 last = isinfreelist(first);
743 printf("You will get a partition overlap on the disk. "
746 snprintf(mesg, sizeof(mesg), " Last %s", str_units(SINGULAR));
747 last = read_int(scround(first), scround(last)-1, scround(last)-1,
748 scround(first), mesg)+1;
749 if (display_in_cyl_units)
750 last *= units_per_sector;
752 last = last; /* align to cylinder if You know how ... */
753 if ( (sys == SGI_VOLUME) && (first != 0 || last != sgi_get_lastblock() ) )
754 printf("It is highly recommended that eleventh partition\n"
755 "covers the entire disk and is of type 'SGI volume'\n");
756 sgi_set_partition(n, first, last-first, sys);
759 #if ENABLE_FEATURE_FDISK_ADVANCED
761 create_sgilabel(void)
763 struct hd_geometry geometry;
770 long longsectors; /* the number of sectors on the device */
771 int res; /* the result from the ioctl */
772 int sec_fac; /* the sector factor */
774 sec_fac = sector_size / 512; /* determine the sector factor */
776 printf(msg_building_new_label, "SGI disklabel");
778 sgi_other_endian = BB_LITTLE_ENDIAN;
779 res = ioctl(dev_fd, BLKGETSIZE, &longsectors);
780 if (!ioctl(dev_fd, HDIO_GETGEO, &geometry)) {
781 g_heads = geometry.heads;
782 g_sectors = geometry.sectors;
784 /* the get device size ioctl was successful */
785 g_cylinders = longsectors / (g_heads * g_sectors);
786 g_cylinders /= sec_fac;
788 /* otherwise print error and use truncated version */
789 g_cylinders = geometry.cylinders;
791 "Warning: BLKGETSIZE ioctl failed on %s. Using geometry cylinder value of %u.\n"
792 "This value may be truncated for devices > 33.8 GB.\n", disk_device, g_cylinders);
795 for (i = 0; i < 4; i++) {
797 if (valid_part_table_flag(MBRbuffer)) {
798 if (get_part_table(i)->sys_ind) {
799 old[i].sysid = get_part_table(i)->sys_ind;
800 old[i].start = get_start_sect(get_part_table(i));
801 old[i].nsect = get_nr_sects(get_part_table(i));
802 printf("Trying to keep parameters of partition %u\n", i);
804 printf("ID=%02x\tSTART=%u\tLENGTH=%u\n",
805 old[i].sysid, old[i].start, old[i].nsect);
810 memset(MBRbuffer, 0, sizeof(MBRbuffer));
811 /* fields with '//' are already zeroed out by memset above */
813 sgilabel->magic = SGI_SSWAP32(SGI_LABEL_MAGIC);
814 //sgilabel->boot_part = SGI_SSWAP16(0);
815 sgilabel->swap_part = SGI_SSWAP16(1);
817 //memset(sgilabel->boot_file, 0, 16);
818 strcpy((char*)sgilabel->boot_file, "/unix"); /* sizeof(sgilabel->boot_file) == 16 > 6 */
820 //sgilabel->devparam.skew = (0);
821 //sgilabel->devparam.gap1 = (0);
822 //sgilabel->devparam.gap2 = (0);
823 //sgilabel->devparam.sparecyl = (0);
824 sgilabel->devparam.pcylcount = SGI_SSWAP16(geometry.cylinders);
825 //sgilabel->devparam.head_vol0 = SGI_SSWAP16(0);
826 /* tracks/cylinder (heads) */
827 sgilabel->devparam.ntrks = SGI_SSWAP16(geometry.heads);
828 //sgilabel->devparam.cmd_tag_queue_depth = (0);
829 //sgilabel->devparam.unused0 = (0);
830 //sgilabel->devparam.unused1 = SGI_SSWAP16(0);
832 sgilabel->devparam.nsect = SGI_SSWAP16(geometry.sectors);
833 sgilabel->devparam.bytes = SGI_SSWAP16(512);
834 sgilabel->devparam.ilfact = SGI_SSWAP16(1);
835 sgilabel->devparam.flags = SGI_SSWAP32(TRACK_FWD|
836 IGNORE_ERRORS|RESEEK);
837 //sgilabel->devparam.datarate = SGI_SSWAP32(0);
838 sgilabel->devparam.retries_on_error = SGI_SSWAP32(1);
839 //sgilabel->devparam.ms_per_word = SGI_SSWAP32(0);
840 //sgilabel->devparam.xylogics_gap1 = SGI_SSWAP16(0);
841 //sgilabel->devparam.xylogics_syncdelay = SGI_SSWAP16(0);
842 //sgilabel->devparam.xylogics_readdelay = SGI_SSWAP16(0);
843 //sgilabel->devparam.xylogics_gap2 = SGI_SSWAP16(0);
844 //sgilabel->devparam.xylogics_readgate = SGI_SSWAP16(0);
845 //sgilabel->devparam.xylogics_writecont = SGI_SSWAP16(0);
846 //memset( &(sgilabel->directory), 0, sizeof(struct volume_directory)*15 );
847 //memset( &(sgilabel->partitions), 0, sizeof(struct sgi_partinfo)*16 );
848 current_label_type = LABEL_SGI;
853 for (i = 0; i < 4; i++) {
855 sgi_set_partition(i, old[i].start, old[i].nsect, old[i].sysid);
863 /* do nothing in the beginning */
865 #endif /* FEATURE_FDISK_ADVANCED */
867 /* _____________________________________________________________
873 sgiinfo *info = xzalloc(sizeof(sgiinfo));
875 info->magic = SGI_SSWAP32(SGI_INFO_MAGIC);
876 info->b1 = SGI_SSWAP32(-1);
877 info->b2 = SGI_SSWAP16(-1);
878 info->b3 = SGI_SSWAP16(1);
879 /* You may want to replace this string !!!!!!! */
880 strcpy( (char*)info->scsi_string, "IBM OEM 0662S12 3 30" );
881 strcpy( (char*)info->serial, "0000" );
882 info->check1816 = SGI_SSWAP16(18*256 +16 );
883 strcpy( (char*)info->installer, "Sfx version 5.3, Oct 18, 1994" );
886 #endif /* SGI_LABEL */