NVRAM(4)

πŸ’Ύ NVRAM(4) πŸ’Ύ

ok so this is the nvram page from the Kernel Interfaces Manual β€” yes bestie, we're going deep into the kernel today, grab a snack πŸ“


✨ NAME ✨

nvram β€” non-volatile RAM, aka the little memory that remembers you even when the power's off πŸ‘‘


✨ SYNOPSIS ✨

ok so you wanna get this driver into your kernel? two ways, pick your fighter πŸ’…

Option one: bake it right in. Drop this line into your kernel configuration file:

device nvram

Option two: load it as a module at boot time. Then put this line in loader.conf(5):

nvram_load="YES"

both are valid, no cap 🫢


✨ DESCRIPTION ✨

so the nvram driver hands you access to the BIOS configuration NVRAM on i386 and amd64 systems. that's it, that's the whole job ✨

your PC motherboard uses a tiny bit of non-volatile memory to store BIOS settings β€” it's usually part of the clock chip, and people sometimes call it β€œCMOS SRAM”. cute name, tiny memory, huge responsibilities 😭

this driver exposes bytes 14 through 128 of the NVRAM β€” that's 114 bytes total β€” sitting at offset zero of the device file /dev/nvram. so like, the front of the file is actually byte 14 of the real thing. she's got a look, okay πŸ’…

and why do you care? because this driver is genuinely useful for cloning machines that share the same hardware configuration and need the same BIOS setting tweaks. set it up once, copy the vibes to the whole fleet, periodt πŸŽ€


πŸ› οΈ IMPLEMENTATION NOTES πŸ› οΈ

ok important, listen up:

The BIOS NVRAM's bytes 16 through 31 are checksummed at byte 32. This driver does not take care of these checksums. 🚨

so if you're writing to it, that checksum situation is your problem, not hers. she said not my department bestie πŸ™ˆ


🌸 EXAMPLES 🌸

backup your existing BIOS NVRAM to nvram.bin:

dd if=/dev/nvram of=nvram.bin

restore BIOS NVRAM from nvram.bin:

dd if=nvram.bin of=/dev/nvram

literally two commands, that's the whole ritual πŸ”₯


πŸ‘€ SEE ALSO πŸ‘€


πŸ“œ HISTORY πŸ“œ

The nvram device driver first appeared in FreeBSD 6.4. she's been iconic since day one ⭐


πŸ’– AUTHORS πŸ’–

The nvram device driver was written by Peter Wemm. This manual page was written by Xin LI. absolute legends, we stan πŸ«ΆπŸ‘‘


and that's the whole page!! this one came from Debian, dated February 8, 2010 β€” yes she's vintage, yes she still slays, iykyk πŸ’…πŸ’–

take care of your CMOS bestie, she remembers everything for you πŸ¦‹

πŸ“¦ where this page comes from