alayne@gandalf.UUCP (Alayne McGregor) (09/08/89)
I have an application that accesses the floppy disk drive. Within it I would like to verify that a disk is in the drive and the door is closed. Once I get to _that_ point, I can easily enough verify the format and integrity of the data on the floppy. At present, XENIX insists on dumping a nasty error message to the console device if a process tries to read the floppy drive and no disk is present, or the door is closed: ----- Fri Aug 18 15:35:23 fd: ERROR: error on dev floppy (2/64), block=0 cmd=00000000 status=00000003 insert disk or close floppy door ----- ...not exactly the type of message I want the user to see, barfed all over the middle of the window she is looking at! The error message is output by the kernel (driver) before the read() call to read the floppy returns. OK, so how do I stop the kernel from barfing error messages onto the current multiscreen (which the /dev/console device is apparently mapped to) ? I tried changing the major/minor device numbers for both /dev/console and /dev/systty, from 3/1 to that of disabled multiscreen tty12: 0/11, then rebooting. The error message was still dumped to the currently displayed multiscreen. Another solution to this problem would be link in and access a (fragment) of a floppy driver that doesn't spit out nasty error messages, but which is capable of returning a drive status. I am running XENIX 2.3.1 on a 386 machine. Thanks for any suggestions. Brett Delmage <scs|dgbt>!gandalf!jsitcom!brett
chapman@sco.COM (Brian Chapman) (09/20/89)
In article <2596@gandalf.UUCP> alayne@gandalf.UUCP (Alayne McGregor) writes: > OK, so how do I stop the kernel from barfing error messages onto the > current multiscreen In the special case of the floppy driver their is an ioctl() that suppresses error messages from the floppy driver. turn error messages off: ioctl(floppy_fd, FLIOCPRT, 1); turn error messages back on: ioctl(floppy_fd, FLIOCPRT, 0); This feature goes back to Xenix 2.2. A completly different solution is to boot up w/ serial console then all the error messages will go to the serial console. -- Chapman -- Brian Chapman uunet!sco!chapman Pay no attention to the man behind the curtain!