Changeset 406 for trunk/kernel/libk


Ignore:
Timestamp:
Aug 29, 2017, 12:03:37 PM (4 years ago)
Author:
alain
Message:

This version executed successfully the user "init" process on a mono-processor TSAR architecture.

Location:
trunk/kernel/libk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/libk/elf.c

    r401 r406  
    2424#include <kernel_config.h>
    2525#include <hal_types.h>
     26#include <hal_special.h>
    2627#include <hal_uspace.h>
    2728#include <printk.h>
    2829#include <process.h>
     30#include <thread.h>
     31#include <mapper.h>
    2932#include <vseg.h>
    3033#include <kmem.h>
     
    165168                        type                       = VSEG_TYPE_CODE;
    166169                        process->vmm.code_vpn_base = vbase >> CONFIG_PPM_PAGE_SHIFT;
    167 
    168                         elf_dmsg("\n[INFO] %s : found CODE vseg / base = %x / size = %x\n",
    169                                  __FUNCTION__ , vbase , mem_size );
    170170                }
    171171                else               // found DATA segment
     
    173173                        type                       = VSEG_TYPE_DATA;
    174174                        process->vmm.data_vpn_base = vbase >> CONFIG_PPM_PAGE_SHIFT;
    175 
    176                         elf_dmsg("\n[INFO] %s : found DATA vseg / base = %x / size = %x\n",
    177                                  __FUNCTION__, vbase , mem_size );
    178175                }
    179176
     
    194191        vfs_file_t * file_ptr = (vfs_file_t *)GET_PTR( file_xp );
    195192
     193        // get local pointer on .elf file mapper
     194        mapper_t * mapper_ptr = (mapper_t *)hal_remote_lpt( XPTR( file_cxy ,
     195                                                                  &file_ptr->mapper ) );
     196
    196197        // initialize "file_mapper", "file_offset", "file_size" fields in vseg
    197         vseg->mapper_xp   = (xptr_t)hal_remote_lwd( XPTR( file_cxy , &file_ptr->mapper ) );
     198        vseg->mapper_xp   = XPTR( file_cxy , mapper_ptr );
    198199        vseg->file_offset = file_offset;
    199200        vseg->file_size   = file_size;
     
    201202        // update reference counter in file descriptor
    202203                vfs_file_count_up( file_xp );
     204
     205                elf_dmsg("\n[DMSG] %s : found %s vseg / base = %x / size = %x\n"
     206                 "       file_size = %x / file_offset = %x / mapper_xp = %l\n",
     207            __FUNCTION__ , vseg_type_str(vseg->type) , vseg->min , vseg->max - vseg->min ,
     208        vseg->file_size , vseg->file_offset , vseg->mapper_xp );
    203209        }
    204210
     
    219225        error_t      error;
    220226
    221     elf_dmsg("\n[INFO] %s : core[%x,%d] enter for <%s>\n",
     227    elf_dmsg("\n[DMSG] %s : core[%x,%d] enter for <%s>\n",
    222228    __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , pathname );
    223229
     
    239245        }
    240246
    241     elf_dmsg("\n[INFO] %s : open file <%s>\n", __FUNCTION__ , pathname );
     247    elf_dmsg("\n[DMSG] %s : open file <%s>\n", __FUNCTION__ , pathname );
    242248
    243249        // load header in local buffer
     
    252258        }
    253259
    254         elf_dmsg("\n[INFO] %s : loaded elf header for %s\n", __FUNCTION__ , pathname );
     260        elf_dmsg("\n[DMSG] %s : loaded elf header for %s\n", __FUNCTION__ , pathname );
    255261
    256262        if( header.e_phnum == 0 )
     
    289295        }
    290296
    291         elf_dmsg("\n[INFO] %s : segments array allocated for %s\n", __FUNCTION__ , pathname );
     297        elf_dmsg("\n[DMSG] %s : segments array allocated for %s\n", __FUNCTION__ , pathname );
    292298
    293299        // load seg descriptors array to local buffer
     
    306312        }
    307313
    308         elf_dmsg("\n[INFO] %s loaded segments descriptors for %s \n", __FUNCTION__ , pathname );
     314        elf_dmsg("\n[DMSG] %s loaded segments descriptors for %s \n", __FUNCTION__ , pathname );
    309315
    310316        // register loadable segments in process VMM
     
    331337        kmem_free(&req);
    332338
    333     elf_dmsg("\n[INFO] %s : core[%x,%d] exit for <%s> / entry_point = %x\n",
     339    elf_dmsg("\n[DMSG] %s : core[%x,%d] exit for <%s> / entry_point = %x\n",
    334340    __FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , pathname , header.e_entry );
    335341
  • trunk/kernel/libk/grdxt.c

    r396 r406  
    2626#include <errno.h>
    2727#include <printk.h>
     28#include <vseg.h>
    2829#include <kmem.h>
    2930#include <grdxt.h>
     
    125126    intptr_t        value;
    126127
    127         printk("*** %s : n1 = %d / n2 = %d / n3 = %d\n",
     128        printk("\n***** Generic Radix tree %s : n1 = %d / n2 = %d / n3 = %d\n\n",
    128129           name, 1<<w1 , 1<<w2 , 1<<w3 );
    129130
  • trunk/kernel/libk/grdxt.h

    r1 r406  
    3636 * Memory for the second and third levels arrays is dynamically allocated by the
    3737 * grdxt_insert() function and is only released by grdxt_destroy().
    38  * - It used to by the VMM to retrieve a vseg descriptor: key is the virtual address.
    39  * - It is used by the mapper to implement the file cache: key is the page index in file.
     38 * It is used by the MAPPER to implement the file cache: key is the page index in file.
    4039 ******************************************************************************************/
    4140
     
    4847}
    4948grdxt_t;
    50 
    5149
    5250/*******************************************************************************************
     
    122120
    123121/*******************************************************************************************
    124  * This function displays the content of the radix_tree.
     122 * This function displays the current content of a radix_tree.
    125123 *******************************************************************************************
    126124 * @ rt      : pointer on the radix-tree descriptor.
    127  * @ name    : string identifying the radix-tree.
     125 * @ string  : radix tree identifier.
    128126 ******************************************************************************************/
    129127void grdxt_print( grdxt_t * rt,
    130                   char    * name );
     128                  char    * string );
    131129
    132130
Note: See TracChangeset for help on using the changeset viewer.