1.\" $OpenBSD: mem.4,v 1.4 2018/01/12 04:36:44 deraadt Exp $ 2.\" 3.\" Copyright (c) 2004, Miodrag Vallat. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 15.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 18.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 22.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 23.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24.\" POSSIBILITY OF SUCH DAMAGE. 25.\" 26.Dd $Mdocdate: January 12 2018 $ 27.Dt MEM 4 hppa 28.Os 29.Sh NAME 30.Nm mem , 31.Nm kmem 32.Nd memory files and memory controller 33.Sh SYNOPSIS 34.Cd "mem* at mainbus0 flags 0x0000" 35.Sh DESCRIPTION 36The 37.Nm 38driver controls and restricts access to the systems memory 39by the hardware buses and the processor. 40.Pp 41It also provides an interface to userland through the special files 42.Pa /dev/mem 43and 44.Pa /dev/kmem . 45Physical memory is accessed through 46.Pa /dev/mem , 47while kernel virtual memory is accessed through 48.Pa /dev/kmem . 49Access to kernel virtual addresses not currently mapped to memory will fail. 50On hppa, the physical memory range is always contiguous and starts at 51address 0; kernel virtual memory begins at address 0 as well. 52.Pp 53Even with sufficient file system permissions, 54these devices can only be opened when the 55.Xr securelevel 7 56is insecure or when the 57.Va kern.allowkmem 58.Xr sysctl 2 59variable is set. 60.Sh FILES 61.Bl -tag -width /dev/kmem -compact 62.It Pa /dev/mem 63.It Pa /dev/kmem 64.El 65.Sh SEE ALSO 66.Xr securelevel 7 67.Sh CAVEATS 68On some systems featuring a 69.Dq Viper 70memory controller, 71.Ox 72may not configure bus arbitration correctly, causing the boot process 73to freeze during either 74.Nm 75or 76.Xr cpu 4 77device probe. 78.Pp 79In this case, a different initialization strategy can be achieved by 80setting 81.Ar flags 82to 0x0001 83.Po 84see 85.Xr boot_config 8 86for details 87.Pc . 88