From owner-freebsd-hackers@FreeBSD.ORG Wed May 30 06:43:51 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 95ED816A41F for ; Wed, 30 May 2007 06:43:51 +0000 (UTC) (envelope-from mwm-keyword-freebsdhackers2.e313df@mired.org) Received: from mired.org (vpn.mired.org [66.92.153.74]) by mx1.freebsd.org (Postfix) with SMTP id 3BFF213C45A for ; Wed, 30 May 2007 06:43:51 +0000 (UTC) (envelope-from mwm-keyword-freebsdhackers2.e313df@mired.org) Received: (qmail 66337 invoked by uid 1001); 30 May 2007 06:43:07 -0000 Received: by bhuda.mired.org (tmda-sendmail, from uid 1001); Wed, 30 May 2007 02:43:07 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18013.7419.355416.25585@bhuda.mired.org> Date: Wed, 30 May 2007 02:43:07 -0400 To: rmgls@wanadoo.fr In-Reply-To: <20070529181027.65AD5700009C@mwinf2454.orange.fr> References: <20070529181027.65AD5700009C@mwinf2454.orange.fr> X-Mailer: VM 7.19 under Emacs 21.3.1 X-Primary-Address: mwm@mired.org X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`; h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ X-Delivery-Agent: TMDA/1.1.11 (Ladyburn) From: Mike Meyer Cc: freebsd-hackers@freebsd.org Subject: Re: direct I/O access X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 May 2007 06:43:51 -0000 In <20070529181027.65AD5700009C@mwinf2454.orange.fr>, rmgls@wanadoo.fr typed: > Sorry for cross posting, but perhaps hackers is a better list than multimedia > for this topic. Probably. > i am trying to port my old assembler soft for Dos to FreeBSD. You have my sympathy. > i need to write and read directly to the midi and scsi device. > when i try something like this i receive a sigbus error > > SORRY, i am NOT nor a C nor a FreeBSD expert!!! > all i know is Assembly language! You may have to learn some. Or at least be able to read it. And I have to ask. The hardware has changed a lot since the days of DoS, and things that worked then may cause strange results on modern hardware. Do you know modern hardware, or are you still using dos-era hardware? > i made some search in the devel handbook and did not found the solution. > What is wrong here? > Can you enlight me please? > > > Many thanks in advance and bests regards > > Raoul > rmgls@wanadeoo.fr > > ---cut--- > > .data > .align 4 > params: .word 0x330,2,1 # midi port => enabling IO ??? > > .text > .align 4 > .global _start > _start: > nop > pushl params > pushl $0x3 I believe this should be $0x4, as you want to *set* the values, not get them. You also need to open the file "/dev/io". I believe that leaving this file open for anything more than a handful of instructions would be a bad thing, but I'm not going to verify it. Best of luck, movl $0Xa5,%eax > int $0x80 > addl $0x08,%esp > movw $0x331,%dx # status register > inb %dx,%al > # ... > pushl $0 # exit > movl $0x1,%eax > int $0x80 > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > -- Mike Meyer http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information.