1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | // kexec/purgatory.c #iclude <stddef.h> const char purgatory[] = { 0x7f, 0x45, 0x4c, 0x46, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x15, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x20, 0x00, 0x1d, ... ... 0x79, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x00, }; size_t purgatory_size = sizeof(purgatory); // kexec/arch/ppc64/kexec-elf-ppc64.c 中分读入 purgatory: /* Add v2wrap to the current image */ elf_rel_build_load(info, &info->rhdr, purgatory, purgatory_size, 0, max_addr, 1, 0); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | _GLOBAL(kexec_wait) bl 1f 1: mflr r5 addi r5,r5,kexec_flag-1b 99: HMT_LOW #ifdef CONFIG_KEXEC /* use no memory without kexec */ lwz r4,0(r5) cmpwi 0,r4,0 bnea 0x60 #endif b 99b /* this can be in text because we won't change it until we are * running in real anyways */ kexec_flag: .long 0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ... ... /* copy dest pages, flush whole dest image */ mr r3,r29 bl .kexec_copy_flush /* (image) */ /* turn off mmu */ bl real_mode /* copy 0x100 bytes starting at start to 0 */ li r3,0 mr r4,r30 /* start, aka phys mem offset */ li r5,0x100 li r6,0 bl .copy_and_flush /* (dest, src, copy limit, start offset) */ 1: /* assume normal blr return */ /* release other cpus to the new kernel secondary start at 0x60 */ mflr r5 li r6,1 stw r6,kexec_flag-1b(5) ... ... |
1 2 3 4 5 6 7 8 9 10 11 12 13 | 80: LOADADDR(6,kernel) ld 4,0(6) # load the kernel address LOADADDR(6,run_at_load) # the load flag lwz 7,0(6) # possibly patched by kexec-elf-ppc64 stw 7,0x5c(4) # and patch it into the kernel li 5,0 # r5 will be 0 for kernel mtctr 4 # prepare branch too mr 3,16 # restore dt address # skip cache flush, do we care? bctr # start kernel |
1 2 3 4 5 6 7 8 | crashkernel=<range1>:<size1>[,<range2>:<size2>,...][@offset] range=start-[end] 'start' is inclusive and 'end' is exclusive. For example: crashkernel=512M-2G:64M,2G-:128M |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |