Re: How to update OS image(nk.bin) while the OS is running?



There approach you describe is one of many possible ways to update the
image. A couple of things to think about:

What format of the os image does the bootloader expect? Some
bootloaders expect the image to have been stored in .bin format and
unpacks the image into RAM, other bootloaders expect to find an
allready unpacked image so it only needs to copy a chunk of memory from
flash to ram without any processing.

For saving the image to flash, you'll need some sort of driver, yes.
Exactly what support is needed also depends on what the bootloader
expects. Some bootloaders expect a filesystem (fat, binfs etc), others
just expect the image to be a plain, linear chunk of data at some
predefined area in the flash. You'll have to find out what your
bootloader expects, so you can implement the proper way of storing the
image.

Is this feature for in-house/authorized service use only? If not, what
will the impact be when an update goes bad? Do you need to provide ways
to recover from a failed update (by for example also implementing
update functionality in the bootloader)?

Henrik Viklund
http://www.addlogic.se

lljj462@xxxxxxx wrote:
Hello all:
First, my target is s3c2440 device and OS is wince4.2. The device
has 64M nandflash、64M sdram and usb host port.
The old OS image(NK.bin) is stored in flash, when my device's power
is on, the NK.bin
is copied to RAM and run from there. Now, I have an application (for
example, update.exe)
and a new NK.bin both stored in USB disk, when the OS is running, I
want to run the application from USB disk to replaced the old
NK.bin(stored in flash) by the new NK.bin(stored in USB disk).

I have a solution, but I am not sure.
1) Run the application to copy the new NK.bin to RAM;
2) Write the NK.bin to flash from RAM.

For the first step, my device's sdram size is 64M, and NK.bin size
is 24M, Is it enough to copy NK.bin to RAM, and how to copy?
For the second step, Can I use some API fuctions to write/erase the
nandflash or Must I write a driver to do this? that is to say, how can
I write the NK.bin to nandflash?

Is there anything wrong with my solution or Is there any other ways
to accomplish this task? Pls help me, any advice would be my big
pleasure.

Thanks in advance.

Best Regards.

.



Relevant Pages

  • Re: Relocate from nor to ddr CE 5.0
    ... it depends on the bootloader implementation; ... programmed into flash. ... but the image info says it belongs to ram. ... blt CODEINRAM ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Relocate from nor to ddr CE 5.0
    ... bootloader and let it think it is a flash image. ... but the image info says it belongs to ram. ... blt CODEINRAM ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Relocate from nor to ddr CE 5.0
    ... That is the job of the bootloader; nothing special on the part of Platform ... targeted to flash, and if it is then the bootloader programs it. ... to run in RAM, ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Relocate from nor to ddr CE 5.0
    ... programmed into flash. ... but the image info says it belongs to ram. ... Your bootloader needs to have code that recognizes if the image is ... blt CODEINRAM ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Bootloader Placement
    ... data on an MMC card to see whether an update of the flash is necessary and, ... which has the bootloader code as part of it. ... the copy from flash to RAM on startup won't know how much there is to copy. ... and force a hardware reset. ...
    (comp.arch.embedded)

Loading