Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 09 Aug 2002 16:38:35 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        hal@telefonica.net
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Memory below 1 MB
Message-ID:  <3D54527B.9E27D6C3@mindspring.com>
References:  <E17dIaT-0000Wi-00@ash.drims.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3D54527B.9E27D6C3>