ram

Allocate RAM to the VM

Synopsis:

ram [start_address,]length

Description:

The ram option allocates RAM to the VM, at the guest-physical address specified by start_address for the number of bytes specified by length.

If you don't specify this option, by default the qvm process allocates the RAM immediately following the highest RAM/ROM address already allocated in the guest system.

When you specify the length argument, you can use either hexadecimal notation (e.g., 0xa0000 for 640 KB), or human-readable abbreviations (e.g., 16M for 16 MB).

Note:

You must allocate RAM before components that refer to the guest memory (see Exceptions in the Configuration chapter).

RAM that appears to the guest as contiguous is unlikely to be contiguous in host-physical memory (see Memory in the Understanding QNX Virtual Environments) chapter.

Example:

The following allocates 128 MB of RAM to the VM, starting at address 0x80000000:

ram 0x80000000,128M

The start address for the memory allocation is the address inside the VM: the guest-physical address. If this RAM location is to be used for the guest's bootable image, the guest must be configured to look for the image at this address inside its memory. For example, assuming the example above is for a QNX Neutrino OS guest, you must specify this location in its buildfile:

[image=0x80000000]
[virtual=aarch64le,elf] .bootstrap = {
   [+keeplinked] startup-armv8_fm -v -H
   [+keeplinked] PATH=/proc/boot procnto -v
}

Allocating memory on x86 boards

Due to the long history of the x86 platform, it is likely that a guest OS will expect the 128 KB of VGA memory to be mapped at 0xa0000. Though the hypervisor doesn't offer emulation of a VGA device, you should reserve this region in guest-physical memory so that the qvm process assembling the VM can't allocate it (see reserve in this chapter).

Similarly, the region between 0xc0000 and 0xfffff has traditionally been known as the BIOS area. You should configure this area, but you should use the rom option to remove it from the memory map passed on to the guest.

Thus, to properly virtualize x86 hardware, instead of specifying memory allocations like this:

ram 1024M

you must reserve the location for the VGA, specify the ROM for the BIOS, and specify the RAM memory, so that your memory configuration for an x86 guest looks something like this:

ram 0,0xa0000
reserve loc 0xa0000,0x20000
rom 0xc0000,0x40000
ram 1m,1023m

where:

For cases where the guests doesn't expect to find a component (e.g., legacy device, BIOS) at a specific location, you may specify only the size of the memory allocation and let the qvm process decide on the location. However, if the guest expects memory to be available for a specific purpose at a specific location, you must respect these requirements, just as you would for an OS running directly on an x86 board.

See Configuring memory in the Understanding QNX Virtual Environments chapter.

Mapping PCI pass-through devices on x86

By default, PCI devices on x86 boards are mapped from 2G to 4G in the guest-physical memory. Therefore, for guests that require large amounts of memory and that use PCI, avoid allocating this memory range. For example, the following configuration allocates 4.5G of memory for the guest. Note that it avoids the 2G to 4G range:

ram 0,0xa0000
rom 0xc0000,0x40000
ram 1M,1500M #Get 1.5 GB. Stops below the 2G boundary.
ram 4000M,3000M # Get 3 GB. Starts above the 4G boundary.