MX51开发板利用LINUX主机和BSP包重新制作SD卡启动

本文档详细介绍了如何在Linux环境下,利用FAT32格式化的SD卡,结合u-boot和内核镜像,通过一系列步骤将MX51开发板设置为SD卡启动。内容包括格式化SD卡、复制引导加载器和内核镜像、创建根文件系统,并处理启动时可能出现的问题。
摘要由CSDN通过智能技术生成
 

1、  在WINDOWS下FAT32格式化整个SD卡;

2、  切换到虚拟机下,在UBUNTU9。04的环境下,系统能识别出SD卡,其中/dev/sdc即为SD卡存储设备;glose@glose-desktop:/media$ cat /proc/partitions

major minor  #blocks  name

 

   8        0   20971520 sda

   8        1   20049088 sda1

   8        2          1 sda2

   8        5     915673 sda5

           8       32    1997312 sdb

使用df  -h,可以看出其挂载点为/media/disk;

/dev/sdb              2.0G  4.0K  2.0G   1% /media/disk

3、copy bootloader镜像

glose@glose-desktop:/tftpboot$ ls

u-boot-bbg.bin  u-boot-bbg-no-padding.bin  uImage

glose@glose-desktop:/tftpboot$ sudo dd if=./u-boot-bbg.bin of=/dev/sdb bs=512 && sync && sync

记录了 274+1 的读入

记录了 274+1 的写出

140660字节(141 kB)已复制,0.000910636 秒,154 MB/秒

4、copy内核镜像

glose@glose-desktop:/tftpboot$ sudo dd if=./uImage of=/dev/sdb bs=512 seek=2048 && sync && sync

记录了 4429+1 的读入

记录了 4429+1 的写出

2267676字节(2.3 MB)已复制,0.0549108 秒,41.3 MB/秒

5、copy根文件系统

glose@glose-desktop:/tftpboot$ sudo fdisk /dev/sdb

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel with disk identifier 0x390ef65e.

Changes will remain in memory only, until you decide to write them.

After that, of course, the previous content won't be recoverable.

 

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

 

Command (m for help): u

Changing display/entry units to sectors

 

Command (m for help): p

 

Disk /dev/sdb: 2045 MB, 2045247488 bytes

63 heads, 62 sectors/track, 1022 cylinders, total 3994624 sectors

Units = sectors of 1 * 512 = 512 bytes

Disk identifier: 0x390ef65e

 

   Device Boot      Start         End      Blocks   Id  System

 

Command (m for help): d

No partition is defined yet!

 

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 1

First sector (62-3994623, default 62): 8192

Last sector, +sectors or +size{K,M,G} (8192-3994623, default 3994623):

Using default value 3994623

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

 

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

glose@glose-desktop:/tftpboot$

注意重新启动系统。sudo reboot

glose@glose-desktop:~$ sudo mkfs.ext3 /dev/sdb1

[sudo] password for glose:

mke2fs 1.41.4 (27-Jan-2009)

/dev/sdb1 is mounted; will not make a filesystem here!

得先把其umonut

glose@glose-desktop:~$ sudo umount /media/disk/

glose@glose-desktop:~$ sudo mkfs.ext3 /dev/sdb1

mke2fs 1.41.4 (27-Jan-2009)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

124672 inodes, 498304 blocks

24915 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=511705088

16 block groups

32768 blocks per group, 32768 fragments per group

7792 inodes per group

Superblock backups stored on blocks:

         32768, 98304, 163840, 229376, 294912

 

Writing inode tables:

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值