void restart() { /* Perform some initialization to restart a program */ load_prog(); memcpy(hwa_to_va(LOADER_START), loader, loader_len); cpu.eip = LOADER_START; cpu.ebp = 0; cpu.esp = 0x8000000; cpu.eflags = 2; init_dram(); init_cache1(); init_cache2(); init_TLB(); /* initialize limit of cs in gdt */ // printf("%x\n",cpu.gdtr.base); // uint16_t *cs_limit =(void *)(0x90901700 + 64); // *cs_limit = 0xffff; seg_cache[1].limit = 0xffffffff;//can't modify memory in 0x90901700 // *cs_limit = 0xffff;//other bits are initialized by 0 }
void init_TLBwindow() { GtkWidget *boxH; char **txt; txt=malloc( 2*sizeof(char*) ); txt[0]=malloc( 64*sizeof(char) ); txt[1]=malloc( 64*sizeof(char) ); winTLB = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title( GTK_WINDOW(winTLB), "Translation Lookaside Buffer (TLB)" ); gtk_container_set_border_width( GTK_CONTAINER(winTLB), 10); boxH = gtk_hbox_new( FALSE, 0); gtk_container_add( GTK_CONTAINER(winTLB), boxH ); init_TLB(); gtk_box_pack_start( GTK_BOX(boxH), frTLB, FALSE, FALSE, 0); gtk_widget_show_all(winTLB); gtk_signal_connect( GTK_OBJECT(winTLB), "destroy", on_close, NULL); }