diff options
author | root <root> | 2007-09-08 18:21:23 +0000 |
---|---|---|
committer | root <root> | 2007-09-08 18:21:23 +0000 |
commit | b013532b3061cc661ee9d0b141efbc86cda5c320 (patch) | |
tree | 131cf0204aa8a73ea7594649a8e0a3a26340e9ae /src/gpt.c | |
parent | 44341d32524c1621357bac52ffca7d8e9270c3e4 (diff) | |
download | gpt-b013532b3061cc661ee9d0b141efbc86cda5c320.tar.gz gpt-b013532b3061cc661ee9d0b141efbc86cda5c320.tar.bz2 gpt-b013532b3061cc661ee9d0b141efbc86cda5c320.zip |
*** empty log message ***
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; } |