mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-22 02:53:23 +00:00
debuging...
This commit is contained in:
@ -42,13 +42,19 @@ void main_loop(int kb_fd)
|
||||
|
||||
unsigned char input_buffer[INPUT_BUFFER_SIZE] = {0};
|
||||
|
||||
sbrk(24);
|
||||
// sbrk(24);
|
||||
// brk(0x700000000000 + (1<<21));
|
||||
pid_t pid = fork();
|
||||
int retval = 0;
|
||||
|
||||
|
||||
while (1)
|
||||
for(int i=0;i<10;++i)
|
||||
printf(" @pid=%d ", pid);
|
||||
|
||||
if(pid == 0)
|
||||
{
|
||||
int a = 1/0;
|
||||
}
|
||||
// 初始化当前工作目录的路径
|
||||
shell_current_path = (char *)malloc(3);
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <libc/errno.h>
|
||||
long syscall_invoke(uint64_t syscall_id, uint64_t arg0, uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4, uint64_t arg5, uint64_t arg6, uint64_t arg7)
|
||||
{
|
||||
uint64_t err_code;
|
||||
uint64_t __err_code;
|
||||
__asm__ __volatile__(
|
||||
"movq %2, %%r8 \n\t"
|
||||
"movq %3, %%r9 \n\t"
|
||||
@ -14,11 +14,12 @@ long syscall_invoke(uint64_t syscall_id, uint64_t arg0, uint64_t arg1, uint64_t
|
||||
"movq %8, %%r14 \n\t"
|
||||
"movq %9, %%r15 \n\t"
|
||||
"int $0x80 \n\t"
|
||||
// "movq %%rax, %0 \n\t"
|
||||
: "=a"(err_code)
|
||||
"movq %%rax, %0 \n\t"
|
||||
:"=a"(__err_code)
|
||||
: "a"(syscall_id), "m"(arg0), "m"(arg1), "m"(arg2), "m"(arg3), "m"(arg4), "m"(arg5), "m"(arg6), "m"(arg7)
|
||||
: "memory", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", "rcx", "rdx");
|
||||
errno = err_code;
|
||||
// printf("errcode = %#018lx\n", __err_code);
|
||||
errno = __err_code;
|
||||
|
||||
return err_code;
|
||||
return __err_code;
|
||||
}
|
||||
|
Reference in New Issue
Block a user