当前位置: 首页 > news >正文

linux sysrq的使用举例

在menuconfig中选择m和 *的区别:
*: 模块驱动编译到内核中,启动时自动加载
M:标识作为内核模块编译
空格:表示该功能不编译到内核中,即新的内核将不支持该功能。

m:模块会被编译,但是不会被编译到内核中,只是生成.o文件,我们可以收集这些.o文件做到linux的文件系统中,然后用insmod实现动态加载。

rk3568的magic sysrq key的目录,进入linux的kernel目录

rk356x-linux/rk356x-linux/kernel$ make menuconfig

 Kernel hacking  ---> Generic Kernel Debugging Instruments  ---> [*] Magic SysRq key  

 

 [*] Magic SysRq key                                                                                        │ │  │ │     (0x0) Enable magic SysRq key functions by default                                                          │ │  │ │     [*]   Enable magic SysRq key over serial                                                                   │ │  │ │     ()   Char sequence that enables magic SysRq over serial                                                 │ │  │ │            -*- Debug Filesystem                                                                                       │ │  │ │         Debugfs default access (Access normal)  --->                                                         │ │  │ │         [ ] KGDB: kernel debugger  ----                                                                            │ │  │ │         [ ] Undefined behaviour sanity checker  ----                                                               │ │  │ │                                                                                   

 (0x0) Disable magic SysRq key functions 数据说明

0 - disable sysrq completely

1 - enable all functions of sysrq

>1 - bitmask of allowed sysrq functions (see below for detailed function description):

      2 =   0x2 - enable control of console logging level
      4 =   0x4 - enable control of keyboard (SAK, unraw)
      8 =   0x8 - enable debugging dumps of processes etc.
     16 =  0x10 - enable sync command
     32 =  0x20 - enable remount read-only
     64 =  0x40 - enable signalling of processes (term, kill, oom-kill)
    128 =  0x80 - allow reboot/poweroff
    256 = 0x100 - allow nicing of all RT tasks

内核中还有一个与SysRq相关的配置项:

CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x01b6

这个配置项指定了默认SysRq的值,这个值表示kernel会对哪些功能产生反应

 

 


http://www.mrgr.cn/news/80348.html

相关文章:

  • Vue组件相关记录
  • 【CSS in Depth 2 精译_079】第 13 章:渐变、阴影与混合模式概述 + 13.1:CSS 渐变效果(一)——使用多个颜色节点
  • python请求SSL问题
  • 深入分析 Java 中的 NoSuchMethodException 异常及解决方法
  • Gitlab ci/cd 从0-1持续集成持续发布前端
  • Android显示系统(11)- 向SurfaceFlinger申请Surface
  • Transformer记录Attention is all you need
  • 怎么写英语作文(个人笔记)
  • Unity中Mesh重叠顶点合并参考及其应用
  • chromedriver可运行的docker环境
  • etcd常见运维事件
  • 【electron】electron forge + vite + vue + electron-release-server 自动更新客户端
  • tryhackme-Pre Security-Defensive Security Intro(防御安全简介)
  • ragflow连不上ollama的解决方案
  • 【Golang】如何读取并解析SQL文件
  • ensp 单臂路由配置
  • CAD c# 生成略缩图预览
  • 计算机网络-传输层 TCP协议(下)
  • YOLOv9改进,YOLOv9引入DLKA-Attention可变形大核注意力,WACV2024,二次创新RepNCSPELAN4结构
  • 拿到小米 Offer,却迷茫了。。