aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpt.c
blob: c0f4bf5a868ae4e01e2f53927cbb91446283c4a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 * gpt.c:
 *
 * Copyright (c) 2007 James McKenzie <james@fishsoup.dhs.org>,
 * All rights reserved.
 *
 */

static char rcsid[] = "$Id: gpt.c,v 1.2 2007/09/08 18:21:23 root Exp $";

/*
 * $Log: gpt.c,v $
 * Revision 1.2  2007/09/08 18:21:23  root
 * *** empty log message ***
 *
 * Revision 1.1  2007/09/08 16:49:37  root
 * *** empty log message ***
 *
 */



#include "project.h"


int
main (int argc, char *argv[])
{
int fd;
char buf[512];
GPT_entry *e;
GPT_header *h;
int i,j;

fd=open("/dev/sda",O_RDONLY);


read(fd,buf,512);
read(fd,buf,512);

h=(GPT_header *) buf;

header_print(h);



for (i=0;i<2;++i) {
read(fd,buf,512);
//hexdump(stderr,buf,0,512);
for (j=0;j<4;++j) {
e=(GPT_entry *) buf;
e+=j;
printf("%d,%d: %s\n",i,j,guid_to_a(e->type));
}
}


  return 0;
}