Skip to content

Commit 76b394b

Browse files
committed
task_test finished
1 parent 897c7fe commit 76b394b

File tree

7 files changed

+15
-4
lines changed

7 files changed

+15
-4
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
bochsout.txt
77
*.o
88
*.gch
9-
*.tags
9+
*.tags*

devlog/devlog20200306.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,9 @@ alloc_page 基本完成
6868
- 添加 `void show_pt_regs(pt_regs_t * pt_regs)` 函数
6969

7070
- 添加设置进程名称的函数 `set_task_name`
71-
-
71+
72+
73+
74+
# SimpleKernel 开发日志 20200407
75+
76+
完成 task 测试,在 .gitignore 文件中添加 ctag 文件

iso/boot/kernel.bin

864 Bytes
Binary file not shown.

simplekernel.iso

2 KB
Binary file not shown.

src/arch/x86_64/task/task.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ extern "C" {
1414
#include "mem/pmm.h"
1515
#include "heap/heap.h"
1616
#include "task/task.h"
17+
#include "debug.h"
1718

1819
// 当前任务指针
1920
task_pcb_t * curr_task = NULL;
@@ -87,7 +88,7 @@ void task_init(void) {
8788
// context->eip = (ptr_t)forkret_s233;
8889
// context->esp = (ptr_t)task_pcb->pt_regs;
8990
// 设置寄存器信息
90-
// kernel_task->pt_regs = (pt_regs_t *)kmalloc(sizeof(pt_regs_t) );
91+
kernel_task->pt_regs = (pt_regs_t *)kmalloc(sizeof(pt_regs_t) );
9192
// kernel_task->pt_regs->cs = KERNEL_CS;
9293
// kernel_task->pt_regs->ds = KERNEL_DS;
9394
// kernel_task->pt_regs->es = KERNEL_DS;
@@ -174,7 +175,7 @@ void kthread_exit(void) {
174175

175176
task_pcb_t __attribute__( (regparm(3) ) ) * __switch_to(task_pcb_t * curr, task_pcb_t * next) {
176177
// printk_debug("__switch_to\n");
177-
task_context_t * curr_context = curr->context;
178+
// task_context_t * curr_context = curr->context;
178179
task_context_t * next_context = next->context;
179180
// printk_debug("curr_context: 0x%08X\t", curr_context);
180181
// printk_debug("next_context: 0x%08X\t", next_context);

src/kernel.bin

304 Bytes
Binary file not shown.

src/test/test.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ bool test_task(void) {
7878
set_task_name(pid3, "test3");
7979

8080
show_task(TASK_MAX + 1);
81+
show_task_mem(0);
82+
show_task_pt_regs(0);
83+
show_task_context(0);
84+
show_task(pid1);
85+
8186
return true;
8287
}
8388

0 commit comments

Comments
 (0)