OS-based electronic products usually burn kernel to norfash, because it can be read and written by byte, but norflash is more expensive than NAND Flash, in addition, NAND Flash is based on block read/write, for example, one-time read/write of 512 bytes (Block ). if the NAND flash of MLC is read by PAGE and a page contains about 4 K bytes, how can we start the content based on NAND Flash? The steps are as follows:
1. at present, some NAND flash controller chips will read The 0th page content of The 0th block of NAND flash into the Controller buffer by default, so that a small program (IPL) can be placed on the 0th page of The 0th block) read the Linux kernel code to the memory.
2. the Linux kernel is generally about 2 MB. After reading the memory at a time, start the kernel function to start the operating system. After the operating system is started, it can be mounted to the root file system.
Next, let's take a look at the compilation code of the Startup Program Based on ARM9:
_ Start: <br/>; @ set up stack to end of MEMC <br/> movsp, #-4 <br/>; @ reloc Params: destination = MEMC + 0x1000 source = nfc_buf, size = 4kb <br/> ldrr0, = ldr_base <br/> ldrr1, = nfc_buf <br/> movr2, #0x1000 <br/> blburst8 <br/> adrlr, l_main <br/> movlr, LR, LSL #20 <br/> movlr, LR, LSR #20 <br/> ldrr11, = ldr_base <br/> addlr, LR, R11 <br/> bburst8 <br/> l_main: <br/> blmain <br/>; @ loop forever <br/> l_end: <br/> bl_end < /P> <p> burst8: <br/> mongodbsp !, {R4-r10} <br/> l_burst8_next: <br/> ldmiar1 !, {R3-r10} <br/> stmiar0 !, {R3-r10} <br/> subsr2, R2, #32 <br/> bgtl_burst8_next <br/> ldmiasp !, {R4-r10} <br/> movpc, LR