XHInqDev works now

This commit is contained in:
Markus Fröschle
2013-05-04 19:25:35 +00:00
parent 0eec0e9608
commit b1f282ff57
3 changed files with 26 additions and 15 deletions

View File

@@ -38,6 +38,18 @@ int getcookie(uint32_t cookie, uint32_t *p_value)
return 0;
}
void print_bpb(_BPB *bpb)
{
printf("\t\trecsiz = %d\r\n", bpb->recsiz);
printf("\t\tclsiz = %d\r\n", bpb->clsiz);
printf("\t\tclsizb = %d\r\n", bpb->clsizb);
printf("\t\trdlen = %d\r\n", bpb->rdlen);
printf("\t\tfsiz = %d\r\n", bpb->fsiz);
printf("\t\tfatrec = %d\r\n", bpb->fatrec);
printf("\t\tdatrec = %d\r\n", bpb->datrec);
printf("\t\tnumcl = %d\r\n", bpb->numcl);
printf("\t\tbflags = %x\r\n", bpb->bflags);
}
void xhdi_test(void)
{
long drvmap;
@@ -56,15 +68,17 @@ void xhdi_test(void)
uint16_t minor = 0;
long start_sector = 0L;
uint32_t ret;
_BPB *bpb = NULL;
_BPB *bpb;
if ((drvmap >> i) & 1)
{
ret = XHInqDev(xhdi, i, &major, &minor, &start_sector, &bpb);
//if (ret == E_OK)
if (ret == E_OK || ret == EDRVNR)
{
printf("drive %d returned %d:\r\n", i, ret);
printf("\tmajor = %d, minor = %d, start_sector = %lx, bpb = %p\r\n", major & 0xff, minor & 0xff, start_sector, bpb);
if (bpb != NULL)
print_bpb(bpb);
}
}
}