Page MenuHomeFreeBSD

(fix) [nvram2env] nvram2env scans only 1/4th of memory
ClosedPublic

Authored by mizhka on May 19 2016, 8:23 PM.
Tags
None
Referenced Files
F169125619: D6466.diff
Mon, Aug 31, 12:20 PM
F169093034: D6466.id16584.diff
Mon, Aug 31, 9:39 AM
Unknown Object (File)
Sun, Aug 30, 2:52 AM
Unknown Object (File)
Sat, Aug 29, 5:57 PM
Unknown Object (File)
Sat, Aug 29, 8:47 AM
Unknown Object (File)
Thu, Aug 27, 7:13 AM
Unknown Object (File)
Wed, Aug 26, 4:20 PM
Unknown Object (File)
Tue, Aug 25, 5:02 PM

Details

Summary

The variable "size" stores number of words (4bytes). But the loop over memory uses size as number of bytes to scan memory. As result it fetches only 1/4th of memory.

This patch solves this problem and nvram2env fetches all NVRAM variables.

Test Plan

Pre-requisites: any MIPS board with ASCII-based NVRAM mapped into memory

  1. Add "device nvram2env" into kernel configuration
  2. Specify hints: base is mandatory (according to nvram2env(4))

hint.nvram.0.base=0x1c7f8000 (it's valid address for Asus RT-N53 with flags = 0x4)

  1. Build & load kernel with bootverbose

Actual result: only part of nvram variables are found
Expected result: all variables are found

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mizhka retitled this revision from to (fix) [nvram2env] nvram2env scans only 1/4th of memory.
mizhka updated this object.
mizhka edited the test plan for this revision. (Show Details)
mizhka added reviewers: ray, adrian.
mizhka set the repository for this revision to rS FreeBSD src repository - subversion.
mizhka added a subscriber: landon_landonf.org.
  • remove shifting for size
  • cosmetic changes like style(9), remove extra indentation, remove calculation from "for" statement condition.
This revision was automatically updated to reflect the committed changes.