*BSD News Article 24586


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!elroy.jpl.nasa.gov!swrinde!emory!europa.eng.gtefsd.com!uunet!newsflash.concordia.ca!sifon!homer.cs.mcgill.ca!storm
From: storm@cs.mcgill.ca (Marc WANDSCHNEIDER)
Newsgroups: comp.os.386bsd.questions
Subject: Re: [FreeBSD-1.0] How to access io-ports ?
Date: 1 Dec 1993 17:57:53 GMT
Organization: SOCS, McGill University, Montreal, Canada
Lines: 44
Message-ID: <2dilv1$rfi@homer.cs.mcgill.ca>
References: <CHD7AB.Bwy@hermes.hrz.uni-bielefeld.de>
NNTP-Posting-Host: mnementh.cs.mcgill.ca

In article <CHD7AB.Bwy@hermes.hrz.uni-bielefeld.de>,
Lars Koeller  <uphya001@odie.uni-bielefeld.de> wrote:
>---
>
>Hello!
>
>I want to access some AD-, DA-cards from FreeBSD. To implement this I must
>have access to the io-ports via in and out. 
>
>What is the best way to solve this problem. In the case I have to implement ioctls in the kernel, who is able to give me a small and simple example program?
>
>Thanks for help. Bye

	ALthough not terribly expereicned with this sort of stuff, it looks
	to me like you will have to write some sort of driver for the device
	and set up some ioctl interface that you can use.

	I have seen programs that use inb and outb outside of the kernel
	(The XFree86 server comes to mind), but it's not clear to me whether
	or not these already operate on character special devices with
	some sort of driver in place.


	Thus, if you're willing to set up some sort of driver (I'd say
	this is the perferable, if lengtheir solution), then you can set
	up some sort of set ioctls that people can use.  A good place
	to look would be in /sys/arch/i386/i386, where a lot of code for other
	drivers is (the mms0 is a VERY simple driver and a good places to 
	start I've found in the past).


	Otherwise, all I can suggest is maybe looking at the
	mit/server/ddx/x386/ directories for sample code there in the
	XFree86 dist.  Again, it isn't clear to me if this is correct.



						Toodlepip!
						Marc 'em.
-- 
-----------------------------------------------------------------------------
Marc Wandschneider					    Seattle, WA
Barney the Dinosaur sings! You faint... Barney sings!  Barney sings! --More--
You Die... --More--