is it possible to mmap /dev/kmem or /dev/mem?

From: Dirk Grunwald <grunwald_at_foobar.cs.colorado.edu>
Date: Wed, 21 Jan 1998 11:17:04 -0700 (MST)

Does anyone know if it's possible to mmap() /dev/mem or /dev/kmem? My
experiments appear to indicate it's not, but the kernel source code
makes me think it should be possible (at least for /dev/mem).

I'm trying to emulate the 'hrtime' routine in Solaris. I need
inexpensive access to a timer. I want to mmap() the 'time' symbol from
/vmunix into a R/O page, and then atomically read the timer, much like
the gettimeofday() call does in the kernel.

I know about timing with the the RPCC instruction, but I'm doing this
on a small mulitprocessor, and thus want a single monotonically
non-decreasing timer.

The alternate plan is to used interrupts to occasionally update a
global timer variable and then have the threads read that atomically.

Dirk Grunwald Assoc. Prof, Univ. of Colorado at Boulder
Received on Wed Jan 21 1998 - 19:17:13 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:37 NZDT