2 #include <time.h> /* time_t */
6 #define SOLARIS_X86_NUMSLICE 8
7 #define SOLARIS_X86_VTOC_SANE (0x600DDEEEUL)
9 struct solaris_x86_slice {
10 unsigned short s_tag; /* ID tag of partition */
11 unsigned short s_flag; /* permision flags */
12 daddr_t s_start; /* start sector no of partition */
13 long s_size; /* # of blocks in partition */
16 struct solaris_x86_vtoc {
17 unsigned long v_bootinfo[3]; /* info for mboot */
18 unsigned long v_sanity; /* to verify vtoc sanity */
19 unsigned long v_version; /* layout version */
20 char v_volume[8]; /* volume name */
21 unsigned short v_sectorsz; /* sector size in bytes */
22 unsigned short v_nparts; /* number of partitions */
23 unsigned long v_reserved[10]; /* free space */
24 struct solaris_x86_slice
25 v_slice[SOLARIS_X86_NUMSLICE]; /* slice headers */
26 time_t timestamp[SOLARIS_X86_NUMSLICE]; /* timestamp */
27 char v_asciilabel[128]; /* for compatibility */
31 read_solaris_pt(int fd, struct slice all, struct slice *sp, int ns) {
32 struct solaris_x86_vtoc *v;
33 struct solaris_x86_slice *s;
34 unsigned int offset = all.start;
38 bp = getblock(fd, offset+1); /* 1 sector suffices */
42 v = (struct solaris_x86_vtoc *) bp;
43 if(v->v_sanity != SOLARIS_X86_VTOC_SANE)
46 if(v->v_version != 1) {
47 fprintf(stderr, "Cannot handle solaris version %ld vtoc\n",
52 for(i=0, n=0; i<SOLARIS_X86_NUMSLICE; i++) {
58 sp[n].start = offset + s->s_start;
59 sp[n].size = s->s_size;
63 "solaris_x86_partition: too many slices\n");