“EC2108内核分析”的版本间的差异

来自IPTV爱好者
跳转至: 导航搜索
内核编译
内核编译
第5行: 第5行:
 
== 内核编译 ==
 
== 内核编译 ==
  
cp arch/mips/configs/bcm97405d0-smp-nand_initrd_defconfig .config
+
内核配置:
  
make menuconfig
+
cp arch/mips/configs/bcm97405d0-smp_initrd_defconfig .config
 +
make menuconfig
 +
 
 +
Device Drivers - Network device support - Ethernet (10 or 100Mbit) 中取消“Use external MII interface”
 +
 
 +
[ ]    Use external MII interface
  
 
修改include/asm-mips/setup.h中的COMMAND_LINE_SIZE
 
修改include/asm-mips/setup.h中的COMMAND_LINE_SIZE
第16行: 第21行:
  
 
  #define COMMAND_LINE_SIZE      1024
 
  #define COMMAND_LINE_SIZE      1024
 +
 +
将文件initrd.gz解压到usr目录中:
 +
 +
cp initrd.gz usr/initramfs_data.cpio.gz
 +
gunzip usr/initramfs_data.cpio.gz
 +
cp initrd.gz usr/initramfs_data.cpio.gz
 +
 +
vi usr/initramfs_list
 +
 +
dir /dev 755 1001 1001
 +
nod /dev/romblock7 600 0 0 b 253 7
 +
nod /dev/romblock0 600 0 0 b 253 0
 +
nod /dev/romblock14 600 0 0 b 253 14
 +
nod /dev/romblock12 600 0 0 b 253 12
 +
nod /dev/mtdblock3 600 0 0 b 31 3
 +
nod /dev/mtdblock15 600 0 0 b 31 15
 +
nod /dev/mtdblock1 600 0 0 b 31 1
 +
nod /dev/romblock3 600 0 0 b 253 3
 +
nod /dev/mtdblock10 600 0 0 b 31 10
 +
nod /dev/mtdblock4 600 0 0 b 31 4
 +
nod /dev/romblock4 600 0 0 b 253 4
 +
nod /dev/mtdblock13 600 0 0 b 31 13
 +
nod /dev/mtdblock14 600 0 0 b 31 14
 +
nod /dev/mtdblock8 600 0 0 b 31 8
 +
nod /dev/romblock8 600 0 0 b 253 8
 +
nod /dev/romblock11 600 0 0 b 253 11
 +
nod /dev/romblock13 600 0 0 b 253 13
 +
nod /dev/romblock1 600 0 0 b 253 1
 +
nod /dev/console 600 0 0 c 5 1
 +
nod /dev/mtdblock11 600 0 0 b 31 11
 +
nod /dev/romblock9 600 0 0 b 253 9
 +
nod /dev/mtdblock9 600 0 0 b 31 9
 +
nod /dev/mtdblock0 600 0 0 b 31 0
 +
nod /dev/mtdblock2 600 0 0 b 31 2
 +
nod /dev/mem 600 0 0 c 1 1
 +
nod /dev/ttyS0 600 0 0 c 5 1
 +
nod /dev/mtdblock12 600 0 0 b 31 12
 +
nod /dev/romblock6 600 0 0 b 253 6
 +
nod /dev/mtdblock6 600 0 0 b 31 6
 +
nod /dev/romblock2 600 0 0 b 253 2
 +
nod /dev/romblock10 600 0 0 b 253 10
 +
nod /dev/mtdblock5 600 0 0 b 31 5
 +
nod /dev/romblock5 600 0 0 b 253 5
 +
nod /dev/mtdblock7 600 0 0 b 31 7
 +
nod /dev/romblock15 600 0 0 b 253 15
 +
nod /dev/sda1 600 0 0 b 8 1
 +
dir /mnt 755 1001 1001
 +
file /brcmnand-7405d0_mtdv9.ko /romfs/brcmnand-7405d0_mtdv9.ko 644 1001 1001
 +
file /brcmnand-7405d0_mtdv5.ko /romfs/brcmnand-7405d0_mtdv5.ko 644 1001 1001
 +
file /init /romfs/init 755 1001 1001
 +
file /yaffs.ko /romfs/yaffs.ko 644 1001 1001
 +
dir /proc 755 1001 1001
 +
