bootloader

On the simulator, the bootloader is automatically invoked by the 'oct-sim' script

 

To change the arguments provided to the bootoct command during simulator, an alternate u-boot environment file that specifies an alternate default boot command needs to be created. Multiple commands can be specified, with a semicolon (;) used as a separator. To change the stack and heap sizes, an environment file with the following content should be created:

 

oct-sim option '-envfile=env_file_name"

 

 

Outline of simple executive application startup:

 

  • bootoct reads an Octeon executive application ELF file the specified address (defaults to 0x100000). The ELF file is parsed, and loaded into memory, including copying the data segments for all cores that will run this application. Memory for each core's stack and heap is also allocated.
  • bootoct also creates a table in memory with an entry for each core that describes the application specific initialization that it needs to perform. This includes the TLB mappings required, application entry point, stack address/size, heap address/size.
  • when core 0 is ready to start the other cores, it takes them out of reset, at which point they start execution from flash at the reset exception vector. Based on their non-zero core number, after performing the necessary per-core initialization, they jump to dram and process the table set up by core 0. When core 0 takes the other cores out of reset it also processes its own table entry. Core 0 also resets its cycle counter when it takes the other cores out of reset so that its cycle counter will be similar to the other cores' cycle counters.
  • when the processing of the table is complete, each core sets some register state for the application, and does an ERET (return from exception) to the application entry point. The address of the table entry for the core is included in one of the registers.
  • the stack, heap, and argc/argv are set for the application by init code called from crt0
  • if the application is linked against the libcvmx.a library, the __cvmx_app_init() routine is called to initialize the simple exec. All cores are synchronized at this time so they will start main() at the same time.
  • all cores enter main() at close to the same time.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值