can now test a few functions
This commit is contained in:
@@ -38,21 +38,50 @@ int getcookie(uint32_t cookie, uint32_t *p_value)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void xhdi_test(void)
|
||||
{
|
||||
long drvmap;
|
||||
int i;
|
||||
|
||||
printf("XHDI cookie: %p\r\n\r\n", xhdi);
|
||||
|
||||
printf("XHGetVersion = %lx\r\n", XHGetVersion(xhdi));
|
||||
drvmap = XHDrvMap(xhdi);
|
||||
printf("XHDrvmap = %lx\r\n", drvmap);
|
||||
|
||||
printf("XHInqDev for all XHDI devices\r\n");
|
||||
for (i = 0; i < 32; i++)
|
||||
{
|
||||
uint16_t major = 0;
|
||||
uint16_t minor = 0;
|
||||
long start_sector = 0L;
|
||||
uint32_t ret;
|
||||
_BPB *bpb = NULL;
|
||||
|
||||
if ((drvmap >> i) & 1)
|
||||
{
|
||||
ret = XHInqDev(xhdi, i, &major, &minor, &start_sector, &bpb);
|
||||
//if (ret == E_OK)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
(void) Cconws("\033EGCC XHDI Test Program\r\n=====================\r\n\r\n");
|
||||
|
||||
if (getcookie('XHDI', (uint32_t *) &xhdi))
|
||||
{
|
||||
printf("XHDI cookie: %p\r\n", xhdi);
|
||||
|
||||
printf("xhdi version : %ld\r\n", xhdi_version(xhdi));
|
||||
printf("xhdi drivemap: %lx\r\n", xhdi_drivemap(xhdi));
|
||||
Supexec(xhdi_test);
|
||||
}
|
||||
else
|
||||
(void) Cconws("no XHDI cookie found.\r\n");
|
||||
|
||||
(void) Cconws("press any key\r\n");
|
||||
(void) Cconws("\r\n<press any key to return to desktop>\r\n");
|
||||
(void) Cconin();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user