file /busybox /romfs/busybox 755 1001 1001
 +
file /brcmnand-7405b0.ko /romfs/brcmnand-7405b0.ko 644 1001 1001
 +
  
 
make
 
make

2011年10月11日 (二) 12:08的版本

概述

EC2108内核文件可从机顶盒的/dev/mtdblock1获取到,也可以在这里下载:ec2108_mtdblock1.bin。存放内核的MTD分区的大小为6MB,内核以ELF格式的vmlinux加上initrd.gz两部分构成。以7.5版的EC2108内核为例,从0x3F0D10开始为initrd.gz,分离好的initrd.gz在这里下载:ec2108_initrd.gz

内核编译

内核配置:

cp arch/mips/configs/bcm97405d0-smp_initrd_defconfig .config
make menuconfig

Device Drivers - Network device support - Ethernet (10 or 100Mbit) 中取消“Use external MII interface”

[ ]     Use external MII interface

修改include/asm-mips/setup.h中的COMMAND_LINE_SIZE

#define COMMAND_LINE_SIZE      256

改为:

#define COMMAND_LINE_SIZE      1024

将文件initrd.gz解压到usr目录中:

cp initrd.gz usr/initramfs_data.cpio.gz
gunzip usr/initramfs_data.cpio.gz
cp initrd.gz usr/initramfs_data.cpio.gz

vi usr/initramfs_list

dir /dev 755 1001 1001
nod /dev/romblock7 600 0 0 b 253 7
nod /dev/romblock0 600 0 0 b 253 0
nod /dev/romblock14 600 0 0 b 253 14
nod /dev/romblock12 600 0 0 b 253 12
nod /dev/mtdblock3 600 0 0 b 31 3
nod /dev/mtdblock15 600 0 0 b 31 15
nod /dev/mtdblock1 600 0 0 b 31 1
nod /dev/romblock3 600 0 0 b 253 3
nod /dev/mtdblock10 600 0 0 b 31 10
nod /dev/mtdblock4 600 0 0 b 31 4
nod /dev/romblock4 600 0 0 b 253 4
nod /dev/mtdblock13 600 0 0 b 31 13
nod /dev/mtdblock14 600 0 0 b 31 14
nod /dev/mtdblock8 600 0 0 b 31 8
nod /dev/romblock8 600 0 0 b 253 8
nod /dev/romblock11 600 0 0 b 253 11
nod /dev/romblock13 600 0 0 b 253 13
nod /dev/romblock1 600 0 0 b 253 1
nod /dev/console 600 0 0 c 5 1
nod /dev/mtdblock11 600 0 0 b 31 11
nod /dev/romblock9 600 0 0 b 253 9
nod /dev/mtdblock9 600 0 0 b 31 9
nod /dev/mtdblock0 600 0 0 b 31 0
nod /dev/mtdblock2 600 0 0 b 31 2
nod /dev/mem 600 0 0 c 1 1
nod /dev/ttyS0 600 0 0 c 5 1
nod /dev/mtdblock12 600 0 0 b 31 12
nod /dev/romblock6 600 0 0 b 253 6
nod /dev/mtdblock6 600 0 0 b 31 6
nod /dev/romblock2 600 0 0 b 253 2
nod /dev/romblock10 600 0 0 b 253 10
nod /dev/mtdblock5 600 0 0 b 31 5
nod /dev/romblock5 600 0 0 b 253 5
nod /dev/mtdblock7 600 0 0 b 31 7
nod /dev/romblock15 600 0 0 b 253 15
nod /dev/sda1 600 0 0 b 8 1
dir /mnt 755 1001 1001
file /brcmnand-7405d0_mtdv9.ko /romfs/brcmnand-7405d0_mtdv9.ko 644 1001 1001
file /brcmnand-7405d0_mtdv5.ko /romfs/brcmnand-7405d0_mtdv5.ko 644 1001 1001
file /init /romfs/init 755 1001 1001
file /yaffs.ko /romfs/yaffs.ko 644 1001 1001
dir /proc 755 1001 1001
file /busybox /romfs/busybox 755 1001 1001
file /brcmnand-7405b0.ko /romfs/brcmnand-7405b0.ko 644 1001 1001


make

cp vmlinuz /tftpboot

ifconfig eth0 -auto
boot -elf -addr=0x80001000 192.168.3.10:/vmlinux