diff options
Diffstat (limited to 'src/gpt.c')
-rw-r--r-- | src/gpt.c | 34 |
1 files changed, 33 insertions, 1 deletions
@@ -6,10 +6,13 @@ * */ -static char rcsid[] = "$Id: gpt.c,v 1.1 2007/09/08 16:49:37 root Exp $"; +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 *** * @@ -23,5 +26,34 @@ static char rcsid[] = "$Id: gpt.c,v 1.1 2007/09/08 16:49:37 root Exp $"; 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; } |