添加completion模块+wait_queue_head模块+schedule_timeout (#70)

* 添加completion模块+wait_queue_head模块+schedule_timeout

* 修复一些bug

* 实现设置pcb名字和vsnprintf (#72)

* 实现pcb设置名字

* 实现设置pcb名字,实现vsnprintf

* 修改set_pcb_name和va_end

* bugfix: 修正一些小问题

Co-authored-by: longjin <longjin@RinGoTek.cn>

* new: FAT32删除文件的功能 (#73)

* new: 将sys_rmdir更改为sys_unlink,.且完成删除文件操作的vfs部分

* new: fat32删除文件

*bugfix: 解决创建文件时的bug

* new: 将可执行文件移动到bin目录下

* 完善completion和wait_queue_head文档,并确保测试ok。

Co-authored-by: longjin <longjin@RinGoTek.cn>
Co-authored-by: houmkh <100781004+houmkh@users.noreply.github.com>
This commit is contained in:
guanjinquan
2022-11-03 21:54:59 +08:00
committed by GitHub
parent c811947dd0
commit 09f8d6f577
15 changed files with 822 additions and 55 deletions

View File

@ -1,6 +1,7 @@
#include "process.h"
#include <common/compiler.h>
#include <common/completion.h>
#include <common/elf.h>
#include <common/kprint.h>
#include <common/kthread.h>
@ -501,6 +502,9 @@ ul initial_kernel_thread(ul arg)
kinfo("LZ4 lib Version=%s", LZ4_versionString());
// 对completion完成量进行测试
__test_completion();
// 对一些组件进行单元测试
uint64_t tpid[] = {
ktest_start(ktest_test_bitree, 0), ktest_start(ktest_test_kfifo, 0), ktest_start(ktest_test_mutex, 0),
@ -1204,9 +1208,9 @@ int process_fd_alloc(struct vfs_file_t *file)
*/
static void __set_pcb_name(struct process_control_block *pcb, const char *pcb_name)
{
//todo:给pcb加锁
// spin_lock(&pcb->alloc_lock);
strncpy(pcb->name,pcb_name,PCB_NAME_LEN);
// todo:给pcb加锁
// spin_lock(&pcb->alloc_lock);
strncpy(pcb->name, pcb_name, PCB_NAME_LEN);
// spin_unlock(&pcb->alloc_lock);
}