Ignore:
Timestamp:
Jul 17, 2017, 8:42:59 AM (7 years ago)
Author:
alain
Message:

Bug fix in kernel_init
-This line, and those below, will be ignored--

M params.mk
M kernel_config.h
M Makefile
M hdd/virt_hdd.dmg
M tools/bootloader_tsar/boot.c
M kernel/libk/bits.h
M kernel/libk/elf.c
M kernel/libk/xhtab.c
M kernel/libk/elf.h
M kernel/libk/xhtab.h
M kernel/devices/dev_pic.c
M kernel/mm/vmm.c
M kernel/mm/mapper.c
M kernel/mm/mapper.h
M kernel/vfs/devfs.h
M kernel/vfs/vfs.c
M kernel/vfs/vfs.h
M kernel/vfs/devfs.c
M kernel/kern/chdev.h
M kernel/kern/kernel_init.c
M kernel/kern/process.c
M kernel/kern/process.h
M hal/tsar_mips32/core/hal_remote.c
M hal/tsar_mips32/drivers/soclib_pic.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/kernel_init.c

    r188 r204  
    3333#include <list.h>
    3434#include <xlist.h>
     35#include <xhtab.h>
    3536#include <thread.h>
    3637#include <scheduler.h>
     
    245246        func        = FUNC_FROM_TYPE( dev_tbl[i].type );
    246247        impl        = IMPL_FROM_TYPE( dev_tbl[i].type );
    247 
     248 
    248249        //////////////////////////
    249250        if( func == DEV_FUNC_MMC ) 
     
    553554    }
    554555
    555     kinit_dmsg("\n[INFO] %s created IOPIC chdev in cluster %x at cycle %d\n",
     556    kinit_dmsg("\n[INFO] %s created PIC chdev in cluster %x at cycle %d\n",
    556557               __FUNCTION__ , local_cxy , (uint32_t)hal_time_stamp() );
    557558   
     
    672673void kernel_init( boot_info_t * info )
    673674{
    674     lid_t        core_lid = -1;        // running core local index
    675     cxy_t        core_cxy = -1;        // running core cluster identifier
    676     gid_t        core_gid;             // running core hardware identifier
    677     cluster_t  * cluster;              // pointer on local cluster manager
    678     core_t     * core;                 // pointer on running core descriptor
    679     thread_t   * thread;               // pointer on idle thread descriptor
    680     xptr_t       vfs_root_inode_xp;    // extended pointer on VFS root inode
    681 //  xptr_t       devfs_root_inode_xp;  // extended pointer on DEVFS root inode
     675    lid_t        core_lid = -1;             // running core local index
     676    cxy_t        core_cxy = -1;             // running core cluster identifier
     677    gid_t        core_gid;                  // running core hardware identifier
     678    cluster_t  * cluster;                   // pointer on local cluster manager
     679    core_t     * core;                      // pointer on running core descriptor
     680    thread_t   * thread;                    // pointer on idle thread descriptor
     681
     682    xptr_t       vfs_root_inode_xp;         // extended pointer on VFS root inode
     683    xptr_t       devfs_dev_inode_xp;        // extended pointer on DEVFS dev inode   
     684    xptr_t       devfs_external_inode_xp;   // extended pointer on DEVFS external inode       
     685    xptr_t       devfs_internal_inode_xp;   // extended pointer on DEVFS internal inode       
     686
    682687    error_t      error;
    683688
     
    958963
    959964    /////////////////////////////////////////////////////////////////////////////////
    960     // global &local synchro to protect File System initialisation
    961965    if( core_lid == 0 ) remote_barrier( XPTR( io_cxy , &global_barrier ),
    962966                                        (info->x_size * info->y_size) );
    963967    barrier_wait( &local_barrier , info->cores_nr );
     968    /////////////////////////////////////////////////////////////////////////////////
    964969
    965970    if( (core_lid ==  0) && (local_cxy == 0) )
     
    970975    /////////////////////////////////////////////////////////////////////////////////
    971976    // STEP 6 : CP0 in cluster IO makes the global DEVFS tree initialisation:
    972     //          It creates the DEVFS root directory and the DEVFS "external"
    973     //          diretory in cluster IO and mount these inodes into VFS.
     977    //          It creates the DEVFS directory "dev", and the DEVFS "external"
     978    //          directory in cluster IO and mount these inodes into VFS.
    974979    /////////////////////////////////////////////////////////////////////////////////
    975980
    976981    if( (core_lid ==  0) && (local_cxy == io_cxy) )
    977982    {
    978         xptr_t  devfs_root_inode_xp;       // extended pointer on DEVFS root directory
    979         xptr_t  devfs_external_inode_xp;   // extended pointer on DEVFS external directory   
    980 
    981983        // create "dev" and "external" directories.
    982984        devfs_global_init( process_zero.vfs_root_xp,
    983                            &devfs_root_inode_xp,
     985                           &devfs_dev_inode_xp,
    984986                           &devfs_external_inode_xp );
    985987
     
    991993
    992994        // register DEVFS root and external directories
    993         devfs_ctx_init( devfs_ctx, devfs_root_inode_xp, devfs_external_inode_xp );
     995        devfs_ctx_init( devfs_ctx, devfs_dev_inode_xp, devfs_external_inode_xp );
    994996    }   
    995997
    996998    /////////////////////////////////////////////////////////////////////////////////
    997     // global &local synchro to protect File System initialisation
    998999    if( core_lid == 0 ) remote_barrier( XPTR( io_cxy , &global_barrier ),
    9991000                                        (info->x_size * info->y_size) );
    10001001    barrier_wait( &local_barrier , info->cores_nr );
     1002    /////////////////////////////////////////////////////////////////////////////////
    10011003
    10021004    if( (core_lid ==  0) && (local_cxy == 0) )
     
    10071009    // STEP 7 : All CP0s complete in parallel the DEVFS tree initialization.
    10081010    //          Each CP0 get the "dev" and "external" extended pointers from
    1009     //          values storred in cluster IO. Then CP0 in cluster(i) creates the
    1010     //          DEVFS "internal directory, and creates the pseudo-files for all
    1011     //          chdevs contained in cluster (i).
     1011    //          values stored in cluster IO.
     1012    //          Then CP0 in cluster(i) creates the DEVFS "internal directory,
     1013    //          and creates the pseudo-files for all chdevs in cluster (i).
    10121014    /////////////////////////////////////////////////////////////////////////////////
    10131015
    10141016    if( core_lid == 0 )
    10151017    {
    1016         xptr_t  root_inode_xp;       // extended pointer on DEVFS root directory
    1017         xptr_t  external_inode_xp;   // extended pointer on DEVFS external directory   
    1018 
    10191018        // get extended pointer on "extend" field of VFS context for DEVFS in cluster IO
    10201019        xptr_t  extend_xp = XPTR( io_cxy , &fs_context[FS_TYPE_DEVFS].extend );
     
    10231022        devfs_ctx_t * devfs_ctx = hal_remote_lpt( extend_xp );
    10241023       
    1025         root_inode_xp     = hal_remote_lwd( XPTR( io_cxy , &devfs_ctx->root_inode_xp ) );
    1026         external_inode_xp = hal_remote_lwd( XPTR( io_cxy , &devfs_ctx->external_inode_xp ) );
    1027 
    1028         devfs_local_init( root_inode_xp,
    1029                           external_inode_xp );
    1030     }
    1031 
    1032     /////////////////////////////////////////////////////////////////////////////////
    1033     // global &local synchro to protect File System initialisation
     1024        devfs_dev_inode_xp      = hal_remote_lwd( XPTR( io_cxy ,
     1025                                                        &devfs_ctx->dev_inode_xp ) );
     1026        devfs_external_inode_xp = hal_remote_lwd( XPTR( io_cxy ,
     1027                                                        &devfs_ctx->external_inode_xp ) );
     1028
     1029        // populate DEVFS in all clusters
     1030        devfs_local_init( devfs_dev_inode_xp,
     1031                          devfs_external_inode_xp,
     1032                          &devfs_internal_inode_xp );
     1033    }
     1034
     1035    /////////////////////////////////////////////////////////////////////////////////
    10341036    if( core_lid == 0 ) remote_barrier( XPTR( io_cxy , &global_barrier ),
    10351037                                        (info->x_size * info->y_size) );
    10361038    barrier_wait( &local_barrier , info->cores_nr );
     1039    /////////////////////////////////////////////////////////////////////////////////
    10371040
    10381041    if( (core_lid ==  0) && (local_cxy == 0) )
     
    10401043               __FUNCTION__, (uint32_t)hal_time_stamp());
    10411044
    1042     /////////////////////////////////////////////////////////////////////////////////
    1043     // STEP 8 : CP0 in I/O cluster creates the process_init and print banner.
     1045    #if CONFIG_KINIT_DEBUG
     1046    vfs_display( vfs_root_inode_xp );
     1047    #endif
     1048
     1049    /////////////////////////////////////////////////////////////////////////////////
     1050    // STEP 8 : CP0 in I/O cluster creates the first user process (process_init)
    10441051    /////////////////////////////////////////////////////////////////////////////////
    10451052
     
    10501057
    10511058    /////////////////////////////////////////////////////////////////////////////////
    1052     // global syncho to protect access to File System
    10531059    if( core_lid == 0 ) remote_barrier( XPTR( info->io_cxy , &global_barrier ),
    10541060                                        (info->x_size * info->y_size) );
    10551061    barrier_wait( &local_barrier , info->cores_nr );
     1062    /////////////////////////////////////////////////////////////////////////////////
    10561063
    10571064    if( (core_lid ==  0) && (local_cxy == 0) )
Note: See TracChangeset for help on using the changeset viewer.