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

📄 loader.h

📁 我自己编译的armv4i wince60模拟器的bps源文件,已经验证可以使用,欢迎下载
💻 H
字号:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//

#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     15


//------------------------------------------------------------------------------
//
//  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)
#define NOR_CACHE_START             (FILE_CACHE_START+FILE_CACHE_SIZE) // beginning of RAMFMD space
#define NOR_CACHE_LENGTH            (0x00100000) // 1mb



// 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 + -