Changeset 71eef11 in mainline for kernel/generic/src/main/main.c


Ignore:
Timestamp:
2008-02-06T14:24:13Z (17 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7208b6c
Parents:
1b067315
Message:

remove config.memory_size, get_memory_size() and memory_init.{c|d}
the amount of available memory can be calculated from the sizes of the zones
add FRAMES2SIZE, SIZE2KB and SIZE2MB functions/macros (code readability)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/main/main.c

    r1b067315 r71eef11  
    6464#include <align.h>
    6565#include <interrupt.h>
    66 #include <arch/mm/memory_init.h>
    6766#include <mm/frame.h>
    6867#include <mm/page.h>
     
    144143       
    145144        config.base = hardcoded_load_address;
    146         config.memory_size = get_memory_size();
    147        
    148145        config.kernel_size = ALIGN_UP(hardcoded_ktext_size +
    149146            hardcoded_kdata_size, PAGE_SIZE);
     
    220217        ddi_init();
    221218        arch_post_mm_init();
    222 
     219       
    223220        version_print();
    224         printf("kernel: %.*p hardcoded_ktext_size=%zdK, "
    225             "hardcoded_kdata_size=%zdK\n", sizeof(uintptr_t) * 2,
    226             config.base, hardcoded_ktext_size >> 10,
    227             hardcoded_kdata_size >> 10);
    228         printf("stack:  %.*p size=%zdK\n", sizeof(uintptr_t) * 2,
    229             config.stack_base, config.stack_size >> 10);
    230 
     221        printf("kernel: %.*p hardcoded_ktext_size=%zd KB, "
     222            "hardcoded_kdata_size=%zd KB\n", sizeof(uintptr_t) * 2,
     223                config.base, SIZE2KB(hardcoded_ktext_size),
     224                SIZE2KB(hardcoded_kdata_size));
     225        printf("stack:  %.*p size=%zd KB\n", sizeof(uintptr_t) * 2,
     226            config.stack_base, SIZE2KB(config.stack_size));
     227       
    231228        arch_pre_smp_init();
    232229        smp_init();
    233230        /* Slab must be initialized after we know the number of processors. */
    234231        slab_enable_cpucache();
    235 
    236         printf("config.memory_size=%zdM\n", config.memory_size >> 20);
    237         printf("config.cpu_count=%zd\n", config.cpu_count);
     232       
     233        printf("Detected %zu CPU(s), %llu MB free memory\n",
     234                config.cpu_count, SIZE2MB(zone_total_size()));
    238235        cpu_init();
    239236       
Note: See TracChangeset for help on using the changeset viewer.