|
|
1.1 ! root 1: ! 2: ! 3: ram Device Driver ram ! 4: ! 5: ! 6: ! 7: ! 8: RAM device driver ! 9: ! 10: ! 11: The COHERENT ram devices allow the user to allocate and use the ! 12: random access memory (RAM) of the computer system directly. A ! 13: typical use is for a RAM disk, which is a COHERENT file system ! 14: kept in memory rather than on a diskette or hard disk. ! 15: ! 16: The COHERENT RAM device driver has major number 8. It can be ac- ! 17: cessed either as a block-special device or as a character-special ! 18: device. The high-order bit of the minor number gives a RAM ! 19: device number (0 or 1), allowing the use of up to two RAM devices ! 20: simultaneously. The low-order seven bits specify the device size ! 21: in 64 KB (128 block) increments. The first open call on a RAM ! 22: device with nonzero size (1 to 127) allocates memory for the ! 23: device; the open call fails if sufficient memory is not avail- ! 24: able. Accessing a RAM device with a minor number specifying size ! 25: 0 frees the allocated memory, provided all earlier open calls ! 26: have been closed. ! 27: ! 28: Initially, COHERENT includes two RAM block devices, 512KB device ! 29: /dev/ram0 (8, 8) and 192KB device /dev/ram1 (8, 131). It also ! 30: includes /dev/ram0close (8, 0) and /dev/ram1close (8, 128). The ! 31: system administrator should change the RAM devices to sizes ap- ! 32: propriate for available system memory. ! 33: ! 34: ***** Note ***** ! 35: ! 36: The COHERENT installation program /etc/build uses RAM device ! 37: /dev/ram1 as a RAM disk during installation. Programs compress, ! 38: uncompress, zcat and fsck sometimes use /dev/ram1 as a temporary ! 39: storage device. Users should avoid using /dev/ram1 as a RAM disk ! 40: because of these programs. ! 41: ! 42: ***** Examples ***** ! 43: ! 44: The following example formats and mounts a 512-kilobyte RAM disk ! 45: on directory /fast. ! 46: ! 47: ! 48: mkdir /fast ! 49: /etc/mkfs /dev/ram0 1024 ! 50: /etc/mount /dev/ram0 /fast ! 51: ! 52: ! 53: When the RAM disk is no longer needed, its allocated memory can ! 54: be freed as follows: ! 55: ! 56: ! 57: /etc/umount /dev/ram0 ! 58: cat /dev/null >/dev/ram0close ! 59: ! 60: ! 61: ! 62: ! 63: ! 64: COHERENT Lexicon Page 1 ! 65: ! 66: ! 67: ! 68: ! 69: ram Device Driver ram ! 70: ! 71: ! 72: ! 73: The next example replaces the default /dev/ram0 with a one- ! 74: megabyte device containing a COHERENT file system. The new minor ! 75: number 16 specifies RAM device 0 and size 16 times 64 kilobytes ! 76: (i.e., one megabyte). The new RAM device contains 2,048 blocks ! 77: of 512 bytes each. ! 78: ! 79: ! 80: rm /dev/ram0 ! 81: /etc/mknod /dev/ram0 b 8 16 ! 82: /etc/mkfs /dev/ram0 2048 ! 83: ! 84: ! 85: ***** Files ***** ! 86: ! 87: /dev/ram* ! 88: ! 89: ***** See Also ***** ! 90: ! 91: compress, device drivers, fsck, mkfs, mount, umount, uncompress, ! 92: zcat ! 93: ! 94: ***** Notes ***** ! 95: ! 96: Moving frequently used commands or files to a RAM disk can im- ! 97: prove system performance substantially. However, the contents of ! 98: a RAM device are lost if the system loses power, reboots, or ! 99: crashes, so changes to files kept on a RAM disk should be stored ! 100: frequently to the hard disk or to diskette. ! 101: ! 102: If a RAM device uses most but not all of available system memory, ! 103: its open call will succeed but subsequent commands may fail be- ! 104: cause insufficient memory remains for the system. ! 105: ! 106: ! 107: ! 108: ! 109: ! 110: ! 111: ! 112: ! 113: ! 114: ! 115: ! 116: ! 117: ! 118: ! 119: ! 120: ! 121: ! 122: ! 123: ! 124: ! 125: ! 126: ! 127: ! 128: ! 129: ! 130: COHERENT Lexicon Page 2 ! 131: ! 132:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.