Subject: /dev/mem ???
To: None <port-mac68k@NetBSD.ORG>
From: Hauke Fath <saw@sun0.urz.uni-heidelberg.de>
List: port-mac68k
Date: 06/12/1996 18:00:51
Hi,

playing around with /dev/mem, I saw some peculiarities:

o  though running setuid root/setgid kmem, a little program cannot open
/dev/mem; open( "/dev/mem", O_RDWR) gives 1 (EACCES?)

o  "hexdump /dev/mem" run as root dumps core:


Kernel Illegal Instruction trap.
trap type 2, code = 0, v= 0
kernel: Illegal instruction trap
pid = 143, pc = 0x00000028, ps = 0x00002008, sfc = 0x00000001, dfc = 0x00000001
Registers:
             0        1        2        3        4        5        6        7
dreg: 000010ff 000003ff 00000000 000d1000 00001000 00000000 06c46c00 00000010
areg: 000d1004 0000b004 008a6f20 008a6f28 008a6ed8 008a6f20 008a6e1c ffffc8d4

Kernel stack (008a6d7c):
008a6d7c: 00000000  000010ff  000003ff  00000000  000d1000  00001000  00000000
06c46c00
008a6d9c: 00000010  000d1004  0000b004  008a6f20  008a6f28  008a6ed8  008a6f20
008a6e1c
008a6dbc: ffffc8d4  00000000  20080000  00280010  20040008  2a8ea008  0eee0709
fff80481
008a6ddc: 0000b000  0000b000  00000000  51c91000  00001000  000164a6  000d1000
0000b000
panic: Illegal instruction
Stopped at      _Debugger+0x6:  unlk    a6
db> t
_Debugger(195c8,8a48a,8a6d40,2,8a6d6c) + 6
_panic(8a48a,0,d1000,1000,0) + 34
_trap(2,0,0) + 1c0
fault(?)
_uiomove(d1000,1000,8a6f28,6c72c00,6c46c00) + c
_mmrw(200,8a6f28,0) + 10a
_spec_read(8a6ed8,8a6eec,30a1a,8a6ed8,e8) + a6
_ufsspec_read(8a6ed8) + 28
_vn_read(6c7a700,8a6f28,6c72c00) + b8
_sys_read(6c46c00,8a6f88,8a6f80) + a2
_syscall(3) + 10a
_trap0() + e
db>

-- The kernel is -current as of 6 June 96.

Has anyone out there had more success with /dev/mem??



	hauke

---
"It's never straight up and down"     (DEVO)