Changeset 114 for trunk/hal


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

compute the offset for bootinfo

Location:
trunk/hal/x86_64/core
Files:
2 edited

Legend:

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

    r112 r114  
    7171void hal_gpt_bootstrap_reset()
    7272{
    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);
     73//      XXX: will be revisited later
     74//      size_t npages = (va_avail - (CLUSTER_MIN_VA(0) + KERNEL_VA_SIZE)) / PAGE_SIZE;
     75//      hal_gpt_leave_range(CLUSTER_MIN_VA(0) + KERNEL_VA_SIZE, npages);
     76//      va_avail = CLUSTER_MIN_VA(0) + KERNEL_VA_SIZE;
    7577}
    7678
  • trunk/hal/x86_64/core/hal_init.c

    r99 r114  
    109109static void init_bootinfo(boot_info_t *info)
    110110{
     111        extern paddr_t pa_avail;
     112        extern vaddr_t va_avail;
     113
    111114        extern uint64_t __kernel_data_start;
    112115        extern uint64_t __kernel_end;
     116
     117        size_t pa_offset = pa_avail - 0;
     118        size_t va_offset = va_avail - CLUSTER_MIN_VA(0);
    113119
    114120        memset(info, 0, sizeof(boot_info_t));
     
    135141        /* dev_ XXX */
    136142
    137         info->pages_offset = 0;
    138         info->pages_nr = 0;
     143        info->pages_offset = MAX(pa_offset, va_offset);
     144        info->pages_nr = 0; /* XXX */
    139145
    140146        info->kernel_code_start = (intptr_t)(KERNTEXTOFF - KERNBASE);
Note: See TracChangeset for help on using the changeset viewer.