🆕 增加重启命令reboot

This commit is contained in:
fslongjin
2022-05-25 14:38:15 +08:00
parent b02f5ea47c
commit 8bd7b64a0b
4 changed files with 22 additions and 2 deletions

View File

@ -442,6 +442,19 @@ uint64_t sys_sbrk(struct pt_regs *regs)
return retval;
}
/**
* @brief 重启计算机
*
* @return
*/
uint64_t sys_reboot(struct pt_regs *regs)
{
// 重启计算机
io_out8(0x64, 0xfe);
return 0;
}
ul sys_ahci_end_req(struct pt_regs *regs)
{
ahci_end_request();
@ -469,5 +482,6 @@ system_call_t system_call_table[MAX_SYSTEM_CALL_NUM] =
[8] = sys_vfork,
[9] = sys_brk,
[10] = sys_sbrk,
[11 ... 254] = system_call_not_exists,
[11] = sys_reboot,
[12 ... 254] = system_call_not_exists,
[255] = sys_ahci_end_req};

View File

@ -20,5 +20,6 @@
#define SYS_VFORK 8
#define SYS_BRK 9
#define SYS_SBRK 10
#define SYS_REBOOT 11 // 重启
#define SYS_AHCI_END_REQ 255 // AHCI DMA请求结束end_request的系统调用