From owner-freebsd-hackers Wed May 5 2: 2:23 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from herring.nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (Postfix) with ESMTP id DB93E15D3E for ; Wed, 5 May 1999 02:01:59 -0700 (PDT) (envelope-from dfr@nlsystems.com) Received: from localhost (dfr@localhost) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id KAA00593; Wed, 5 May 1999 10:01:55 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Wed, 5 May 1999 10:01:55 +0100 (BST) From: Doug Rabson To: CyberPsychotic Cc: freebsd-hackers@freebsd.org, tech@openbsd.org Subject: Re: io ports reading/writing In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 5 May 1999, CyberPsychotic wrote: > ~ > ~ I think you just open /dev/io and use inb/outb. Be warned that this will > ~ only work on i386 - the alpha uses a library, libio, to emulate inb/outb > ~ in user programs. > > you say that on i386, > open("/dev/io",O_RDWR); foo=inb(PORT_X); bar=outb(foo,PORT_Y); would work? > if so, in this scheme I don't quite understand how kernel would handle the > access to io ports. F.e. assuming that opening /dev/io, would give > permittions to all io ports would be quite dangerous (since not all programs > which could be permitted to modify cmos, should be permitted to ports > controlling disk access etc). > > would you mind eleborating this abit? > The access control for io ports is controlled by the file-system permissions on /dev/io. In a standard setup, only root can access this device. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message