File tree Expand file tree Collapse file tree 7 files changed +15
-4
lines changed Expand file tree Collapse file tree 7 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 6
6
bochsout.txt
7
7
* .o
8
8
* .gch
9
- * .tags
9
+ * .tags *
Original file line number Diff line number Diff line change @@ -68,4 +68,9 @@ alloc_page 基本完成
68
68
- 添加 ` void show_pt_regs(pt_regs_t * pt_regs) ` 函数
69
69
70
70
- 添加设置进程名称的函数 ` set_task_name `
71
- -
71
+
72
+
73
+
74
+ # SimpleKernel 开发日志 20200407
75
+
76
+ 完成 task 测试,在 .gitignore 文件中添加 ctag 文件
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ extern "C" {
14
14
#include "mem/pmm.h"
15
15
#include "heap/heap.h"
16
16
#include "task/task.h"
17
+ #include "debug.h"
17
18
18
19
// 当前任务指针
19
20
task_pcb_t * curr_task = NULL ;
@@ -87,7 +88,7 @@ void task_init(void) {
87
88
// context->eip = (ptr_t)forkret_s233;
88
89
// context->esp = (ptr_t)task_pcb->pt_regs;
89
90
// 设置寄存器信息
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 ) );
91
92
// kernel_task->pt_regs->cs = KERNEL_CS;
92
93
// kernel_task->pt_regs->ds = KERNEL_DS;
93
94
// kernel_task->pt_regs->es = KERNEL_DS;
@@ -174,7 +175,7 @@ void kthread_exit(void) {
174
175
175
176
task_pcb_t __attribute__( (regparm (3 ) ) ) * __switch_to (task_pcb_t * curr , task_pcb_t * next ) {
176
177
// printk_debug("__switch_to\n");
177
- task_context_t * curr_context = curr -> context ;
178
+ // task_context_t * curr_context = curr->context;
178
179
task_context_t * next_context = next -> context ;
179
180
// printk_debug("curr_context: 0x%08X\t", curr_context);
180
181
// printk_debug("next_context: 0x%08X\t", next_context);
Original file line number Diff line number Diff line change @@ -78,6 +78,11 @@ bool test_task(void) {
78
78
set_task_name (pid3 , "test3" );
79
79
80
80
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
+
81
86
return true;
82
87
}
83
88
You can’t perform that action at this time.
0 commit comments