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

📄 param.c

📁 uxlinux的bootlaoder学习 整理的一下
💻 C
字号:
#include <stdio.h>
#include <stdlib.h>
#include "board.h"#include "bios.h"
#define COMPEX_VENDOR_ID   0x11F6#define IRE201_DEVICE_ID   0x8000#define NP15B_DEVICE_ID    0x8001#define BTE201_DEVICE_ID   0x8002#define NONE_DEVICE_ID     0x0000
struct system_table_struct system_table = {	bios_size:      0xc000,#ifdef IRE201	vendor_id:      COMPEX_VENDOR_ID,	device_id:      IRE201_DEVICE_ID,	sub_vendor_id:  COMPEX_VENDOR_ID,	sub_device_id:  IRE201_DEVICE_ID,#endif#ifdef NP15B	vendor_id:      COMPEX_VENDOR_ID,	device_id:      NP15B_DEVICE_ID,	sub_vendor_id:  COMPEX_VENDOR_ID,	sub_device_id:  NP15B_DEVICE_ID,#endif#ifdef BTE201	vendor_id:      COMPEX_VENDOR_ID,	device_id:      BTE201_DEVICE_ID,	sub_vendor_id:  COMPEX_VENDOR_ID,	sub_device_id:  BTE201_DEVICE_ID,#endif#ifdef SNDS100	vendor_id:      COMPEX_VENDOR_ID,	device_id:      NONE_DEVICE_ID,	sub_vendor_id:  COMPEX_VENDOR_ID,	sub_device_id:  NONE_DEVICE_ID,#endif	rev:            0,	sys_reg_base:   0x03ff0000,	sys_clock:      fMCLK_MHz,	ext_clock:      0xffffffff,#ifdef IRE201	rom_table:      {{0x00200000,  16, 0x00000060},		//rom0 is flash with 2M=1M*16bit	                 {0x00000000,  8, 0x00000060},	                 {0x00000000,  8, 0x00000060},	                 {0x00000000,  8, 0x00000060},	                 {0x00000000,  8, 0x00000060},	                 {0x00000000,  8, 0x00000060}},	dram_table:     {{0x01000000, 32, 0x00000380},		//sdram is 16M=4M*32bit	                 {0x00000000, 32, 0x00000398},	                 {0x00000000, 32, 0x00000398},	                 {0x00000000, 32, 0x00000398}},#endif#ifdef NP15B	rom_table:      {{0x00080000,  8, 0x00000060},	                 {0x00080000,  8, 0x00000060},	                 {0x00000000,  8, 0x00000060},	                 {0x00000000,  8, 0x00000060},	                 {0x00000000,  8, 0x00000060},	                 {0x00000000,  8, 0x00000060}},	dram_table:     {{0x00400000, 32, 0x00000398},	                 {0x00000000, 32, 0x00000398},	                 {0x00000000, 32, 0x00000398},	                 {0x00000000, 32, 0x00000398}},#endif#ifdef BTE201	rom_table:      {{0x00100000,  8, 0x00000060},	                 {0x00000000,  8, 0x00000060},	                 {0x00000000,  8, 0x00000060},	                 {0x00000000,  8, 0x00000060},	                 {0x00000000,  8, 0x00000060},	                 {0x00000000,  8, 0x00000060}},	dram_table:     {{0x00800000, 32, 0x00000398},	                 {0x00000000, 32, 0x00000398},	                 {0x00000000, 32, 0x00000398},	                 {0x00000000, 32, 0x00000398}},#endif#ifdef SNDS100	rom_table:      {{0x00080000,  8, 0x00000060},	                 {0x00000000,  8, 0x00000060},	                 {0x00000000,  8, 0x00000060},	                 {0x00000000,  8, 0x00000060},	                 {0x00000000,  8, 0x00000060},	                 {0x00000000,  8, 0x00000060}},	dram_table:     {{0x00400000, 32, 0x00000398},	                 {0x00000000, 32, 0x00000398},	                 {0x00000000, 32, 0x00000398},	                 {0x00000000, 32, 0x00000398}},#endif	system_table_size:     sizeof(struct system_table_struct),	partition_table_offset:      0x0000f000,	partition_table_size:        sizeof(struct partition_table_struct),	ext_base:       0x03fd0000,	ext_table:      {{            32, 0x00000fff},	                 {            32, 0x00000fff},	                 {            32, 0x00000fff},	                 {            32, 0x00000fff}},	iop:            {0x00020070, 0x2ad00300, ~0x00020070},	uart:           {{0x80000000, 0, 0, 0, 0, 0, 0}, {0x80000000, 1, 0, 0, 0, 0, 0}},	eth:            {0x80000000, {0x00, 0x80, 0x48, 0x88, 0x00, 0x00}},	ne2000:         {0x80000000, 0, {0x00, 0x80, 0x48, 0x88, 0x00, 0x01}},	uart16550:      {0x80000000, 1, 13000000},	pc97338:        {0x80000000, 1},	startup_mode:   BOOT_MENU,	tftp_ipaddr:    0xd34156bb,	//211.65.86.187};#ifdef IRE201struct partition_table_struct partition_table = {	{0x8000, 1, 0x10000, 0x20000, ADDR,	 0x4000, 1, 0x30000, 0x40000, 0}};#endif#ifdef NP15Bstruct partition_table_struct partition_table = {	{0x8000, 1, 0x10000, 0x70000, ADDR,	 0x4000, 1, 0x80000, 0x78000, 0,	 0x0000, 1, 0xf8000, 0x08000, 0}};#endif#ifdef BTE201struct partition_table_struct partition_table = {	{0x8000, 1, 0x10000, 0x20000, ADDR,	 0x4000, 1, 0x30000, 0xc0000, 0,	 0x0000, 1, 0xf0000, 0x10000, 0}};#endif#ifdef SNDS100struct partition_table_struct partition_table = {	{0x8000, 1, 0x10000, 0x20000, ADDR,	 0x4000, 1, 0x30000, 0x40000, 0}};#endifint main()
{
	FILE *f;

	f = fopen("param.tbl", "wb");
	fwrite((char *)(&system_table), 1, sizeof(struct system_table_struct), f);
	fclose(f);
	f = fopen("mbr.bin", "wb");
	fwrite((char *)(&partition_table), 1, sizeof(struct partition_table_struct), f);
	fclose(f);
	return 0;
}

⌨️ 快捷键说明

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