From owner-freebsd-hackers Mon Oct 27 05:59:28 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id FAA20959 for hackers-outgoing; Mon, 27 Oct 1997 05:59:28 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from Campino.Informatik.RWTH-Aachen.DE (campino.Informatik.RWTH-Aachen.DE [137.226.116.240]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id FAA20954 for ; Mon, 27 Oct 1997 05:59:24 -0800 (PST) (envelope-from kuku@gilberto.physik.RWTH-Aachen.DE) Received: from gil.physik.rwth-aachen.de (gilberto.physik.rwth-aachen.de [137.226.30.2]) by Campino.Informatik.RWTH-Aachen.DE (8.8.7/RBI-Z14) with ESMTP id OAA10730; Mon, 27 Oct 1997 14:59:20 +0100 (MET) Received: (from kuku@localhost) by gil.physik.rwth-aachen.de (8.8.5/8.6.9) id PAA03657; Mon, 27 Oct 1997 15:11:40 +0100 (MET) Message-ID: <19971027151139.61831@gil.physik.rwth-aachen.de> Date: Mon, 27 Oct 1997 15:11:39 +0100 From: Christoph Kukulies To: Peter Dufault Cc: Christoph Kukulies , freebsd-hackers@freefall.FreeBSD.org Subject: Re: mmap/mlock problem References: <199710271231.NAA03303@gil.physik.rwth-aachen.de> <199710271303.IAA24466@hda.hda.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.81e In-Reply-To: <199710271303.IAA24466@hda.hda.com>; from Peter Dufault on Mon, Oct 27, 1997 at 08:02:59AM -0500 Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Mon, Oct 27, 1997 at 08:02:59AM -0500, Peter Dufault wrote: > > The ISA mapped memory is a dual ported RAM which is > > controlled by the on board CPU on one end and the > > user process on the other end. Writing something > > into the ISA memory should not result in reading > > the same back from it. But the fact of the matter is > > that I read back what I'v written into it and this > > seems to me as if the memory is cached. > > > > I tried a mlock call on the mmapped region but this > > seems to fail in the user process. > > You shouldn't have to lock the region - the page tables for that > virtual section of your process are set up to map to those physical > addresses. Unplug the board and verify that you now can't write > to it so you know you're accessing the board - I think the map > will still succeed. > > Do you have to do some sort of hand shake with the CPU on the > I/O board? Yes, it seems so. Not in such an atomic level that some CPU data transfer acknowledge lines are tied to the memory locations but on some higher level. There is a 80186 on the board which communicates over some semaphores in the memory region with the outside world. You write a command into the location and that location must read as 0000 or FFFF if the board is ready or not resp.. Actually it's quite weird - I have the source of a DOS program which communicates with the board. (This is written for Borlandc/16 bit) > > Peter > > -- > Peter Dufault (dufault@hda.com) Realtime development, Machine control, > HD Associates, Inc. Safety critical systems, Agency approval -- Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de