3 ms·
> “mem=4096m” in cmdline to only init 2 GB What is going on that makes this 2:1?
by zamadatix 7y ago
> “mem=4096m” in cmdline to only init 2 GB
What is going on that makes this 2:1?
- sedatk 7y ago2gb user + 2gb kernel?
- trdtaylor1 7y ago2 gb user + 1 gb swap + 1 gb rootfs unpacked in ram perhaps. They discuss a decompression operation and the only portion of the sequence that would occur in normally is unpacking a rootfs in RAM.
- wtallis 7y agoThe kernel itself is compressed, and among the first things that happen after the bootloader hands off to the kernel is that the stub at the beginning of the kernel decompresses the rest of the kernel. And in this case they don't appear to be using any initrd for the root filesystem, just hurrying to bring up access to the full filesystem over eMMC.
- naner 7y agoJust a mistake, should be 2048.
- hansendc 7y agomem= doesn't control the amount of RAM. It actually just specifies the largest physical address the kernel should try to use. The first 4GB of physical memory typically has some non-RAM things in it like the part of the physical address space that's reserved for talking to PCI devices. If you have 2GB of RAM, 2GB of "other stuff" in the first 4GB, and specify mem=4096m, you'll end up with a kernel that sees 2GB of RAM.