MEM(4) —
NAME
mem, kmem, kmem1, kmem2, kmem4, ros, afpamem, pcmem, pc0a, rpc0a − memory devices
DESCRIPTION
Mem is a special file that is an image of the main memory of the computer. It may be used, for example, to examine -- and even to patch -- the system.
Byte addresses in mem are interpreted as physical memory addresses. References to non-existent locations cause errors to be returned. The I/O space (segment 0xf) cannot be accessed through this special file.
The file kmem is the same as mem except that kernel virtual memory, rather than physical memory, is accessed. Although I/O space can be accessed through this file, this use of kmem is discouraged, since the width of the access (byte, halfword or fullword) is not controllable by the user.
The special file /dev/bus (bus(4)) can be used to gain direct access to I/O and memory addresses on the system I/O bus.
For the IBM RT PC only:
The files kmem1, kmem2, and kmem4 are similar to kmem except that they guarantee access by bytes, halfwords and fullwords, respectively. They are provided primarily to allow access to the I/O space of the IBM RT PC (segment 0xf), although any valid kernel virtual address may be given. When using a kmemx file, both the user’s buffer and the file offset must be aligned on an x-byte boundary, and the length must be a multiple of x bytes. If these conditions are not met, both read(2) and write(2) will fail with errno set to EINVAL.
The file ros is similar to mem, except that it refers to the Read Only Storage on the processor card. There is no ros on the IBM 6152 Academic System.
Afpamem is used to check, load, and verify the control store of the Advanced Floating Point Adapter (AFPA). This control store consists of 64-bit words; data must be read or written in multiples of 64 bits (eight bytes; two words). The data must be written to, or read from, an address in the user’s address space which is word aligned. Control store access to the AFPA must be enabled before afpamem access is allowed. Note that the normal user of afpamem is afpacode(8R). The AFPA is valid only on the IBM RT PC.
Examining and patching device registers is likely to lead to unexpected results when read-only or write-only bits are present.
For the IBM 6152 Academic System only:
The files pcmem, pc0a, and rpc0a allow access to the PS/2’s memory via the microchannel. Pcmem allows access to all of the physical memory on the microchannel, while pc0a and rpc0a allow access only to extended memory (above 1 megabyte). It is expected that the pcmem special device will be used by programs that wish to access PS/2 memory, while pc0a and rpc0a are expected to be used as a “fast” temporary filesystem or for swapping. For these purposes a minimum of 3 megabytes of PS/2 memory are required. Note: The use of pcmem, pc0a, or rpc0a can cause unpredictable results when using suspend on the 6152.
On the 6152, I/O is controlled through the PCIF which begins at 0xd0000000. For more information on how to use the PCIF see the IBM 6152 Technical Reference.
FILES
/dev/mem
/dev/kmem
/dev/kmem1
/dev/kmem2
/dev/kmem4
For the IBM RT PC only:
/dev/ros
/dev/afpamem
For the IBM 6152 only:
/dev/pcmem
/dev/pc0a
/dev/rpc0a
SEE ALSO
BUGS
There is no driver to do ior’s and iow’s to the CPU’s I/O bus. Thus it is not possible to access the registers of the memory management unit and the I/O interface modules.
If more than 8M of physical address space is used by memory and DMA is in use, reads of /dev/ros will fail.
PRPQs 5799-WZQ/5799-PFF: IBM/4.3 — Sept 1988