⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 loader.h

📁 windows wm5 下的bootloader代码
💻 H
字号:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//

#ifndef _LOADER_H_
#define _LOADER_H_

#include <args.h>
#include <bsp_base_reg_cfg.h>
#include <oal_memory.h>

// Bootloader version.
//
#define EBOOT_VERSION_MAJOR     2
#define EBOOT_VERSION_MINOR     14


//------------------------------------------------------------------------------
//
//  Section Name:   Memory Configuration
//  Description.:   The constants defining memory layout below must match
//                  those defined in the .bib files.
//
//------------------------------------------------------------------------------

#define CACHED_TO_UNCACHED_OFFSET   0x20000000

//------------------------------------------------------------------------------
//
//  Define Name:    RAM_START/END
//  Description:    Defines the start/end address of cached RAM.
//
//------------------------------------------------------------------------------

#define RAM_START                   (0x80000000)
#define RAM_SIZE                    (64 * 1024 * 1024)              // 64MB
#define RAM_END                     (RAM_START + RAM_SIZE - 1)


// File cache (temporary store for flash images).
#define FILE_CACHE_START            (0x80070000 | CACHED_TO_UNCACHED_OFFSET)                                                                                    
#define FILE_CACHE_SIZE             (0x02A80000)


// Driver globals pointer (parameter sharing memory used by bootloader and OS).
//
#define pBSPArgs                    ((BSP_ARGS *) IMAGE_SHARE_ARGS_UA_START)


// Bootloader configuration parameters (stored in the bootloader parameter partition in NAND flash).
//
typedef struct _NAND_BOOTLOADER_PARAMS_
{
    ULONG  Signature;           // Config signature (used to validate).
    USHORT VerMajor;            // Config major version.
    USHORT VerMinor;            // Config minor version.
    ULONG  StoreOffset;         // Region storage location (BINFS partition offset).
    ULONG  RunAddress;          // Region RAM address (loader copies region to this address).
    ULONG  Length;              // Region length (in bytes).
    ULONG  LaunchAddress;       // Region launch address.

} NAND_BOOTLOADER_PARAMS, *PNAND_BOOTLOADER_PARAMS;

// Download image type (used to decide amongst storage options).
//
typedef enum _IMAGE_TYPE_
{
    IMAGE_OS_BIN,
    IMAGE_OS_FLASH
} IMAGE_TYPE, *PIMAGE_TYPE;

// Loader function prototypes.
//
BOOL InitEthDevice(PBOOT_CFG pBootCfg);
int OEMReadDebugByte(void);
BOOL OEMVerifyMemory(DWORD dwStartAddr, DWORD dwLength);
void Launch(DWORD dwLaunchAddr);
BOOL WriteDiskImageToSmartMedia(DWORD dwImageStart, DWORD dwImageLength, BOOT_CFG *pBootCfg);
BOOL FormatSmartMedia(void);
void OEMWriteDebugLED(WORD wIndex, DWORD dwPattern);

#endif  // _LOADER_H_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -