void user_task_entry(char *name) {
strcpy(current->name, name);
+ current->priority = 90;
+
unsigned long ring3_text_page = va2pa(ring3_entry);
unsigned long ring3_bss_page = va2pa(alloc_one_page(0));
// 赋予不同的优先级
current->priority = id * 30;
+
if (current->priority <= 0) {
current->priority = 1;
}
kernel_task("user", user_task_entry);
int cnt = 0;
+
while (1) {
// sysc_test();
// printl(MPL_TASK_0, "root:0 [%08x] weight %d cnt %d", current, root_task.weight, cnt++);
if (prev != next) {
// printk("switch to: %s:%d\n", next->name, next->pid);
-
+ sel->sched_cnt++;
list_for_each_safe(pos, t, &all_tasks) {
p = list_entry(pos, task_union, list);
- printl(MPL_TASK_0 + p->pid, "%s%4s:%d [%08x] state %s weight %03d cnt %u", sel == p ? ">" : " ", p->name,
- p->pid, p, task_state(p->state), p->weight, p->cnt);
+ printl(MPL_TASK_0 + p->pid, "%s%4s:%d [%08x] state %s weight %03d sched %u", sel == p ? ">" : " ", p->name,
+ p->pid, p, task_state(p->state), p->weight, p->sched_cnt);
}
context_switch(prev, next);
}