1.\" Copyright (c) 1986, 1991 Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" %sccs.include.redist.man% 5.\" 6.\" @(#)mem.4 6.3 (Berkeley) 03/27/91 7.\" 8.Dd 9.Dt MEM 4 tahoe 10.Os 11.Sh NAME 12.Nm mem , 13.Nm kmem , 14.Nm vmem 15.Nd main memory 16.Sh DESCRIPTION 17The special file 18.Nm /dev/mem 19is an interface to the physical memory of the computer. 20Byte offsets in this file are interpreted as physical memory addresses. 21Reading and writing this file is equivalent to reading and writing 22memory itself. 23Only offsets within the bounds of 24.Nm /dev/mem 25are allowed. 26.Pp 27Kernel virtual memory is accessed through the interface 28.Nm /dev/kmem 29in the same manner as 30.Nm /dev/mem . 31Only kernel virtual addresses that are currently mapped to memory are allowed. 32.Pp 33The file 34.Nm /dev/vmem 35allows access to the mapped portion of the 36.Tn VERSAbus 37.Tn I/O 38space. On the Tahoe the upper megabyte 39of the physical address space is accessible through 40this file (0xfff00000 through 0xffffffff). 41Accesses to the upper 64 kilobytes of 42the 43.Tn I/O 44space result in 45.Tn VERSAbus 46transfers with a 4716-bit address (the offset in this region) and a 48.Dq No non-privileged short Tn I/O 49.Tn VERSAbus 50address modifier. 51Accesses to the remainder of the mapped region, 52result in 53.Tn VERSAbus 54transfers with a 24-bit address 55and a ``non-privileged standard'' 56.Tn VERSAbus 57address 58modifier. This region is actually part of the region 59between 0xfeff0000 and 0xffff0000 60which generates 61.Tn VERSAbus 62transfers with a 24-bit address. 63Accesses to the remainder of the one gigabyte 64.Tn I/O 65space 66generate transfers that utilize a 32-bit address with 67a ``non-privileged extended'' address modifier. Any 6832-bit address generated by a cpu access to this part 69of the 70.Tn I/O 71space have the upper two bits zero; thus, 72for example, an access to physical address 0xfe000000 73causes the address 0x3e000000 to be supplied in the 74resultant 75.Tn VERSAbus 76read/write cycle. 77.Pp 78On the Tahoe, the 79base address for the 80per-process data of the current process 81is virtual address 0xbffff000. 82.Sh FILES 83.Bl -tag -width Pa -compact 84.It Pa /dev/mem 85.It Pa /dev/kmem 86.It Pa /dev/vmm 87.El 88.Sh HISTORY 89The 90.Nm mem , 91.Nm kmem 92files appeared in 93.At v6 . 94The file 95.Nm vmem 96appeared in 97.Bx 4.3 tahoe . 98.Sh BUGS 99Memory files are accessed one byte 100at a time, an inappropiate method for some 101device registers. 102