요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
Numbered entries and inclusive ranges
sysfs-firmware-memmap:21-75Firmware order를 보존한 각 directory는 start, inclusive end, type을 제공하며 shell example은 end에 1을 더해 range를 출력합니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
1
What: /sys/firmware/memmap/
2
Date: June 2008
3
Contact: Bernhard Walle <bernhard.walle@gmx.de>
4
Description:
5
On all platforms, the firmware provides a memory map which the
6
kernel reads. The resources from that memory map are registered
7
in the kernel resource tree and exposed to userspace via
8
/proc/iomem (together with other resources).
10
However, on most architectures that firmware-provided memory
11
map is modified afterwards by the kernel itself, either because
12
the kernel merges that memory map with other information or
13
just because the user overwrites that memory map via command
14
line.
16
kexec needs the raw firmware-provided memory map to setup the
17
parameter segment of the kernel that should be booted with
18
kexec. Also, the raw memory map is useful for debugging. For
19
that reason, /sys/firmware/memmap is an interface that provides
20
the raw memory map to userspace.
22
The structure is as follows: Under /sys/firmware/memmap there
23
are subdirectories with the number of the entry as their name::
25
/sys/firmware/memmap/0
26
/sys/firmware/memmap/1
27
/sys/firmware/memmap/2
28
/sys/firmware/memmap/3
29
...
31
The maximum depends on the number of memory map entries provided
32
by the firmware. The order is just the order that the firmware
33
provides.
35
Each directory contains three files:
37
======== =====================================================
38
start The start address (as hexadecimal number with the
39
'0x' prefix).
40
end The end address, inclusive (regardless whether the
41
firmware provides inclusive or exclusive ranges).
42
type Type of the entry as string. See below for a list of
43
valid types.
44
======== =====================================================
46
So, for example::
48
/sys/firmware/memmap/0/start
49
/sys/firmware/memmap/0/end
50
/sys/firmware/memmap/0/type
51
/sys/firmware/memmap/1/start
52
...
54
Currently following types exist:
56
- System RAM
57
- ACPI Tables
58
- ACPI Non-volatile Storage
59
- Unusable memory
60
- Persistent Memory (legacy)
61
- Persistent Memory
62
- Soft Reserved
63
- reserved
65
Following shell snippet can be used to display that memory
66
map in a human-readable format::
68
#!/bin/bash
69
cd /sys/firmware/memmap
70
for dir in * ; do
71
start=$(cat $dir/start)
72
end=$(cat $dir/end)
73
type=$(cat $dir/type)
74
printf "%016x-%016x (%s)\n" $start $[ $end +1] "$type"
75
done
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Raw firmware-provided memory map
1-75| 항목 | 한국어 전문 번역 |
|---|---|
| What | /sys/firmware/memmap/ |
| Date | 2008년 6월 |
| Contact | Bernhard Walle <bernhard.walle@gmx.de> |
| Description | 모든 platform에서 firmware는 kernel이 읽는 memory map을 제공합니다. 그 resources는 kernel resource tree에 등록되어 다른 resources와 함께 `/proc/iomem`으로 userspace에 노출됩니다. 하지만 대부분 architectures에서는 kernel이 다른 정보와 merge하거나 user가 command line으로 덮어써 firmware-provided map을 나중에 변경합니다. Kexec는 다음 kernel의 parameter segment를 설정하기 위해 raw firmware-provided memory map이 필요하며 이 raw map은 debugging에도 유용합니다. 따라서 `/sys/firmware/memmap`은 변경 전 raw memory map을 userspace에 제공합니다. 각 entry는 firmware가 제공한 순서대로 `0`, `1`, `2` 같은 numbered subdirectory를 가지며 최대 번호는 firmware entry 수에 따라 달라집니다. 각 directory의 `start`는 `0x` prefix를 붙인 hexadecimal start address, `end`는 firmware range가 inclusive인지 exclusive인지와 관계없이 inclusive end address, `type`은 entry type string입니다. 현재 valid types는 `System RAM`, `ACPI Tables`, `ACPI Non-volatile Storage`, `Unusable memory`, `Persistent Memory (legacy)`, `Persistent Memory`, `Soft Reserved`, `reserved`입니다. 제공된 shell snippet은 inclusive `end`에 1을 더해 사람이 읽는 반개방 범위처럼 출력합니다. |
Firmware provides memory-map entries→Kernel preserves raw entries in /sys/firmware/memmap→Kernel may merge or override resource information→Modified resource tree appears in /proc/iomem
Sysfs raw map과 kernel이 수정한 /proc/iomem의 차이입니다.
FileMeaningRepresentation
startStart addressHexadecimal with 0x prefix
endInclusive end addressInclusive for every firmware form
typeMemory entry typeString
각 numbered directory의 세 fields입니다.
Type
System RAM
ACPI Tables
ACPI Non-volatile Storage
Unusable memory
Persistent Memory (legacy)
Persistent Memory
Soft Reserved
reserved
현재 정의된 valid type strings입니다.
#!/bin/bash
cd /sys/firmware/memmap
for dir in * ; do
start=$(cat $dir/start)
end=$(cat $dir/end)
type=$(cat $dir/type)
printf "%016x-%016x (%s)\n" $start $[ $end +1] "$type"
done
Raw map for kexec and debugging
sysfs-firmware-memmap:1-20Kexec parameter setup과 debugging은 수정된 /proc/iomem이 아니라 firmware가 처음 제공한 memory map을 필요로 합니다.