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

📄 bootsec.c

📁 思创S3C44B0黄金开发板一个简化版本的BOOTLOADER
💻 C
字号:
/****************************************************************************/
//
// BootLoader stub 
// Created by Strong Embeded Studio
//         www.8800.org
// If there are any concerns on the code
// go to www.8800.org for discussion
//


/****************************************************************************/
// This routine copies the BootLoader into dram memory for execution
/****************************************************************************/

//***************************************************************************
#include "inc\44b.h"
#include "platform.h"
//***************************************************************************

typedef (*FUNC)(void);
FUNC    fp;

void Main(void)
{
  unsigned int *org;
  unsigned int *dst;
  unsigned int len;
  unsigned int i;

  //
  //8K Cachable
  //
  rSYSCFG   = CACHECFG; 
  
  //
  // I/O range uncachable
  //
  rNCACHBE0 = 0xc0002000; 

  //
  // Write the LED (00)
  //
  *LEDPORT = 0x4848;

  //
  // Move the BootLoader to DRAM
  //
  org = (unsigned int *)0x00001000;
  dst = (unsigned int *)0x0C580000;
  fp  = (FUNC)dst;
  len = (0x20000)>>2;

  for (i=0;i<len;i++) *dst++ = *org++;

  //
  // Write the LED (10)
  //
  *LEDPORT = 0xEB48;

  //
  // Go there for execution
  //
  fp();
 
}

//***************************************************************************

⌨️ 快捷键说明

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