From owner-freebsd-hackers Fri Aug 9 16:40:20 2002 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 6524A37B400 for ; Fri, 9 Aug 2002 16:40:15 -0700 (PDT) Received: from swan.mail.pas.earthlink.net (swan.mail.pas.earthlink.net [207.217.120.123]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E5D543E3B for ; Fri, 9 Aug 2002 16:40:15 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from dialup-209.245.136.56.dial1.sanjose1.level3.net ([209.245.136.56] helo=mindspring.com) by swan.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 17dJMV-0005L5-00; Fri, 09 Aug 2002 16:40:07 -0700 Message-ID: <3D54527B.9E27D6C3@mindspring.com> Date: Fri, 09 Aug 2002 16:38:35 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: hal@telefonica.net Cc: freebsd-hackers@freebsd.org Subject: Re: Memory below 1 MB References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG hal@telefonica.net wrote: > As I explained in another message, I am writing some graphics code > (both for fun and educational purposes) and need to access memory > below 1 MB. I have tried it by opening /dev/mem, calling mmap, > i386_vm86 and even opening /dev/io to change permission levels. > However, the program (and actually the physical terminal) hangs > when doing the interruption call. > > I attach the test program within this mail. If attachments are not > part of this list's etiquette, sorry, it will not happen again. > Compile with "gcc -o whatever vesainfo.c" if you want to have a > look (you will need root privileges to execute it). > > Well, I am completely desperate. I tried everything I could, but > for some magical reasons, this low-level access does not work. Any ideas? See /usr/srcsys/pci/agp* for the sources to agp.ko. You can't do what you want to do without using a device driver to allocate the physical resource on your behalf, since you are talking about physical memory. This is what I told you the first time you asked. By persisting, you remind me of a non-technical manager I had, who, when she didn't get the answer she wanted to hear, would ask over and over and over again, in different ways, totally certain that you were not very bright, and just needed help understandinging the question, and the answer couldn't simply be what it was, because that would be inconvenient. If you insist on using VM86, the only real example is in the X11 source code: xsrc/xc/programs/Xserver/hw/xfree86/vga256/drivers/s3_savage/lrmi.c If you can wade through it, the only other program that uses it is in: /usr/src/usr.bin/doscmd But it does so much more to emulate the full DOS environment that the calls you actually need t do something minimal are lost and buried in the rest of it. Good luck using vm86, if you insist on that route. Otherwise, look at the source code to "agp.ko". -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message