void init_process() { g_proc_running = g_pcb; init_pcb(&g_pcb[0], testA, "A", 100, 5); init_pcb(&g_pcb[1], testB, "B", 101, 1); }
void Process(){ int current_process_SEG = process_SEG; int i; for( i = start_process_num; i <= process_num; i++){ current_process_SEG = i*0x0800; init_pcb( i, current_process_SEG); } load_user( 1, 0x0800); __asm__(" pop %cx"); load_user( 2, 0x1000); __asm__(" pop %cx"); load_user( 3, 0x1800); __asm__(" pop %cx"); load_user( 4, 0x2000); __asm__(" pop %cx"); load_user( 5, 0x2800); //wait key __asm__(" pop %cx"); load_user( 6, 0x3000); //father __asm__("pop %cx"); // 4000- sub stack w_is_r = 0; isProcessRun=1; // enter user process mode }
void kentry(void) { init_serial(); //初始化串口输出 init_idt(); init_timer(); init_intr(); init_seg(); //getKeyCode(); uint32_t entry = load_umain(); init_pcb(entry); //putchar('A'); asm volatile("movl %%eax, %%esp" ::"a"(&idle.regs.esp)); enable_interrupt(); while(1){ //putchar('^'); wait_for_interrupt(); } ///p_idle(); //enter_user_space(entry); while(1); }
void create_process(func_t f, void* args, unsigned int stack_size) { struct pcb_s* pcb = ALLOC(struct pcb_s); pcb_cycle_add(g_process_list_current, pcb); init_pcb( pcb, ALLOC(ctx_s), f,args); }