mem -- memory definition bootstring


mem=[range[,range... ]] [flag...]...


boot(HW) attempts to determine how much RAM a system has, and where it is located. On most systems this automatic search succeeds in finding the memory. However, on some machines the search does not find all the available memory, or finds memory which does not actually exist (or which should not or cannot actually be used).

It is possible to control where, and how, boot searches for RAM by using either a standalone command defined in /etc/default/boot (see boot(F)) or a bootstring argument as shown in ``Syntax''. The optional range is specified as either:

start - end
The memory begins at address start and ends prior to address end. If the end is prior to the start, the two addresses are exchanged and the /d flag is assumed.

start + size
The memory begins at address start and continues for at most size bytes. (So end is equivalent to start + size.)
All ranges should be specified so that the start and end addresses of each range are aligned on 4KB (page) boundaries. Unaligned ranges are automatically trimmed to page boundaries.

The start and end addresses, and the size, are specified in either kilobytes (1024 bytes per kilobyte) or megabytes (1024 kilobytes per megabyte); a suffix of k is kilobytes, and m is megabytes.

For example, all of the following mean the 2MB starting at address 1MB:

The k or m suffix is required.

The optional flags are:

Scan the memory downwards (from the end towards the start address); normally boot verifies the memory range by scanning from the start towards the end. Specifying /d is equivalent to giving an end address lower than the start address.

Load the UNIX system kernel's text below 16m; this flag is recommended when booting earlier releases (that is, versions earlier than Release 3.2 Version 4.0) of SCO® UNIX®.

Specify a memory range as not DMAable. All memory above 16m is automatically marked non-DMAable. Only the standalone program's text is placed in non-DMAable memory by boot.

Print a concise summary of the RAM found. This summary can be written down and used as the mem=input on a later attempt to force boot to find the same memory it found on this boot (provided none of the described RAM was removed in the meantime).

Reserve a memory range; boot must not load any part of the standalone program into it. However, the memory is available for use by the UNIX system. (To hide memory from both boot and the UNIX system, simply do not include it in any range.)

This memory is ``special'' and is best used to load the standalone program's text (not data) section. ``Shadow RAM'' usually should be so marked, but shadowing RAM can only be used if the shadowing feature is disabled: that is, if the shadow RAM is hidden by a ``shadowed'' copy of the machine's startup ROM, then the underlying RAM is inaccessible to both boot and the UNIX system kernel and must not be used. Only the standalone program's text is placed in ``special'' memory by boot.
All memory below 640k is automatically determined by the machine, and there is never any memory in the range 640k-1m. All mem= descriptions of this ``base memory'' below 1m are silently ignored. Hence, mem= should only be used to specify the extended memory configuration at and above 1m.

The default mem= specification is equivalent to:

on most machines (plus up to 640KB of base memory). boot scans each range and 16m-512m by default, stopping its scan as soon as no memory can be found. Thus, if there is a ``hole'' in the specified memory range, all RAM above the first hole in the range will not be found by boot.

Consider a machine with:

By default, boot would only find: Most of the RAM -- the 6MB starting at address 10MB -- is not found (due to the hole starting at address 3MB). Clearly then, on such a machine, it is advisable to define the memory which really exists.

This machine can be specified as:

Note that 32720k is the address starting 48k before 32m (since memory ranges should be aligned on 4KB boundaries). Since all memory above 16m is automatically marked as non-DMAable, the above is equivalent to:
A simple mem=/p will print out the memory found automatically. For the example machine, this is:
   Memory found: 0k-512k,1m-3m,16m-20m/n
To print out the memory found for a specific configuration, /p must be included in the mem= specification. Thus, adding /p to the first specification above:


would print out the equivalent of the second definition (on the described machine):

   Memory found: 0k-512k,1m-3m,10m-16m,16m-20m/n,32720k-32m/d/s
On most machines boot scans the defined memory ranges and deletes from the definition any RAM not actually found. Thus, if the following is specified on the described machine:


the printed result would be:

   Memory found: 0k-512k,1m-3m,12m-16m,16m-20m/n,32720k-32m/d/s
Note that the RAM from 10 to 12MB, despite existing, was not found by boot, because it was excluded from the mem= definition.

On most machines, shadowing must be disabled using the machine's setup procedures. boot automatically disables startup ROM shadowing only on a few machines. The RAM hidden by shadowing the startup ROM cannot be used by boot or the UNIX system kernel unless the shadowing is disabled.

If your machine has extended memory, you will see the following message on booting:

Sizing memory

boot then outputs a dot for every 1MB of memory sized. Memory sizing may take quite some time depending on the amount of memory that boot has to check. If you specified mem=/p at the Boot prompt or in the file /etc/default/boot, a summary of the memory found is printed when sizing has finished.

boot loads the kernel after it has successfully determined the amount of memory available, as shown in this example:

   :unix mem=/p

Memory sizing ................... Memory found: 0k-640k,1m-16m,16m-20m/n Loading kernel hd(40)unix .text ............................................................ ............................................................ ........................ Loading kernel hd(40)unix .data ............................................................ ........................ Loading kernel hd(40)unix .bss

System loaded, press <Return> to start:

Vendor-specific memory mapping

The file /etc/vendorid is provided to permit boot to identify the vendor of the current system. This file contains ``magic'' strings corresponding to areas of the BIOS ROM specific to given OEMs; OEMs can add their own characteristic ID strings to the file. At boot time, the BIOS ROM is scanned and checked against /etc/vendorid to determine which vendor the machine was made by.

If a match is obtained for vendor name, then boot checks for the existence of a standalone program called /vendor/name/memory. If this program exists, it is executed; otherwise the current memory detection method is used. The program /vendor/name/memory is used to detect system memory and can contain code specific to a given OEM's products.

This feature permits vendors to provide a standalone program (a small model 8086 x.out binary) that writes the details of memory found into the bootinfo data structure at physical address 0x0800. On success the standalone program returns a status code of 0 to boot. On receiving this status, boot verifies the checksum of the bootinfo structure, then uses the data in it to load the kernel.

(A negative return status from an OEM memory standalone program causes boot to return to the command line prompt. A positive result causes boot to run its own memory detection code.)


Older versions of boot did not trim the mem= range to page boundaries. This could cause problems on some machines.

See also

boot(F), boot(HW)

Information about developing device drivers is available at the Consolidated Hardware Development (HDK) Web Page

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003