#include
void thread1(unsigned int val)
{
KPRINTF("val = %d\n", val);
for(;;)
KPRINTF("-");
}
void thread2(unsigned int val)
{
KPRINTF("val = %d\n", val);
for(;;)
KPRINTF("+");
}
void thread3(unsigned int val)
{
KPRINTF("val = %d\n", val);
for(;;)
KPRINTF("*");
}
#include
int kmain()
{
EXEC_INIT(&initStart, &initEnd);
printf("kernel build : " __DATE__" "__TIME__ "\n");
gdt_ptr_t gdt_desc;
store_gdt(&gdt_desc);
dump_gdt(&gdt_desc);
move_to_user_mode();
create_thread(thread1, 1, NORM_PRIO, 1);
create_thread(thread2, 2, NORM_PRIO, 1);
create_thread(thread3, 3, NORM_PRIO, 1);
kmemdump();
/*next is idle thread*/
for(;;)
printf("i");
//printf("NEVER HERE %x,%x,%x\n", t1, t2, t3);
return 1;
}
阅读(1000) | 评论(0) | 转发(0) |