From: Ben Gras Date: Thu, 8 Feb 2007 15:56:58 +0000 (+0000) Subject: Extend cdprobe probe list to c1, and reorder minors to do most-likely X-Git-Tag: v3.1.3~90 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=624f17ee04099b049f62ae19acc5e3207effd936;p=minix.git Extend cdprobe probe list to c1, and reorder minors to do most-likely first. Make at_wini include instance number in error messages. --- diff --git a/commands/simple/cdprobe.c b/commands/simple/cdprobe.c index 3512dcc68..451167f61 100644 --- a/commands/simple/cdprobe.c +++ b/commands/simple/cdprobe.c @@ -31,15 +31,22 @@ char pvd[CD_SECTOR]; *===========================================================================*/ int main(void) { - int i, r, fd, minor, found; + int controller, disk, r, fd, minor, found; off_t pos; u16_t *magicp; char name1[]= "/dev/c0dX"; char name2[]= "/dev/c0dXpY"; + int probelist[AT_MINORS] = { 2, 3, 1, 0, 6, 7, 5, 4 }; found= 0; - for(i = 0; i < AT_MINORS; i++) { - name1[8]= '0' + i; + for(controller = 0; controller <= 1; controller++) { + name1[6] = '0' + controller; + name2[6] = '0' + controller; + for(disk = 0; disk < AT_MINORS; disk++) { + name1[8]= '0' + probelist[disk]; + + fprintf(stderr, "Trying %s \r", name1); + fflush(stderr); fd = open(name1, O_RDONLY); if (fd < 0) @@ -78,10 +85,10 @@ int main(void) continue; } - /* 3. Both c0dXp1 and p2 should have a superblock. */ + /* 3. Both cXdYp1 and p2 should have a superblock. */ found= 1; /* Assume everything is okay */ for (minor = 1; minor <= 2; minor++) { - name2[8]= '0' + i; + name2[8]= '0' + probelist[disk]; name2[10]= '0' + minor; fd = open(name2, O_RDONLY); @@ -120,10 +127,13 @@ int main(void) if (found) { + fprintf(stderr, "\nFound.\n"); printf("%s\n", name1); exit(0); } + } } + fprintf(stderr, "\nNot found.\n"); return 1; } diff --git a/drivers/at_wini/at_wini.c b/drivers/at_wini/at_wini.c index 95c567d6f..47dcfeccd 100644 --- a/drivers/at_wini/at_wini.c +++ b/drivers/at_wini/at_wini.c @@ -1011,9 +1011,10 @@ PRIVATE int w_identify() PRIVATE char *w_name() { /* Return a name for the current device. */ - static char name[] = "AT-D0"; + static char name[] = "AT0-D0"; - name[4] = '0' + w_drive; + name[2] = '0' + w_instance; + name[5] = '0' + w_drive; return name; }