亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? nand.c

?? 三星2440 cpu WINCE 5.00板級支持包
?? C
字號:
//
// 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.
//
#include <windows.h>
#include <bsp.h>
#include "loader.h"
#include <fmd.h>

// Number of beginning SmartMedia (NAND) blocks to mark as reserved.
//
#define NAND_START_RESERVED_BLOCKS      3

BOOL g_bSmartMediaExist = FALSE;		// Is there a SmartMedia card on this device?


// Define a dummy SetKMode function to satisfy the NAND FMD.
//
DWORD SetKMode (DWORD fMode)
{
    return(1);
}


/*
    @func   BOOL | WriteImageToSmartMedia | Stores the image cached in RAM to the Smart Media card.  We assume that FMD_Init has already been called at this point.
    @rdesc  TRUE = Success, FALSE = Failure.
    @comm    
    @xref   
*/
BOOL WriteDiskImageToSmartMedia(DWORD dwImageStart, DWORD dwImageLength, BOOT_CFG *pBootCfg)
{
    UINT32 ulLogicalSector;
    FlashInfo FlashInfo;
    SectorInfo *pSectInfo;
    BYTE *pBuffer;
    UINT32 ulBadBlocks = 0;
    UINT32 ulImageLengthSectors = 0;
    UINT8 MACCount = 0;

    UINT16 uSectorSize = 0;
    UINT32 ulBlockSize  = 0;
    UINT32 ulSectorsPerBlock  = 0;

    // If there isn't a SmartMedia card in the system, it'll be kind of hard to write an image to it...
    //
    if (!g_bSmartMediaExist)
    {
        EdbgOutputDebugString("WARNING: Smart Media device doesn't exist - unable to store image.\r\n");
        return(FALSE);
    }

    // Format the SmartMedia card prior to writing.
    //
    EdbgOutputDebugString("INFO: Formatting SmartMedia (please wait)...\r\n");
    if (!FormatSmartMedia())
    {
        EdbgOutputDebugString("ERROR: Failed to format SmartMedia.\r\n");
        return(FALSE);
    }

    EdbgOutputDebugString("INFO: Writing download image to SmartMedia (please wait)...\r\n");

    // Get NAND flash info.
    //
    if (!FMD_GetInfo(&FlashInfo))
    {
        EdbgOutputDebugString("ERROR: Unable to get SmartMedia flash information.\r\n");
        return(FALSE);
    }
    uSectorSize = FlashInfo.wDataBytesPerSector;
    ulBlockSize  = FlashInfo.dwBytesPerBlock;
    ulSectorsPerBlock = (ulBlockSize / uSectorSize);

    // Write the image to NAND flash (starting at sector 0, skipping bad blocks).
    //
    // NOTE: we're going to assume that the image being written to SmartMedia has been generated
    // by the disk image utility.  As such, the first two flash blocks are reserved for the Steppingstone
    // loader and the IPL.  We'll mark these sectors reserved and start the logical sector numbering at
    // 0 on the following sector.  This shouldn't affect our ability to store/load a single NK solution
    // since the logical sector numbering and the reserved status won't matter to the ReadImageFromSmartMedia
    // routine (below).
    //
    ulImageLengthSectors = (dwImageLength / (uSectorSize + sizeof(SectorInfo)));

    for (ulLogicalSector = 0, ulBadBlocks = 0, MACCount = 0; ulLogicalSector < ulImageLengthSectors ; ulLogicalSector++)
    {
        // Compute the physical sector address (equal to logical sector address plus compensation for any bad blocks).
        UINT32 ulPhysicalSector = ((ulBadBlocks * ulSectorsPerBlock) + ulLogicalSector);
        UINT32 ulBlockNumber    = (ulPhysicalSector / ulSectorsPerBlock);

        // If we're writing the first sector of a new block and the block is marked bad, skip the whole block.
        while (!(ulPhysicalSector % ulSectorsPerBlock) && (FMD_GetBlockStatus(ulBlockNumber) == BLOCK_STATUS_BAD))
        {
            ulBadBlocks++;

            // Recompute the sector and block numbers based on bad blocks.
            ulPhysicalSector += ulSectorsPerBlock;
            ulBlockNumber++;
        }

        // Have we walked off the end of flash?
        if (ulPhysicalSector > (FlashInfo.dwNumBlocks * ulSectorsPerBlock))
        {
            EdbgOutputDebugString("ERROR: SmartMedia sector write would be out of bounds (physical sector = 0x%x  max sector = 0x%x).\r\n", ulPhysicalSector, (FlashInfo.dwNumBlocks * ulSectorsPerBlock));
            return(FALSE);
        }

        // update the buffer to the current sector
        pBuffer = (BYTE *)(dwImageStart + (ulLogicalSector * (uSectorSize + sizeof(SectorInfo))));

        // sector info immediately follows the current sector
        pSectInfo = (SectorInfo *) (pBuffer + uSectorSize);
        
        // For NAND-only boots, the NOR flash at nGCS0 isn't available for retrieving the CS8900A MAC
        // address (nor is there a EEPROM connected to the CS8900A where we could store this address).
        // We'll use the logical sector field for the first couple reserved block sectors to store
        // the address.
        //
        if ((MACCount < 3) && !(pSectInfo->bOEMReserved & OEM_BLOCK_RESERVED))
        {
            pSectInfo->dwReserved1 = pBootCfg->CS8900MAC[MACCount++];
        }

        // Write the sector to flash...
        //
        if (!FMD_WriteSector(ulPhysicalSector, pBuffer, pSectInfo, 1))
        {
            EdbgOutputDebugString("ERROR: Failed to write to SmartMedia (sector number 0x%x).\r\n", ulPhysicalSector);
            return(FALSE);
        }
    }

    EdbgOutputDebugString("INFO: Writing image to SmartMedia completed successfully.\r\n");
    return(TRUE);

}


