What is the booting process for ARM?

后端 未结 3 396
无人及你
无人及你 2021-01-29 18:26

As we know, for X86 architecture: After we press the power button, machine starts to execute code at 0xFFFFFFF0, then it starts to execute code in BIOS in order to do hardware i

3条回答
  •  清歌不尽
    2021-01-29 19:00

    After Power is ON The cpu will start executing exception mode 1st one is reset ,As Reset must run as superviser mode since CPU doesn't know the status of the register at this time of execution it cant go into the superviser mode .To achieve this small code need to be written (See at end). after this other exceptions can be handled by loading the address into PC .

    .globl _start
     _start: b       reset
        ldr     pc, _undefined_instruction
        ldr     pc, _software_interrupt
        ldr     pc, _prefetch_abort
        ldr     pc, _data_abort
        ldr     pc, _not_used
        ldr     pc, _irq
        ldr     pc, _fiq
    
    reset:
        mrs     r0,cpsr                 /* set the cpu to SVC32 mode        */
        bic     r0,r0,#0x1f             /* (superviser mode, M=10011)       */
        orr     r0,r0,#0x13
        msr     cpsr,r0
    

提交回复
热议问题