🆕 运行文件系统中的二进制程序

This commit is contained in:
fslongjin
2022-05-06 00:25:32 +08:00
parent 099b24539a
commit 0aec6827ee
24 changed files with 673 additions and 68 deletions

View File

@ -97,10 +97,7 @@ long enter_syscall_int(ul syscall_id, ul arg0, ul arg1, ul arg2, ul arg3, ul arg
ul sys_put_string(struct pt_regs *regs)
{
if (regs->r9 == 0 && regs->r10 == 0)
printk((char *)regs->r8);
else
printk_color(regs->r9, regs->r10, (char *)regs->r8);
printk_color(regs->r9, regs->r10, (char *)regs->r8);
// printk_color(BLACK, WHITE, (char *)regs->r8);
return 0;
@ -310,7 +307,7 @@ uint64_t sys_write(struct pt_regs *regs)
* @param fd_num 文件描述符号
* @param offset 偏移量
* @param whence 调整模式
* @return uint64_t
* @return uint64_t 调整结束后的文件访问位置
*/
uint64_t sys_lseek(struct pt_regs *regs)
{
@ -370,5 +367,7 @@ system_call_t system_call_table[MAX_SYSTEM_CALL_NUM] =
[4] = sys_read,
[5] = sys_write,
[6] = sys_lseek,
[7 ... 254] = system_call_not_exists,
[7] = sys_fork,
[8] = sys_vfork,
[9 ... 254] = system_call_not_exists,
[255] = sys_ahci_end_req};

View File

@ -16,5 +16,7 @@
#define SYS_READ 4
#define SYS_WRITE 5
#define SYS_LSEEK 6
#define SYS_FORK 7
#define SYS_VFORK 8
#define SYS_AHCI_END_REQ 255 // AHCI DMA请求结束end_request的系统调用