The kernel is told a specific memory size by the protected bootloader. "Command line: mem=16m"