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

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

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.