Share via


NKForceCleanBoot (Compact 2013)

10/16/2014

This function forces the operating system (OS) to boot from a clean object store file system when called from the OEMInit function.

This function can also be called after the OS has started to force the next boot process to start from a clean object store file system.

Syntax

VOID NKForceCleanBoot(void);

Parameters

None.

Return Value

None.

Remarks

The hardware on some devices accidentally preserves RAM contents after brief power losses due to capacitance.

Unless these devices are intentionally preserving RAM contents using self-refresh, these devices should always call this function so the object store does not appear valid at boot time. Otherwise, devices are likely to experience crash problems during boot.

Code Example

Description

The following example code shows how to use NKForceCleanBoot inside the OEMInit function implementation.

Code

// Check clean boot flag in BSP Args area
    //
    {
      // Set the global shared Args flag
      BOOL *bCleanBootFlag = (BOOL*)  OALArgsQuery(BSP_ARGS_QUERY_CLEANBOOT);

      if(*bCleanBootFlag)
      {
        OALMSG(1, (TEXT("OEM: Force clean boot.\r\n")));

        // Clear the flag so that we don't enter this if statement in the next boot unless the flag is set again.
        *bCleanBootFlag = FALSE;

        // Tell filesys.exe that we want a clean boot.
        NKForceCleanBoot();
      }
    }

Requirements

Header

pkfuncs.h

Library

coredll.lib

See Also

Reference

Kernel Functions Available to the OAL
OEMInit