/*
    @func   BOOLEAN | FormatSmartMedia | Performs a low-level format on the SmartMedia card.
    @rdesc  TRUE == Success and FALSE == Failure.
    @comm    
    @xref   
*/
BOOL FormatSmartMedia(void)
{
    UINT32 ulBlockNumber;
    FlashInfo FlashInfo;

    // Get NAND flash data bytes per sector.
    //
    if (!FMD_GetInfo(&FlashInfo))
    {
        EdbgOutputDebugString("ERROR: Unable to get SmartMedia flash information.\r\n");
        return(FALSE);
    }

    for (ulBlockNumber = 0 ; ulBlockNumber < FlashInfo.dwNumBlocks ; ulBlockNumber++)
    {
        // Is the block bad?
        //
        if (FMD_GetBlockStatus(ulBlockNumber) == BLOCK_STATUS_BAD)
        {
            EdbgOutputDebugString("INFO: Found bad SmartMedia block [0x%x].\r\n", ulBlockNumber);
            continue;
        }

        // Erase the block...
        //
        if (!FMD_EraseBlock(ulBlockNumber))
        {
            EdbgOutputDebugString("ERROR: Unable to erase SmartMedia block 0x%x.\r\n", ulBlockNumber);
            return(FALSE);
        }
    }

    return(TRUE);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91久久精品一区二区| 丁香婷婷深情五月亚洲| 亚洲精品视频在线观看网站| 久久精品夜色噜噜亚洲a∨| 欧美老人xxxx18| 欧美日韩国产高清一区| 色婷婷久久久亚洲一区二区三区| 伦理电影国产精品| 精品一区二区三区在线播放| 亚洲成人黄色影院| 亚洲午夜精品一区二区三区他趣| 成人欧美一区二区三区视频网页 | 激情五月播播久久久精品| 国产98色在线|日韩| 久久精品99国产精品| 日韩电影在线免费观看| 亚洲福利视频三区| 亚洲最色的网站| 亚洲一区二区四区蜜桃| 亚洲日本乱码在线观看| 日本一区二区高清| 自拍偷拍国产精品| 亚洲日本电影在线| 伊人一区二区三区| 亚洲欧美韩国综合色| ㊣最新国产の精品bt伙计久久| 国产精品蜜臀在线观看| 国产免费久久精品| 国产精品欧美一级免费| 国产精品久久久久久久久果冻传媒| 国产精品久久久久影视| 综合自拍亚洲综合图不卡区| 成人免费小视频| 国产精品成人网| 亚洲一区视频在线观看视频| 五月婷婷综合网| 国内精品不卡在线| 国产mv日韩mv欧美| 色94色欧美sute亚洲线路一ni| 色悠悠久久综合| 欧美精品日韩一区| 91.麻豆视频| 欧美激情中文不卡| 亚洲乱码国产乱码精品精的特点| 亚洲国产日韩在线一区模特| 日韩精品久久久久久| 粉嫩高潮美女一区二区三区| 91在线一区二区三区| 欧美日韩亚洲综合一区二区三区| 日韩一区国产二区欧美三区| 欧美成人a在线| 亚洲美女在线国产| 日本成人在线不卡视频| 国产一区二区三区| jiyouzz国产精品久久| 91成人网在线| 欧美午夜一区二区| 国产欧美精品一区二区色综合朱莉| 中文字幕亚洲精品在线观看| 午夜精品久久久久久久蜜桃app| 久久精品999| 91污片在线观看| 91精品国模一区二区三区| 国产欧美日韩在线看| 亚洲香肠在线观看| 蜜桃91丨九色丨蝌蚪91桃色| 色噜噜狠狠成人网p站| 欧美日韩一区二区不卡| 国产婷婷色一区二区三区四区| 亚洲一区二区在线免费看| 加勒比av一区二区| av一区二区久久| 欧美成人一区二区三区在线观看| 中文子幕无线码一区tr | 国产精品亚洲人在线观看| 色综合视频一区二区三区高清| 2022国产精品视频| 午夜激情一区二区| 波多野结衣精品在线| 日韩精品一区在线| 亚洲精品乱码久久久久久日本蜜臀| 久久国产欧美日韩精品| 欧美性生活一区| 国产拍欧美日韩视频二区| 亚洲视频免费在线| 丁香婷婷综合色啪| 亚洲精品一区二区三区精华液 | 91亚洲国产成人精品一区二区三 | 91精品国产综合久久福利| 亚洲精品成人少妇| av电影在线不卡| 中文欧美字幕免费| 国产 欧美在线| 久久久国产综合精品女国产盗摄| 九色porny丨国产精品| 欧美一二三四区在线| 日本亚洲最大的色成网站www| 欧美综合天天夜夜久久| 一区二区三区精品| 在线免费观看一区| 亚洲女爱视频在线| 国产成人亚洲精品青草天美| 欧美日韩国产综合一区二区| 亚洲制服丝袜av| 91美女蜜桃在线| 综合久久国产九一剧情麻豆| 免费在线看成人av| 精品国产免费久久| 久久成人免费日本黄色| 678五月天丁香亚洲综合网| 亚洲自拍与偷拍| 在线观看视频一区二区| 亚洲福利一二三区| 欧美日韩综合在线| 亚洲一区二区四区蜜桃| 在线精品观看国产| 亚洲成精国产精品女| 欧美成人在线直播| 经典三级一区二区| 久久久精品免费观看| 国产精品一二一区| 中文字幕av不卡| 欧美系列在线观看| 丝袜国产日韩另类美女| 欧美一区二区三区在线看| 日韩影视精彩在线| 日韩免费观看高清完整版在线观看| 精品一区二区三区欧美| 26uuu欧美| 豆国产96在线|亚洲| 国产精品国产精品国产专区不蜜| www.性欧美| 国产精品电影一区二区三区| 国产精品66部| 中文欧美字幕免费| 91极品美女在线| 婷婷成人综合网| 精品国产三级a在线观看| 国产成人亚洲综合a∨婷婷| 中文字幕一区二区三中文字幕| av福利精品导航| 亚洲福利一区二区三区| 国产婷婷色一区二区三区四区| 不卡电影一区二区三区| 亚洲精品视频在线观看免费| 欧美日韩国产a| 久久激情综合网| 亚洲欧美韩国综合色| 3d成人h动漫网站入口| 国产一区中文字幕| 国产精品你懂的| 99精品视频中文字幕| 美国欧美日韩国产在线播放| 国产欧美一区二区三区在线看蜜臀 | 久久久久高清精品| 在线免费观看日本一区| 日本免费新一区视频| 国产欧美日韩亚州综合| 在线观看日韩电影| 激情欧美一区二区三区在线观看| 一区二区三区在线观看欧美| 欧美一区二区视频在线观看2020| 国产福利91精品| 亚洲精品国产a| 日韩精品一区二区三区中文精品 | 日韩欧美视频一区| 国产一区不卡视频| 日本网站在线观看一区二区三区| 久久综合狠狠综合久久综合88| 99热在这里有精品免费| 日本成人超碰在线观看| 国产精品欧美精品| 久久综合九色综合97_久久久| 一本到高清视频免费精品| 麻豆国产91在线播放| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 日韩精品一级中文字幕精品视频免费观看| 欧美不卡一二三| 99精品视频在线播放观看| 日韩高清在线观看| 亚洲综合图片区| 国产欧美一区二区精品性色| 制服丝袜av成人在线看| 99riav久久精品riav| 美女脱光内衣内裤视频久久网站 | thepron国产精品| 麻豆免费看一区二区三区| 亚洲欧美日韩精品久久久久| 日韩视频永久免费| 欧美日本在线播放| k8久久久一区二区三区| 国产一区久久久| 日产国产欧美视频一区精品| 一区二区三区四区蜜桃 | 经典三级视频一区| 天堂成人免费av电影一区| 综合激情网...| 中文字幕第一区| 国产精品天干天干在观线| 欧美成人aa大片|