Chinaunix首页 | 论坛 | 博客
  • 博客访问: 107187
  • 博文数量: 26
  • 博客积分: 1060
  • 博客等级: 少尉
  • 技术积分: 300
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-04 10:32
文章分类

全部博文(26)

文章存档

2013年(1)

2011年(21)

2010年(4)

分类: WINDOWS

2011-03-26 16:23:18

//<++ZhangTianlu ztlchina@foxmail.com 2011-3-25 22:55:14

BOOL Desplay_Logo(DWORD pFramebufferDWORD dwImageLength)

{

    unsigned int * pFB32 = (unsigned int *)pFramebuffer;

    unsigned int * dst = pFB32;

    unsigned int * p = NULL;

    int i = 0;

    SectorInfo si;

 

    DWORD dwBlock,dwNumBlocks;

    dwBlock = LOGO_BLOCK;

 

    OALMSG(TRUE, (TEXT("dwImageLength = 0x%x \r\n"), dwImageLength));

    dwNumBlocks = (dwImageLength / (g_FlashInfo.wDataBytesPerSector*g_FlashInfo.wSectorsPerBlock)) + (dwImageLength%(g_FlashInfo.wDataBytesPerSector*g_FlashInfo.wSectorsPerBlock) ? 1: 0);

    OALMSG(TRUE, (TEXT("dwNumBlocks = 0x%x \r\n"), dwNumBlocks));

    while (dwNumBlocks--)

    {

        OALMSG(TRUE, (TEXT("dwBlock(0x%x) X "), dwBlock));

        OALMSG(TRUE, (TEXT("g_FlashInfo.wSectorsPerBlock(0x%x)"),g_FlashInfo.wSectorsPerBlock));

        OALMSG(TRUE, (TEXT(" = 0x%x \r\n"),dwBlock*g_FlashInfo.wSectorsPerBlock));

        /*

        FMD_ReadSector(dwBlock*g_FlashInfo.wSectorsPerBlock, NULL, &si, 1);

 

        // Stepldr & Eboot image in nand flash

        // block mark as BLOCK_STATUS_RESERVED & BLOCK_STATUS_READONLY & BLOCK_STATUS_BAD

        if ((si.bBadBlock == 0x0) && (si.bOEMReserved !=3 ))

        {

            ++dwBlock;

            ++dwNumBlocks; // Compensate for fact that we didn't write any blocks.

            continue;

        }*/

        //BOOL ReadBlock(DWORD dwBlock, LPBYTE pbBlock, PSectorInfo pSectorInfoTable)

        if (!ReadBlock(dwBlock, (LPBYTE)dstg_pSectorInfoBuf))

        {

            OALMSG(OAL_ERROR, (TEXT("WriteData: failed to read block (0x%x).\r\n"), dwBlock));

            return(FALSE);

        }

        //memcpy(dst, (unsigned int*)p, g_FlashInfo.dwBytesPerBlock);

 

        //for debug

        for(i = 0; i < 10; i++)

        {

            OALMSG(TRUE, (TEXT("%x "), *((unsigned char*)g_FlashInfo.dwBytesPerBlock + i)));

        }

        OALMSG(TRUE, (TEXT("\r\n")));

 

        dst += g_FlashInfo.dwBytesPerBlock/4;

        ++dwBlock;

 

    }

    return TRUE;

}

//++>

 

 

最后在 loader.h中添加 上述两个函数的声明:

//<++ZTL FOR DESPLAY LOGO

BOOL Desplay_Logo(DWORD pFramebufferDWORD dwImageLength);

BOOL WriteLogoToBootMedia(DWORD dwImageStartDWORDdwImageLengthDWORD dwLaunchAddr);

//++>ZTL

 

阅读(971) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~