From owner-freebsd-questions Mon Mar 18 15:32:47 2002 Delivered-To: freebsd-questions@freebsd.org Received: from vulcan.rsasecurity.com (vulcan.rsasecurity.com [204.167.114.130]) by hub.freebsd.org (Postfix) with SMTP id 40FDD37B4DF for ; Mon, 18 Mar 2002 15:31:50 -0800 (PST) Received: from sdtihq24.securitydynamics.com by vulcan.rsasecurity.com via smtpd (for hub.FreeBSD.org [216.136.204.18]) with SMTP; 18 Mar 2002 23:31:11 UT Received: from ebola.securitydynamics.com (ebola.securid.com [192.80.211.4]) by sdtihq24.securid.com (Pro-8.9.3/Pro-8.9.3) with ESMTP id SAA16539 for ; Mon, 18 Mar 2002 18:31:08 -0500 (EST) Received: from spirit.dynas.se (localhost [127.0.0.1]) by ebola.securitydynamics.com (8.10.2+Sun/8.9.1) with SMTP id g2INViK00580 for ; Mon, 18 Mar 2002 18:31:44 -0500 (EST) Received: (qmail 23721 invoked from network); 18 Mar 2002 23:31:41 -0000 Received: from explorer.rsa.com (HELO mikko.rsa.com) (10.81.217.59) by spirit.dynas.se with SMTP; 18 Mar 2002 23:31:41 -0000 Received: (from mikko@localhost) by mikko.rsa.com (8.11.6/8.11.6) id g2INVdM86443; Mon, 18 Mar 2002 15:31:39 -0800 (PST) (envelope-from mikko) Date: Mon, 18 Mar 2002 15:31:39 -0800 (PST) From: Mikko Tyolajarvi Message-Id: <200203182331.g2INVdM86443@mikko.rsa.com> To: jshamlet@hotmail.com Cc: questions@freebsd.org Orig-To: "Seth Henry" Subject: Re: Need help porting linux code to FreeBSD Newsgroups: local.freebsd.questions References: Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In local.freebsd.questions you write: >Hello all, >This is my first time doing any real "hardware" coding, but I have written a >lot of C code for other things. >I am working on turning a Compaq IA-1 internet appliance into a useable >X-terminal. A great deal of work has gone into porting Linux to this device, >but less so on the FreeBSD side. Since I prefer FreeBSD, I thought I would >tackle customizing it to fit the hardware. The IA-1 has a number of >functions that are available through the VIA chipset by way of setting bits >in the chipset registers. A linux program exists to poke and prod this >register into turning these functions on and off (in this case, the panel >lights and the display backlight). It uses the io.h library, and calls outl, >outb, and inl. >I would like to rewrite this code so that I can embed it in things like the >screen blanker (since the LCD doesn't respond to DPMS), and other user-land >programs to control the lights. (the power light alone would be nice). >So, where would I need to start looking to translate this code from Linux to >FreeBSD? In particular, where can I dig up information on the equivalent to >io.h (or is there an io.h in FreeBSD?) I haven't installed all of the source >trees, but I did install the headers. However, I haven't found this file. Try . And you need to open /dev/io at the beginning of the program, e.g.: if (open("/dev/io", O_RDWR, 0) < 0) { perror("/dev/io"); return 1; } Hmm... I think the arguments to some of the out*() functions may be swapped, compared to Linux as well. Check the header file. $.02, /Mikko -- Mikko Työläjärvi_______________________________________mikko@rsasecurity.com RSA Security To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message