Documentation/translations/zh_TW/admin-guide/sysrq.rst
Source file repositories/reference/linux-study-clean/Documentation/translations/zh_TW/admin-guide/sysrq.rst
File Facts
- System
- Linux kernel
- Corpus path
Documentation/translations/zh_TW/admin-guide/sysrq.rst- Extension
.rst- Size
- 13007 bytes
- Lines
- 282
- Domain
- Support Tooling And Documentation
- Bucket
- Documentation
- Inferred role
- Support Tooling And Documentation: documentation
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
.. include:: ../disclaimer-zh_TW.rst
:Original: Documentation/admin-guide/sysrq.rst
:翻譯:
黃軍華 Junhua Huang <huang.junhua@zte.com.cn>
:校譯:
司延騰 Yanteng Si <siyanteng@loongson.cn>
.. _tw_admin-guide_sysrq:
Linux 魔法系統請求鍵駭客
========================
針對 sysrq.c 的文檔說明
什麼是魔法 SysRq 鍵?
~~~~~~~~~~~~~~~~~~~~~
它是一個你可以輸入的具有魔法般的組合鍵。
無論內核在做什麼,內核都會響應 SysRq 鍵的輸入,除非內核完全卡死。
如何使能魔法 SysRq 鍵?
~~~~~~~~~~~~~~~~~~~~~~~
在配置內核時,我們需要設置 'Magic SysRq key (CONFIG_MAGIC_SYSRQ)' 爲 'Y'。
當運行一個編譯進 sysrq 功能的內核時,/proc/sys/kernel/sysrq 控制着被
SysRq 鍵調用的功能許可。這個文件的默認值由 CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE
配置符號設定,文件本身默認設置爲 1。以下是 /proc/sys/kernel/sysrq 中可能的
值列表:
- 0 - 完全不使能 SysRq 鍵
- 1 - 使能 SysRq 鍵的全部功能
- >1 - 對於允許的 SysRq 鍵功能的比特掩碼(參見下面更詳細的功能描述)::
2 = 0x2 - 使能對控制檯日誌記錄級別的控制
4 = 0x4 - 使能對鍵盤的控制 (SAK, unraw)
8 = 0x8 - 使能對進程的調試導出等
16 = 0x10 - 使能同步命令
32 = 0x20 - 使能重新掛載只讀
64 = 0x40 - 使能對進程的信號操作 (term, kill, oom-kill)
128 = 0x80 - 允許重啓、斷電
256 = 0x100 - 允許讓所有實時任務變普通任務
你可以通過如下命令把值設置到這個文件中::
echo "number" >/proc/sys/kernel/sysrq
這裏被寫入的 number 可以是 10 進制數,或者是帶着 0x 前綴的 16 進制數。
CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE 必須是以 16 進制數寫入。
注意,``/proc/sys/kernel/sysrq`` 的值隻影響通過鍵盤觸發 SySRq 的調用,對於
通過 ``/proc/sysrq-trigger`` 的任何操作調用都是允許的
(通過具有系統權限的用戶)。
如何使用魔法 SysRq 鍵?
~~~~~~~~~~~~~~~~~~~~~~~
在 x86 架構上
你可以按下鍵盤組合鍵 `ALT-SysRq-<command key>`。
.. note::
一些鍵盤可能沒有標識 'SySRq' 鍵。'SySRq' 鍵也被當做 'Print Screen'鍵。
同時有些鍵盤無法處理同時按下這麼多鍵,因此你可以先按下鍵盤 `Alt` 鍵,
然後按下鍵盤 `SysRq` 鍵,再釋放鍵盤 `SysRq` 鍵,之後按下鍵盤上命令鍵
`<command key>`,最後釋放所有鍵。
Annotation
- Atlas domain: Support Tooling And Documentation / Documentation.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.