From: mickey Date: Sun, 6 Apr 1997 20:08:25 +0000 (+0000) Subject: devboot commit X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=395612f504ebaa2c044b55c7720321dfd4256f93;p=openbsd devboot commit --- diff --git a/sys/arch/i386/stand/libsa/dev_i386.c b/sys/arch/i386/stand/libsa/dev_i386.c index 0e1b75eb2ce..c80d9268af1 100644 --- a/sys/arch/i386/stand/libsa/dev_i386.c +++ b/sys/arch/i386/stand/libsa/dev_i386.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dev_i386.c,v 1.3 1997/03/31 23:06:28 mickey Exp $ */ +/* $OpenBSD: dev_i386.c,v 1.4 1997/04/06 20:08:25 mickey Exp $ */ /* * Copyright (c) 1996 Michael Shalayeff @@ -49,11 +49,27 @@ devopen(struct open_file *f, const char *fname, char **file) *file = (char *)fname; - for (i = 0; i < ndevs && rc != 0; dp++, i++) +#ifdef DEBUG + printf("devopen:"); +#endif + + for (i = 0; i < ndevs && rc != 0; dp++, i++) { +#ifdef DEBUG + printf(" %s", dp->dv_name); +#endif if ((rc = (*dp->dv_open)(f, file)) == 0) { f->f_dev = dp; return 0; + } +#ifdef DEBUG + else + printf(":%d", rc); +#endif + } +#ifdef DEBUG + putchar('\n'); +#endif if ((f->f_flags & F_NODEV) == 0) f->f_dev = dp; @@ -61,6 +77,29 @@ devopen(struct open_file *f, const char *fname, char **file) return rc; } +void +devboot(bootdev, p) + dev_t bootdev; + char *p; +{ +#ifdef _TEST + *p++ = '/'; + *p++ = 'd'; + *p++ = 'e'; + *p++ = 'v'; + *p++ = '/'; + *p++ = 'r'; +#endif + if (bootdev & 0x80) + *p++ = 'h'; + else + *p++ = 'f'; + *p++ = 'd'; + *p++ = '0' + (bootdev & 0x7f); + *p++ = 'a'; + *p = '\0'; +} + void putchar(c) int c;