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

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? nand.c

?? 三星2410的BOOTLOADER,WINDOESCE5.0版本
?? C
字號(hào):
//
// 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);
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产精品一区二区久久| 久久精品国产精品亚洲综合| 亚洲午夜三级在线| 天天综合天天综合色| 精品一区二区在线看| 在线视频中文字幕一区二区| 51午夜精品国产| 国产午夜精品一区二区三区视频 | 亚洲影院免费观看| 蜜桃久久久久久久| 色8久久人人97超碰香蕉987| 欧美一级国产精品| 国产精品伦一区二区三级视频| 日日夜夜精品视频免费 | 夜夜嗨av一区二区三区四季av| 麻豆成人综合网| av不卡一区二区三区| 日韩一区二区三| 亚洲一区二区三区三| 国产精品一区二区久激情瑜伽| 91视频com| 国产精品美女久久久久久久久| 肉色丝袜一区二区| 91污在线观看| 国产精品人妖ts系列视频 | 中文字幕精品一区二区三区精品| 日韩成人av影视| 色综合久久久网| 久久久噜噜噜久噜久久综合| 日韩中文字幕1| 色婷婷国产精品| 久久久美女毛片| 国产一区二区免费在线| 在线成人高清不卡| 亚洲欧洲三级电影| 91免费版在线看| 国产精品欧美一区喷水| 韩国av一区二区| 久久综合久久鬼色中文字| 日日摸夜夜添夜夜添亚洲女人| 久久99国产精品久久99| 欧美在线观看你懂的| 国产精品国产三级国产aⅴ原创 | 亚洲视频 欧洲视频| 国产精品中文字幕欧美| 精品国产伦一区二区三区观看体验 | 国产午夜精品久久久久久免费视 | 91精品在线观看入口| 亚洲国产一区视频| 欧美综合一区二区| 亚洲国产精品自拍| 欧美午夜理伦三级在线观看| 最新国产精品久久精品| 麻豆freexxxx性91精品| 欧美夫妻性生活| 亚洲成人你懂的| 欧美美女一区二区| 日韩精品一二三区| 精品国产一区二区三区四区四| 久久99精品久久久久久久久久久久| 欧美精品成人一区二区三区四区| 秋霞电影网一区二区| 日韩欧美亚洲国产另类| 韩国午夜理伦三级不卡影院| 国产精品久久久久久久久果冻传媒| 不卡的电影网站| 亚洲免费观看高清在线观看| 欧美乱妇20p| 久久激情五月激情| 久久精品亚洲乱码伦伦中文| 色综合色综合色综合| 亚洲国产精品尤物yw在线观看| 欧美一区二区日韩| 成人午夜视频免费看| 亚洲免费观看高清完整版在线观看 | 亚洲人成影院在线观看| 欧美精品久久99久久在免费线| 日本在线观看不卡视频| 精品国产青草久久久久福利| 一本久久a久久免费精品不卡| 午夜欧美大尺度福利影院在线看 | 91福利资源站| 日韩电影免费在线观看网站| 精品国产乱码久久久久久牛牛 | 国产精品久久久久久久久快鸭| 欧美三级电影一区| 韩国三级电影一区二区| 欧美一区二区观看视频| eeuss鲁片一区二区三区在线观看| 一区二区三区四区不卡视频| 欧美日韩激情一区二区三区| 成人高清视频在线观看| 婷婷丁香激情综合| 精品国产91亚洲一区二区三区婷婷| 日本精品裸体写真集在线观看 | 精品国产乱码久久久久久闺蜜 | 麻豆精品精品国产自在97香蕉| 中文字幕国产一区| 欧美精品v日韩精品v韩国精品v| 国产精品小仙女| 亚洲五码中文字幕| 亚洲欧洲精品一区二区三区| 欧美一区二区三区的| 色婷婷久久99综合精品jk白丝| 国产精品88888| 日本午夜精品一区二区三区电影| 91精品综合久久久久久| 欧美在线一区二区| 国产成人亚洲综合a∨婷婷| 精品乱码亚洲一区二区不卡| 91精品欧美福利在线观看| 成人久久18免费网站麻豆 | 成人性生交大片免费看在线播放| 日韩电影在线免费| 亚洲444eee在线观看| 自拍偷在线精品自拍偷无码专区| 26uuu国产日韩综合| 欧美最猛性xxxxx直播| 91在线免费看| 波多野结衣精品在线| 日一区二区三区| 亚洲国产视频一区| 尤物在线观看一区| 国产精品福利一区二区三区| 久久久久久久久久久电影| 91精品视频网| 久久久欧美精品sm网站| 精品动漫一区二区三区在线观看| 91精品一区二区三区在线观看| 91伊人久久大香线蕉| 96av麻豆蜜桃一区二区| 成人福利视频网站| av亚洲产国偷v产偷v自拍| 国产成人精品免费在线| 久久er精品视频| 成人国产免费视频| 91视视频在线直接观看在线看网页在线看| 国产在线精品一区二区| 国产一区二区三区蝌蚪| 国产精品系列在线播放| 国产一区二区三区视频在线播放| 性欧美疯狂xxxxbbbb| 亚洲3atv精品一区二区三区| 午夜精品久久久久影视| 免费精品视频在线| 精品一区二区三区影院在线午夜| 国产在线视频不卡二| av激情亚洲男人天堂| 日本精品裸体写真集在线观看| 欧美在线free| 欧美精品一区二区三区四区| 国产精品久久久久影院| 亚洲色图视频网站| 亚洲国产精品麻豆| 久久99精品久久久| 成人黄色软件下载| 欧美一区二区视频在线观看| 3d动漫精品啪啪一区二区竹菊| 日韩视频在线一区二区| 日韩欧美黄色影院| 亚洲国产成人在线| 一区二区三区四区在线免费观看| 亚洲线精品一区二区三区八戒| 日本不卡视频一二三区| 国产主播一区二区| 一本久道久久综合中文字幕| 欧美乱妇15p| 亚洲欧美另类久久久精品| 午夜一区二区三区视频| 日韩精品成人一区二区在线| 成人性色生活片免费看爆迷你毛片| 色综合久久66| 日韩一级在线观看| 国产精品嫩草久久久久| 日精品一区二区三区| 裸体歌舞表演一区二区| 成人av网站在线观看免费| 欧美日韩亚洲综合一区二区三区| 在线成人av影院| 国产精品网站一区| 日本成人在线网站| 91在线一区二区三区| 日韩欧美国产一区在线观看| 亚洲国产电影在线观看| 日本成人在线一区| 欧美视频在线一区二区三区 | 在线观看网站黄不卡| 亚洲精品一区二区三区99| 天天操天天色综合| 色菇凉天天综合网| ...中文天堂在线一区| 黄色日韩网站视频| 欧美日韩成人高清| 一区二区三区 在线观看视频| 国产一区二区三区不卡在线观看| 日韩三级视频在线观看| 亚洲一区二区高清| 欧美三级中文字幕| 亚洲综合另类小说| 色综合中文字幕|