> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/man/man4/nvram.4.md).

# nvram.4

`nvram` — 非易失性 RAM

## 名称

`nvram`

## 概要

`要将此驱动编译进内核，请在你的内核配置文件中加入以下行：`

> device nvram

`或者，要在引导时以模块方式加载该驱动，请在 loader.conf(5) 中加入以下行：`

```sh
nvram_load="YES"
```

## 描述

`nvram` 驱动提供对 i386 和 amd64 系统上 BIOS 配置 NVRAM 的访问。

PC 主板使用小型非易失性存储器存储 BIOS 设置，通常是其时钟芯片的一部分，有时被称为“CMOS SRAM”。此驱动在设备文件 `/dev/nvram` 的偏移零处暴露 NVRAM 的第 14 到 128 字节，共 114 字节。

此驱动适用于克隆共享相同硬件配置且需要相同 BIOS 设置调整的机器。

## 实现说明

BIOS NVRAM 的第 16 到 31 字节在第 32 字节处校验和。此驱动*不*处理这些校验和。

## 实例

将现有 BIOS NVRAM 备份到 `nvram.bin`：

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

从 `nvram.bin` 恢复 BIOS NVRAM：

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

## 参见

[dd(1)](/man/man1/dd.1.md)

## 历史

`nvram` 设备驱动首次出现于 FreeBSD 6.4。

## 作者

`nvram` 设备驱动由 Peter Wemm 编写。本手册页由 Xin LI 编写。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://book.bsdcn.org/man/man4/nvram.4.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
