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 }
static void init_caches() { init_cache(); init_cache2(); init_tlb(); }