[comp.sys.sun] Strange behaviour of /dev/mem

Mark.Bush@prg.oxford.ac.uk (Mark Bush) (04/02/91)

The manual page (SunOS4.1.1) for mem(4S) says:

  All Systems
     mem is a special file that  is  an  image  of  the  physical
     memory  of  the  computer.   It may be used, for example, to
     examine (and even to patch) the system.

On the Sun4 and Sun3 systems here, the result of `wc < /dev/mem' gives the
size of physical memory (sometimes a small number of whole kbytes short).
This is also true of SS2s.

However, on SLC, IPC and SS1+ machines here, the result is always exactly
4Meg regardless of the amount of physical memory the machines have!

I can't find anything in the manuals to explain this behaviour.  Anyone
able to explain why /dev/mem falls short on these machines?

Mark

glenn@uunet.uu.net (Glenn Herteg) (04/24/91)

| However, on SLC, IPC and SS1+ machines here, the result is always exactly
| 4Meg regardless of the amount of physical memory the machines have!

RTFM, *carefully*!:

mem is a special file that is an *image of the physical memory* of the computer.

Some machines may not have contiguous physical memory, to allow for
different sizes of SIMMS to be plugged in.  Probably there is a "hole"
after the first 4 Meg, and reading /dev/mem in a continuous stream finds
an apparent EOF when it tries to read a hole.