VxWorks booting process #
本文根据VxWorks系统启动的流程,分文件来梳理了启动过程中执行的函数,对了解VxWorks的启动流程有比较大的帮助。
一、romInit.s -> romInit() #
/* romInit - entry point for VxWorks in ROM */
-
initialize CPU and memory
-
copy bootrom to ROM_TEXT_ADRS
-
initialize STACK
-
lock INTERRUPT
-
jump to romStart()
二、romStart.c->romStart() #
/* this is the first C code after reset */
-
clear memory
-
copy vxWorks ROM image to RAM
-
uncompress if necessary
-
jump to the object code ENTRY after uncompress
- usrEntry - entry point for vxWorks_romCompress, vxWorks_rom and bootrom
- sysInit() for vxWorks in RAM(Uncompress)
三、sysALib.s->sysInit() #
/* this routine is the system start-up entry point for VxWorks in RAM */
-
disable INTERRUPTS
-
set up STACK
-
jump to usrInit() in usrConfig.c
三、usrEntry.c->usrEntry() #
/* usrEntry - entry point for vxWorks_romCompress, vxWorks_rom and bootrom images. */
- just jump to usrInit() in usrConfig.c
四、usrConfig.c->usrInit() #
/* usrInit - user-defined system initialization routine */
-
call sysHwInit0() for BSP-specific initialization
-
zero out BSS segment for entruing all valiables are initialzed to 0
-
initialize CACHE and disable CACHE
-
setting up the interrupt vector base table
-
installing exception vectors
-
call sysHwInit() to initialize system hardware
-
enable CACHE, including instruction cache and data cache
-
call usrKernelInit() to configure Wind Kernel
-
if necessary, start WDB before Wind Kernel
-
start up root task usrRoot()
/NOTE: in this point, multitasking environment is not enabled/
五、usrConfig.c->usrRoot() #
/* this is the first task running under multitasking environment, it performs all final initialization and start other tasks */
-
call usrKernelCoreInit() to initialize Wind kernel facilities
-
initialize power managerment, only for PENTIUM
-
initialize system memory pool
-
configure memory managerment LIB
-
initialize sysCtrl support
-
initialize RTP(real time process)
-
initialize shared data
-
initialize shared LIB
-
initialize MMU
-
initialize environment valiables
-
initialize task stack protecting mode
-
initialize signals
-
setup system timers
-
initialize IO system
-
initialize select LIB
-
initialize process file system
-
install console driver and create serial devices
-
initialize PC_CONSOLE
-
initialize hash table facilities
-
initialize symbol table facilities
-
initialize exception handling
-
initialize list LIB
-
initialize logging
-
initialize POSIX clock
-
initialize POSIX timers
-
initialize POSIX shared memory
-
initialize POSIX memory mapped
-
initialize debugging
-
initialize pipe driver
-
initialize POSIX asyc IO support
-
initialize STDIO LIB
-
initialize POSIX queued signals
-
initialize POSIX semaphores
-
initialize POSIX threads
-
initialize POSIX scheduler
-
initialize signals events
-
initialize POSIX message queues
-
dosFs2 filesystem initialization
-
initialize ramFs filesystem
-
install ram disk driver
-
install memory disk driver
-
install pseudo-terminal driver
-
initialize SCSI
-
initialize FD if necessary
-
initialize ATA
-
initialize LPT if necessary
-
initialize TFFS
-
initialize formatted IO
-
initialize float point facilites
-
install DSP surport if necessary
-
initialize system calls
-
initialize performance monitoring tools
-
initialize module loader and unloader
-
initialize local storage support, such as USB bulk storage
-
initialize network if INCLUDED
-
initialize USB component if INCLUDED
-
initialize shared memory objects
-
create system and status symbol table
-
initialize C++ LIB support
-
initialize Wind Web server
-
if windview INCLUDED, initialize timestamp
-
initialize WDB debug agent
-
initialize interactive SHELL
-
initialize WINDML if INLCUDED
-
turn on power managerment
-
initialize filesystem boot component
-
initialize Network boot component
-
initialize the usb keyboard after shell Initialization
-
optimize MMU
-
start up usrer’s application
-
initialize RTP startup facility