From owner-freebsd-questions Tue Mar 24 15:22:32 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA17290 for freebsd-questions-outgoing; Tue, 24 Mar 1998 15:22:32 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from post.mail.demon.net (post-30.mail.demon.net [194.159.80.130]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id PAA17249 for ; Tue, 24 Mar 1998 15:22:20 -0800 (PST) (envelope-from searle@longacre.demon.co.uk) Received: from (longacre) [158.152.156.24] by post.mail.demon.net with smtp id 0yHd1P-0007kT-00; Tue, 24 Mar 1998 23:22:20 +0000 From: searle@longacre.demon.co.uk (Michael Searle) Message-ID: To: freebsd-questions@FreeBSD.ORG Subject: use of /dev/io Date: Tue, 24 Mar 1998 23:22:20 GMT X-Mailer: Offlite 0.09 / Termite Internet for Acorn RISC OS Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I'm having problems doing direct IO with /dev/io - AFAIK, you just open this device to change the memory permissions to allow access to IO addresses. But I just get a segv, although the open succeeds. (I think the IO addresses may have been remapped, as this port address is from DOS and man mem says this has been done for the ISA space.) This is my code: #include #include void setperm(void) { if (open("/dev/io", O_RDONLY, 0) == -1) { fprintf(stderr,"Unable to open /dev/io\n"); exit(2); } return; } void vsync(void) { register unsigned short *vi = (unsigned short *)0x3da; do { } while (((*vi) & 0x08) != 0); do { } while (((*vi) & 0x08) == 0); return; } int main(int argc, char **argv) { setperm(); vsync(); exit(0); } The segv is at the first time vi is read through. -- Michael Searle - csubl@csv.warwick.ac.uk To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message