Patch procf (#90)

* 1234

* 123

* 合并master

* procfs

* 1

* procfs展示进程基本信息

* modified code

* 恢复权限

* 恢复权限

 #恢复权限

* modify permission

* 删除run.sh

* 解决第一次编译时磁盘镜像权限错误的问题

* 恢复.vscode/c_cpp_properties.json

* 删除process.c中错误的do_fork

* remake procfs

* 修改一些变量名

* 修改类型

* modified

* data_puts缓冲区溢出后return

Co-authored-by: longjin <longjin@RinGoTek.cn>
This commit is contained in:
DaJiYuQia
2022-11-26 17:34:00 +08:00
committed by GitHub
parent ad23fcddf8
commit 27a97abd24
19 changed files with 664 additions and 45 deletions

View File

@ -253,14 +253,17 @@ static inline uint64_t copy_to_user(void *dst, void *src, uint64_t size)
* @brief 先每次搬运8 bytes剩余就直接一个个byte搬运
*
*/
asm volatile("rep \n\t"
"movsq \n\t"
"movq %3, %0 \n\t"
"rep \n\t"
"movsb \n\t"
: "=&c"(size), "=&D"(tmp0), "=&S"(tmp1)
: "r"(size & 7), "0"(size >> 3), "1"(dst), "2"(src)
: "memory");
// todo:编译有bug
// asm volatile("rep \n\t"
// "movsq \n\t"
// "movq %3, %0 \n\t"
// "rep \n\t"
// "movsb \n\t"
// : "=&c"(size), "=&D"(tmp0), "=&S"(tmp1)
// : "r"(size & 7), "0"(size >> 3), "1"(dst), "2"(src)
// : "memory");
memcpy(dst,src,size);
return size;
}

View File

@ -2,6 +2,7 @@
#include <common/stddef.h>
#include <asm/asm.h>
#include <common/compiler.h>
//链表数据结构
struct List

View File

@ -75,4 +75,13 @@ static inline int memcmp(const void *s1, const void *s2, size_t len)
diff = *(const unsigned char *)(s1 - 1) - *(const unsigned char *)(s2 - 1);
return diff;
}
}
/**
* @brief 拼接两个字符串将src接到dest末尾
*
* @param dest 目标串
* @param src 源串
* @return char*
*/
char *strcat(char *dest, const char *src);