LINUX_REBOOT_MAGIC2A (that is, 85072278) and since 2.1.97 also LINUX_REBOOT_MAGIC2B (that is, 369367448) and since 2.5.71 also LINUX_REBOOT_MAGIC2C (that is, 537993216) are permitted as value for magic2. (The hexadecimal values of these constants are meaningful.) The cmd argument can...
热重启是指在不断电的情况下重启设备,是软件层面的重启,比如系统执行reboot命令或者系统崩溃异常重启,过程基本描述如下: 整机包括cpu和内存处于正常运行状态 -> 系统执行reboot命令或者系统崩溃异常重启 -> CPU和内存均清0(除了一些特殊的内存) -> CPU上电执行CPU内部启动程序 -> CPU跳转到外部启动程序uboot -> u...
#defineLINUX_REBOOT_CMD_HALT0xCDEF0123 #defineLINUX_REBOOT_CMD_CAD_ON0x89ABCDEF #defineLINUX_REBOOT_CMD_CAD_OFF0x00000000 #defineLINUX_REBOOT_CMD_POWER_OFF0x4321FEDC #define LINUX_REBOOT_CMD_RESTART2 0xA1B2C3D4 #defineLINUX_REBOOT_CMD_SW_SUSPEND0xD000FCE2 #defineLINUX_REBOOT_CMD_KEXEC0x4558...
9. SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd, 10. void 11. { 12. char 13. int 14. 15. /* We only trust the superuser with rebooting the system. */ 16. if 17. return 18. 19. /* For safety, we require "magic" arguments. */ 20. if 21. (magi...
11: * KEXEC Restart system using a previously loaded Linux kernel 12:*/13:14:#defineLINUX_REBOOT_CMD_RESTART 0x0123456715:#defineLINUX_REBOOT_CMD_HALT 0xCDEF012316:#defineLINUX_REBOOT_CMD_CAD_ON 0x89ABCDEF17:#defineLINUX_REBOOT_CMD_CAD_OFF 0x0000000018:#defineLINUX_REBOOT_CMD_POWER_OFF 0x...
case LINUX_REBOOT_CMD_RESTART2: if (strncpy_from_user(&buffer[0], arg,sizeof(buffer) - 1) < 0) { unlock_kernel(); return -EFAULT; } buffer[sizeof(buffer) - 1] ='\0'; kernel_restart(buffer); break; #ifdef CONFIG_KEXEC
reboot() 1. 执行的新内核。其原型定义如下: 复制 cCopy code long kexec_load(unsigned long entry, unsigned long nr_segments, struct kexec_segment *segments, unsigned long flags); 1. 2. 用户空间需要传递给不同组件不同的段,如内核、initramfs 等。
当使用 LINUX_REBOOT_CMD_KEXEC 调用 reboot() 时,它会引导进入由 kexec_load 加载的内核。如果标志 KEXEC_ON_CRASH 被传递给 kexec_load(),则加载的内核将不会使用 reboot(LINUX_REBOOT_CMD_KEXEC) 来启动;相反,这将在内核崩溃中执行。必须定义 CONFIG_KEXEC 才能使用 kexec,并且为 kdump 定义 CONFIG_CRASH_...
_CMD_HALT 0xCDEF0123 #define LINUX_REBOOT_CMD_CAD_ON 0x89ABCDEF #define LINUX_REBOOT_CMD_CAD_OFF 0x00000000 #define LINUX_REBOOT_CMD_POWER_OFF 0x4321FEDC #define LINUX_REBOOT_CMD_RESTART2 0xA1B2C3D4 #define LINUX_REBOOT_CMD_SW_SUSPEND 0xD000FCE2 #define LINUX_REBOOT_CMD_KEXEC 0x...
LINUX_REBOOT_CMD_RESTART2 (0xa1b2c3d4; since 2.1.30). The message "Restarting system with command '%s'" is printed, and a restart (using the command string given in arg) is performed immediately. If not preceded by a sync(2), data will be lost. ...