From owner-freebsd-hackers@FreeBSD.ORG Sat Mar 12 18:47:06 2005 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 1C9F616A4CE for ; Sat, 12 Mar 2005 18:47:06 +0000 (GMT) Received: from mail28.sea5.speakeasy.net (mail28.sea5.speakeasy.net [69.17.117.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id B379643D3F for ; Sat, 12 Mar 2005 18:47:05 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: (qmail 26057 invoked from network); 12 Mar 2005 18:47:05 -0000 Received: from gate.funkthat.com (HELO hydrogen.funkthat.com) ([69.17.45.168]) (envelope-sender ) by mail28.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 12 Mar 2005 18:47:05 -0000 Received: from hydrogen.funkthat.com (pcryty@localhost.funkthat.com [127.0.0.1])j2CIl3GH058549; Sat, 12 Mar 2005 10:47:04 -0800 (PST) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.12.10/8.12.10/Submit) id j2CIl3gg058548; Sat, 12 Mar 2005 10:47:03 -0800 (PST) Date: Sat, 12 Mar 2005 10:47:03 -0800 From: John-Mark Gurney To: Alex Burke Message-ID: <20050312184703.GV89312@funkthat.com> Mail-Followup-To: Alex Burke , FreeBSD-HACKERS References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.2-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html cc: FreeBSD-HACKERS Subject: Re: Low level hardware access in FreeBSD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: John-Mark Gurney List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Mar 2005 18:47:06 -0000 Alex Burke wrote this message on Sat, Mar 12, 2005 at 18:12 +0000: > I am just wondering how I can access either BIOS calls, or preferably > registers under FreeBSD? > > I am trying to write a simple system capable of displaying graphics on > the screen, and I am pretty sure I can mmap the VGA memory to my > programs address space. correct, you can do this by opening /dev/mem... > However, to be able to output graphics onto the screen I think I need > to change the state of the VGA registers from text mode (I am guessing > thats what the console driver uses) to graphical mode (of which i know > there exist a couple) - but I think that involves programming > registers and I dont know how to do that under FreeBSD. You don't want to access the registers directly because then you could get syscons confused on what the state is... Take a look at vidcontrol.. You can use ioctl's documented in sys/fbio.h to change modes... > Also, for the FreeBSD console driver to pick the console back up once > it finished working, would I be required to reset the VGA registers > back to text mode? If you use the sys/fbio.h ioctl's you'll need to do that... I also found, that you have to becareful to restore the video mode. Sometimes your app will segfault, and won't restore the video display, but the machine is still running.. You can also check out svgalib or sdl in ports... They also provide the ability to do console graphics... sdl I believe can also run under X11 which can be useful. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."