Changeset 23 for trunk/kernel/kern/kernel_init.c
- Timestamp:
- Jun 18, 2017, 10:06:41 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/kernel_init.c
r19 r23 2 2 * kernel_init.c - kernel parallel initialization 3 3 * 4 * Authors : Alain Greiner (2016)5 * Mohamed Lamine Karaoui (2016)4 * Authors : Mohamed Lamine Karaoui (2015) 5 * Alain Greiner (2016,2017) 6 6 * 7 7 * Copyright (c) Sorbonne Universites … … 53 53 #include <vfs.h> 54 54 #include <soclib_tty.h> 55 56 // TODO #include <devfs.h> 55 #include <devfs.h> 56 57 57 // TODO #include <sysfs.h> 58 58 … … 601 601 // @ return 0 if success / return EINVAL if not found. 602 602 /////////////////////////////////////////////////////////////////////////////////////////// 603 static error_t core_get_identifiers( boot_info_t * info,604 uint32_t* lid,603 static error_t get_core_identifiers( boot_info_t * info, 604 lid_t * lid, 605 605 cxy_t * cxy, 606 606 gid_t * gid ) … … 637 637 void kernel_init( boot_info_t * info ) 638 638 { 639 uint32_tcore_lid = -1; // running core local index639 lid_t core_lid = -1; // running core local index 640 640 cxy_t core_cxy = -1; // running core cluster identifier 641 641 gid_t core_gid; // running core hardware identifier … … 646 646 647 647 // all cores get core identifiers 648 error = core_get_identifiers( info,648 error = get_core_identifiers( info, 649 649 &core_lid, 650 650 &core_cxy, … … 664 664 ///////////////////////////////////////////////////////////////////////////////// 665 665 666 kinit_dmsg("\n[INFO] %s : core[%x][%d] exit barrier 0 \n",667 __FUNCTION__ , core_cxy , core_lid );666 kinit_dmsg("\n[INFO] %s : core[%x][%d] exit barrier 0 at cycle %d\n", 667 __FUNCTION__ , core_cxy , core_lid , hal_time_stamp() ); 668 668 669 669 // all cores check core identifiers … … 675 675 hal_core_sleep(); 676 676 } 677 else678 {679 kinit_dmsg("\n[INFO] %s : core[%x][%d] enters at cycle %d / sp = %x\n",680 __FUNCTION__ , core_cxy , core_lid , hal_time_stamp() , hal_get_stack() );681 }682 677 683 678 // CP0 initializes the local cluster manager (cores and memory allocators) … … 691 686 __FUNCTION__ , local_cxy ); 692 687 hal_core_sleep(); 693 }694 else695 {696 kinit_dmsg("\n[INFO] %s : core[%x][%d] initialised cluster at cycle %d\n",697 __FUNCTION__ , core_cxy , core_lid , hal_time_stamp());698 688 } 699 689 } … … 706 696 ///////////////////////////////////////////////////////////////////////////////// 707 697 708 kinit_dmsg("\n[INFO] %s : core[%x][%d] exit barrier 1 \n",709 __FUNCTION__ , core_cxy , core_lid );698 kinit_dmsg("\n[INFO] %s : core[%x][%d] exit barrier 1 at cycle %d\n", 699 __FUNCTION__ , core_cxy , core_lid , hal_time_stamp() ); 710 700 711 701 // all cores get pointer on local cluster manager and on core descriptor … … 756 746 ///////////////////////////////////////////////////////////////////////////////// 757 747 758 kinit_dmsg("\n[INFO] %s : core[%x][%d] exit barrier 2 \n",759 __FUNCTION__ , core_cxy , core_lid );748 kinit_dmsg("\n[INFO] %s : core[%x][%d] exit barrier 2 at cycle %d\n", 749 __FUNCTION__ , core_cxy , core_lid , hal_time_stamp() ); 760 750 761 751 // all cores initialize the private idle thread descriptor … … 789 779 } 790 780 791 // TODO CP0 in IO cluster initialize VFS, devFS and sysFS 792 { 793 // devfs_root_init(); 794 // sysfs_root_init(); 795 // clusters_sysfs_register(); 796 // vfs_init(); 797 // sysconf_init(); 798 } 781 printk("\n bloup 0\n"); 782 783 // CP0 in all clusters initializes cooperatively VFS and DEVFS 784 if( (core_lid == 0) ) 785 { 786 xptr_t root_inode_xp; 787 788 // initialize root File System 789 if( CONFIG_VFS_ROOT_IS_FATFS ) 790 { 791 root_inode_xp = fatfs_init(); 792 } 793 else 794 { 795 printk("\n[PANIC] in %s : root FS must be FATFS\n", __FUNCTION__ ); 796 hal_core_sleep(); 797 } 798 799 if( root_inode_xp == XPTR_NULL ) 800 { 801 printk("\n[PANIC] in %s : core[%x][%d] cannot initialize file system\n", 802 __FUNCTION__ , local_cxy , core_lid ); 803 hal_core_sleep(); 804 } 805 806 printk("\n bloup 1\n"); 807 808 // mount the DEVFS File system 809 devfs_mount( root_inode_xp , "dev" ); 810 } 811 812 printk("\n bloup 2\n"); 799 813 800 814 // CP0 in I/O cluster print banner … … 811 825 ///////////////////////////////////////////////////////////////////////////////// 812 826 813 kinit_dmsg("\n[INFO] %s : core[%x][%d] exit barrier 3 \n",814 __FUNCTION__ , core_cxy , core_lid );827 kinit_dmsg("\n[INFO] %s : core[%x][%d] exit barrier 3 at cycle %d\n", 828 __FUNCTION__ , core_cxy , core_lid , hal_time_stamp() ); 815 829 816 830 // each core activates its private PTI IRQ
Note: See TracChangeset
for help on using the changeset viewer.