new: mstat()函数,查询内存信息

This commit is contained in:
fslongjin
2022-08-06 23:31:25 +08:00
parent fdd5d3cf66
commit fb51b0dd6f
8 changed files with 270 additions and 7 deletions

View File

@ -18,6 +18,7 @@ extern void system_call(void);
extern void syscall_int(void);
extern uint64_t sys_clock(struct pt_regs *regs);
extern uint64_t sys_mstat(struct pt_regs *regs);
/**
* @brief 导出系统调用处理函数的符号
@ -778,5 +779,7 @@ system_call_t system_call_table[MAX_SYSTEM_CALL_NUM] =
[17] = sys_mkdir,
[18] = sys_nanosleep,
[19] = sys_clock,
[20 ... 254] = system_call_not_exists,
[20] = system_call_not_exists,
[21] = sys_mstat,
[22 ... 254] = system_call_not_exists,
[255] = sys_ahci_end_req};

View File

@ -30,5 +30,9 @@
#define SYS_MKDIR 17 // 创建文件夹
#define SYS_NANOSLEEP 18 // 纳秒级休眠
#define SYS_CLOCK 19 // 获取当前cpu时间
#define SYS_PIPE 20
#define SYS_MSTAT 21 // 获取系统的内存状态信息
#define SYS_AHCI_END_REQ 255 // AHCI DMA请求结束end_request的系统调用