From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 15 14:53:35 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 48A5916A4BF for ; Wed, 15 Oct 2003 14:53:35 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 07FB843FB1 for ; Wed, 15 Oct 2003 14:53:34 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.10/8.12.10) with ESMTP id h9FLrU49047300; Wed, 15 Oct 2003 23:53:31 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: lauri.jarvenpaa@students.turkuamk.fi From: "Poul-Henning Kamp" In-Reply-To: Your message of "Thu, 16 Oct 2003 00:00:52 +0300." <20031016000052.648ca035.lauri.jarvenpaa@students.turkuamk.fi> Date: Wed, 15 Oct 2003 23:53:30 +0200 Message-ID: <47299.1066254810@critter.freebsd.dk> cc: freebsd-hackers@freebsd.org Subject: Re: to write a device driver or not to write (i/o, opl3, stupidity) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Oct 2003 21:53:35 -0000 In message <20031016000052.648ca035.lauri.jarvenpaa@students.turkuamk.fi>, laur i.jarvenpaa@students.turkuamk.fi writes: >Hello. I'm sorry to disturb you but.. I have read manuals, searched web, fed the ducks (evil ones), but I can not figure out some things. > >1: >I have an isa card with i/o address 0x300-0x301. No dma, no irq - just i/o. >How can I read/write from/to this address to program the card? >Card is a HardSID and it is pc implementation of famous Commodore >64 synthesizer chip so actually I want to program that chip, not >just _any_ card :) You can do this from userland as root by opening /dev/io: #include #include #include #include #include int main(int argc, char **argv) { FILE *f; f = fopen("/dev/io", "r"); outl(0xe11c, 0x120); outl(0xe124, 0xd0602004); outl(0xe134, 0x18600020); outl(0xe11c, 0x130); [...] -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.