Ignore:
Timestamp:
Jun 26, 2017, 11:48:28 AM (7 years ago)
Author:
max@…
Message:

Use mcmodel=large, in order to have a kernel image that is located at the
beginning of each cluster in virtual memory, as discussed with Alain. The
performance cost will be taken care of later.

Now, the active kernel is located at 0xfffff00000000000, and the base of
the clusters is 0xffff800000000000.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/x86_64/hal_gpt.c

    r45 r47  
    7171void hal_gpt_bootstrap_reset()
    7272{
    73         size_t npages = (va_avail - CLUSTER_HEAP_MIN_VA(0)) / PAGE_SIZE;
    74         hal_gpt_leave_range(CLUSTER_HEAP_MIN_VA(0), npages);
     73        size_t npages = (va_avail - (CLUSTER_MIN_VA(0) + KERNEL_VA_SIZE)) / PAGE_SIZE;
     74        hal_gpt_leave_range(CLUSTER_MIN_VA(0) + KERNEL_VA_SIZE, npages);
    7575}
    7676
     
    211211        /* Initialize global values */
    212212        pa_avail = firstpa;
    213         va_avail = CLUSTER_HEAP_MIN_VA(0);
     213        va_avail = CLUSTER_MIN_VA(0) + KERNEL_VA_SIZE;
    214214        kimg_size = ((uint64_t)&__kernel_end - KERNBASE);
    215215        XASSERT(kimg_size % PAGE_SIZE == 0);
     
    217217
    218218        /* Create cluster0's heap entry. */
    219         hal_gpt_maptree_area(CLUSTER_HEAP_MIN_VA(0), CLUSTER_HEAP_MAX_VA(0));
    220 
    221         /* Create cluster0's kimg entry. */
    222         hal_gpt_maptree_area(CLUSTER_KIMG_MIN_VA(0), CLUSTER_KIMG_MAX_VA(0));
     219        hal_gpt_maptree_area(CLUSTER_MIN_VA(0), CLUSTER_MAX_VA(0));
    223220
    224221        /* Manually enter cluster0's kimg */
    225         hal_gpt_enter_range(CLUSTER_KIMG_MIN_VA(0), kimg_min_pa, kimg_size);
     222        hal_gpt_enter_range(CLUSTER_MIN_VA(0), kimg_min_pa, kimg_size);
    226223}
    227224
Note: See TracChangeset for help on using the changeset viewer.