1RAM(4)                     Kernel Interfaces Manual                     RAM(4)
2
3
4

NAME

6       ram - ram disk driver
7

SYNOPSIS

9       /sys/conf/SYSTEM:
10            NRAM ram_size  # RAM disk size (512-byte blocks)
11
12       major device number(s):
13            block: 3
14       minor device encoding:
15            must be zero (0)
16

DESCRIPTION

18       The ram pseudo-device provides a very fast extended memory store.  It's
19       use is intended for file systems like /tmp and applications which  need
20       to access a reasonably large amount of data quickly.
21
22       The  amount  of memory dedicated to the ram device is controlled by the
23       NRAM definition in units of 512-byte blocks.  This is also patchable in
24       the  system binary through the variable ram_size (though a patched sys‐
25       tem would have to be  rebooted  before  any  change  took  effect;  see
26       adb(1)).   This makes it easy to test the effects of different ram disk
27       sizes on system performance.  It's important to  note  that  any  space
28       given  to  the ram device is permanently allocated at system boot time.
29       Dedicating too much memory can adversely affect system  performance  by
30       forcing the system to swap heavily as in a memory poor environment.
31
32       The  block file accesses the ram disk via the system's buffering mecha‐
33       nism through a buffer sharing arrangement with the  buffer  cache.   It
34       may be read and written without regard to physical disk records.  There
35       is no `raw' interface since no speed advantage is  gained  by  such  an
36       interface with the ram disk.
37

DISK SUPPORT

39       The ram driver does not support pseudo-disks (partitions).  The special
40       files refer to the entire `drive' as a  single  sequentially  addressed
41       file.
42
43       A typical use for the ram disk would be to mount /tmp on it.  Note that
44       if this arrangement is recorded in /etc/fstab then /etc/rc will have to
45       be  modified  slightly to do a mkfs(8) on the ram disk before the stan‐
46       dard file system checks are done.
47

FILES

49       /dev/ram            block file
50       /dev/MAKEDEV        script to create special files
51       /dev/MAKEDEV.local  script to localize special files
52

SEE ALSO

54       hk(4), ra(4), rl(4), rk(4), rp(4), rx(4), si(4), xp(4)  dtab(5),  auto‐
55       config(8)
56

DIAGNOSTICS

58       ram: no space.  There is not enough memory to allocate the space needed
59       by the ram disk.  The ram disk is disabled.  Any attempts to access  it
60       will return an error.
61
62       ram:  not  allocated.   No  memory was allocated to the ram disk and an
63       attempt was made to open it.  Either not enough memory was available at
64       boot time or the kernel variable ram_size was set to zero.
65

BUGS

67       The ram driver is only available under 2.11BSD.
68
69
70
713rd Berkeley Distribution      Januray 27, 1996                         RAM(4)
Impressum