Please follow the steps to observe the reclaiming process. #define _PCD_VALUE_PcdFlashNvStorageFtwSpareSize 0x00020000U #define _PCD_VALUE_PcdFlashNvStorageFtwSpareBase 0xFFFB0000U #define _PCD_VALUE_PcdFlashNvStorageFtwWorkingSize 0x00002000U Then run your program in DOS, and there will be a state. #define _PCD_VALUE_PcdFlashNvStorageFtwWorkingBase 0xFFFAE000U Then start bochs in debug mode, do not set any breakpoints, and execute directly to the dos interface.
#define _PCD_VALUE_PcdFlashNvStorageVariableSize 0x0001D000U #define _PCD_VALUE_PcdFlashNvStorageVariableBase 0xFFF90000U #define FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_SPARE_OFFSET 0x5b0000 c continue executing cont continue s count execute count instructions, default is 1 step count s cpu count for SMP simulation, execute count instructions on cpu, default is 1 step cpu count s all count for SMP simulation, execute count instructions on all cpus step all count Ctrl-C stop execution, and return to command line prompt Ctrl-D if at empty line on command line, exit q quit debugger. #define FLASH_REGION_NVSTORAGE_SUBREGION_NV_FTW_WORKING_OFFSET 0x5ae000 From here, you may use the following commands: 8.1.1. #define FLASH_REGION_NVSTORAGE_SUBREGION_NV_VARIABLE_STORE_OFFSET 0x590000 Below files which are generated in build-time provide the regions information.
When the platform restarts after power-off happens on NV reclaiming process, the driver checks the flag NV_FTW_WORKING that the NV reclaiming is not completed, it restores variables from NV_FTW_SPARE into NV_VARIABLE_STORE. This page provides a way to observe reclaiming process of EDKII Variable Services with UEFI Fault Tolerant Write Protocol.ĮDKII Variable Services provides reclaim process with the recovery mechanism. I use a PC emulator to run a simple BIOS without breaking my PC at home. However, because bochs is a software-implemented CPU (.
I need burn BIOS in PC and see the process so that I can learn more.īut I don't want to use my PC to update BIOS. Compared with the professional debugger of WinDbg, the debugging function of bochs is far weaker. For me, a computer is necessary to help me thinking. I admire mathematicians who can present their theories in boards with very long formulas without computers.
I need to write BIOS program and run it in a machine to make sure that I know something in BIOS. I can tell you the algorithm but not the whole. How do I proof it? I have blurred BIOS algorithm in my mind but it cannot be correctly run in my brain. Our brains are computers but not quick and correct. The computer of Chinese text is 電 (electrical) 腦 (brain). What is computer? I consider computer is a machine that quickly and automatically runs algorithm.