--- Trevor Warren trevorwarren@yahoo.com wrote:
--- "S. Krishnan" sri_krishnan@yahoo.com wrote: The issue still remains.....should i or shouldn't i use a C prog to make this BIOS memory access, some1 on the LIH was kind enough to suggest this soln. Do u think this is the right 1 around...
-->Untested code
int fd = open ("/dev/mem", O_RDONLY); seek (fd, 0xfcdbd, SEEK_SET); read (....); ... close (fd);
-->Untested code
A reference to the PROC (5) man page describes /dev/mem as providing direct access to the physical memory, before it is virtualized into different user processes. However, it clarifies that /dev/mem is *not* the same as the mem in proc. I quote below:
<snip>
mem
This is not the same as the mem (1:1) device, despite the fact that it has the same device numbers. The /dev/mem device is the physical memory before any address translation is done, but the mem file here is the memory of the process that accesses it. This cannot be mmap(2) \h'-1''ed currently, and will not be until a general mmap(2) is added to the kernel. (This might have happened by the time you read this.)
<endsnip>
I guess you should be OK if you try to open /dev/mem and do a seek on the resulting handle. Please check the permissions on the device before you execute the program - my BSD 4.2 box here at work has /dev/mem set to be accessible only to root. Try it and see if it works; I think it ought to. If not you can always write that kernel module...
or would i be forced into writin a Kernel Device driver 'cause of the reasons of my c/c++ progs havin their own memory space which isn't allowed to directly access memory locations.
As above.
Will this iostream() operation opening a read buffer into /dev/mem be the right way to get the job done.
That is one way; another would be to use the C file operations functionality in glibc rather than this C++ stuff, which I would advise; it's less complex (at least for me).
Also if 0xfcdcd the corresponding 32bit address for f000:cdcd in REAL mode access.
do a ((0xf000<<4) | 0xcdcd) - this will verify that the result is 0xfcdcd.
HTH,
Krishnan
__________________________________________________ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1