4 #include <time.h> /* time_t */
6 #define SOLARIS_X86_NUMSLICE 8
7 #define SOLARIS_X86_VTOC_SANE (0x600DDEEEUL)
9 //typedef int daddr_t; /* or long - check */
11 struct solaris_x86_slice {
12 unsigned short s_tag; /* ID tag of partition */
13 unsigned short s_flag; /* permision flags */
14 daddr_t s_start; /* start sector no of partition */
15 long s_size; /* # of blocks in partition */
18 struct solaris_x86_vtoc {
19 unsigned long v_bootinfo[3]; /* info for mboot */
20 unsigned long v_sanity; /* to verify vtoc sanity */
21 unsigned long v_version; /* layout version */
22 char v_volume[8]; /* volume name */
23 unsigned short v_sectorsz; /* sector size in bytes */
24 unsigned short v_nparts; /* number of partitions */
25 unsigned long v_reserved[10]; /* free space */
26 struct solaris_x86_slice
27 v_slice[SOLARIS_X86_NUMSLICE]; /* slice headers */
28 time_t timestamp[SOLARIS_X86_NUMSLICE]; /* timestamp */
29 char v_asciilabel[128]; /* for compatibility */
33 read_solaris_pt(int fd, struct slice all, struct slice *sp, int ns) {
34 struct solaris_x86_vtoc *v;
35 struct solaris_x86_slice *s;
36 unsigned int offset = all.start;
40 bp = getblock(fd, offset+1); /* 1 sector suffices */
44 v = (struct solaris_x86_vtoc *) bp;
45 if(v->v_sanity != SOLARIS_X86_VTOC_SANE)
48 if(v->v_version != 1) {
49 fprintf(stderr, "Cannot handle solaris version %ld vtoc\n",
54 for(i=0, n=0; i<SOLARIS_X86_NUMSLICE; i++) {
60 sp[n].start = offset + s->s_start;
61 sp[n].size = s->s_size;
65 "solaris_x86_partition: too many slices\n");