简体   繁体   中英

Will bootloader for armv7 work for armv8?

I am trying to write a bootloader according to armv7 architecture using armv7 assembly instruction set ? Ex:

Setting cpu to svc mode on reset:

mrs r0, cpsr
bic r0, r0,#0x1f
orr r0, r0,#0xd3
msr cpsr, r0
mov pc, lr

Will the same bootloader work on armv8. As armv8 also supports aarch32 . But on the other hand it also has many differences.

Not necessarily for a couple of reasons, first off if you are in hyp mode you cant get back from that that easily. Second, if you are in aarch64 mode then that is a different instruction set. So in part it depends on where this code is how early in the bootloader is this truly the bootloader or do you have other code that comes before this (that puts you in a state that code like this won't work).

Short answer, no this code not only won't always work for armv8 it won't always work for armv7.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM