Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1211932
  • 博文数量: 261
  • 博客积分: 4196
  • 博客等级: 上校
  • 技术积分: 3410
  • 用 户 组: 普通用户
  • 注册时间: 2012-02-17 17:05
文章分类

全部博文(261)

文章存档

2018年(1)

2017年(22)

2016年(2)

2015年(8)

2014年(27)

2013年(40)

2012年(161)

分类: LINUX

2014-12-15 16:11:07

1、uboot 里环境变量的设置
这个设置 一般都是在和平台有关的文件 ,我使用的是mini2440 开发板 。就在
uboot 根目录下的 include/configs/mini2440.h 里


#define CONFIG_BOOTDELAY    2
#define CONFIG_BOOTARGS     "noinitrd root=/dev/mtdblock3 console=ttySAC0 init=/linuxrc"
#define CONFIG_ETHADDR          08:08:11:18:12:27
#define CONFIG_NETMASK          255.255.255.0
#define CONFIG_IPADDR       192.168.0.230
#define CONFIG_SERVERIP     192.168.0.1
#define CONFIG_GATEWAYIP    192.168.0.1
#define CONFIG_OVERWRITE_ETHADDR_ONCE


/*#define CONFIG_BOOTFILE   "elinos-lart" */
#define CONFIG_BOOTCOMMAND  "nand read.i 0x30008000 60000 500000;bootm 0x30008040"
#define CONFIG_EXTRA_ENV_SETTINGS                   \
    "stdin=serial\0"                    \
    "stdout=serial\0"                   \
    "stderr=serial\0"                   \
    ""


可以在uboot 源码里 搜这些定义,找到你使用的平台里的定义就是了


2、在内核的 arch/arm/mach-xxx 目录下有对应平台的 关于存储分配的地方 mini2440开发板上的文件是 mach-mini2440.c

static struct mtd_partition friendly_arm_default_nand_part[] = {
    [0] = {
        .name   = "supervivi",
        .size   = 0x00040000,
        .offset = 0,
    },
    [1] = {
        .name   = "param",
        .offset = 0x00040000,
        .size   = 0x00020000,
    },
    [2] = {
        .name   = "Kernel",
        .offset = 0x00060000,
        .size   = 0x00500000,
    },
    [3] = {
        .name   = "root",
        .offset = 0x00560000,
        .size   = 1024 * 1024 * 1024, //
    },
    [4] = {
        .name   = "nand",
        .offset = 0x00000000,
        .size   = 1024 * 1024 * 1024, //
    }
};

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