Subversion Repositories HelenOS

Rev

Rev 1787 | Rev 1888 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1787 Rev 1833
Line 97... Line 97...
97
        }
97
        }
98
        /* Upper kernel mapping
98
        /* Upper kernel mapping
99
         * - from zero to top of kernel (include bottom addresses
99
         * - from zero to top of kernel (include bottom addresses
100
         *   because some are needed for init )
100
         *   because some are needed for init )
101
         */
101
         */
102
        for (cur = PA2KA_CODE(0); cur < config.base+config.kernel_size; cur += FRAME_SIZE) {
102
        for (cur = PA2KA_CODE(0); cur < config.base + config.kernel_size; cur += FRAME_SIZE)
103
            page_mapping_insert(AS_KERNEL, cur, KA2PA(cur), identity_flags);
103
            page_mapping_insert(AS_KERNEL, cur, KA2PA(cur), identity_flags);
-
 
104
       
-
 
105
        for (cur = config.stack_base; cur < config.stack_base + config.stack_size; cur += FRAME_SIZE)
-
 
106
            page_mapping_insert(AS_KERNEL, cur, KA2PA(cur), identity_flags);
104
        }
107
       
105
        for (i=0; i < init.cnt; i++) {
108
        for (i = 0; i < init.cnt; i++) {
106
            for (cur=init.tasks[i].addr;cur < init.tasks[i].size; cur += FRAME_SIZE) {
109
            for (cur = init.tasks[i].addr; cur < init.tasks[i].addr + init.tasks[i].size; cur += FRAME_SIZE)
107
                page_mapping_insert(AS_KERNEL, PA2KA_CODE(KA2PA(cur)), KA2PA(cur), identity_flags);
110
                page_mapping_insert(AS_KERNEL, PA2KA_CODE(KA2PA(cur)), KA2PA(cur), identity_flags);
108
            }
-
 
109
        }
111
        }
110
 
112
 
111
        exc_register(14, "page_fault", (iroutine)page_fault);
113
        exc_register(14, "page_fault", (iroutine)page_fault);
112
        write_cr3((uintptr_t) AS_KERNEL->page_table);
114
        write_cr3((uintptr_t) AS_KERNEL->page_table);
113
    }
115
    }