Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
22bab87d
U
U-Boot.Mirror
项目概览
OS
/
U-Boot.Mirror
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
U-Boot.Mirror
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
22bab87d
编写于
12月 30, 2008
作者:
W
Wolfgang Denk
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
git://git.denx.de/u-boot-mips
上级
440db474
b616f2b5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
87 addition
and
3 deletion
+87
-3
doc/README.qemu_mips
doc/README.qemu_mips
+86
-2
include/configs/qemu-mips.h
include/configs/qemu-mips.h
+1
-1
未找到文件。
doc/README.qemu_mips
浏览文件 @
22bab87d
...
...
@@ -17,19 +17,103 @@ create image:
start it:
# qemu-system-mips -M mips -pflash flash -monitor null -nographic
2) Download kernel + initrd
On ftp://ftp.denx.de/pub/contrib/Jean-Christophe_Plagniol-Villard/qemu_mips/
you can downland
#config to build the kernel
qemu_mips_defconfig
#patch to fix mips interupt init on 2.6.24.y kernel
qemu_mips_kernel.patch
initrd.gz
vmlinux
vmlinux.bin
System.map
4) Generate uImage
# tools/mkimage -A mips -O linux -T kernel -C gzip -a 0x80010000 -e 0x80245650 -n "Linux 2.6.24.y" -d vmlinux.bin.gz uImage
5) Copy uImage to Flash
# dd if=uImage bs=1k conv=notrunc seek=224 of=flash
6) Generate Ide Disk
# dd of=ide bs=1k cout=100k if=/dev/zero
# sfdisk -C 261 -d ide
# partition table of ide
unit: sectors
ide1 : start= 63, size= 32067, Id=83
ide2 : start= 32130, size= 32130, Id=83
ide3 : start= 64260, size= 4128705, Id=83
ide4 : start= 0, size= 0, Id= 0
7) Copy to ide
# dd if=uImage bs=512 conv=notrunc seek=63 of=ide
8) Generate ext2 on part 2 on Copy uImage and initrd.gz
# Attached as loop device ide offset = 32130 * 512
# losetup -o 16450560 -f ide
# Format as ext2 ( arg2 : nb blocks)
# mke2fs /dev/loop0 16065
# losetup -d /dev/loop0
# Mount and copy uImage and initrd.gz to it
# mount -o loop,offset=16450560 -t ext2 ide /mnt
# mkdir /mnt/boot
# cp {initrd.gz,uImage} /mnt/boot/
# Umount it
# umount /mnt
9) Set Environment
setenv rd_start 0x80800000
setenv rd_size 2663940
setenv kernel BFC38000
setenv oad_addr 80500000
setenv load_addr2 80F00000
setenv kernel_flash BFC38000
setenv load_addr_hello 80200000
setenv bootargs 'root=/dev/ram0 init=/bin/sh'
setenv load_rd_ext2 'ide res; ext2load ide 0:2 ${rd_start} /boot/initrd.gz'
setenv load_rd_tftp 'tftp ${rd_start} /initrd.gz'
setenv load_kernel_hda 'ide res; diskboot ${load_addr} 0:2'
setenv load_kernel_ext2 'ide res; ext2load ide 0:2 ${load_addr} /boot/uImage'
setenv load_kernel_tftp 'tftp ${load_addr} /qemu_mips/uImage'
setenv boot_ext2_ext2 'run load_rd_ext2; run load_kernel_ext2; run addmisc; bootm ${load_addr}'
setenv boot_ext2_flash 'run load_rd_ext2; run addmisc; bootm ${kernel_flash}'
setenv boot_ext2_hda 'run load_rd_ext2; run load_kernel_hda; run addmisc; bootm ${load_addr}'
setenv boot_ext2_tftp 'run load_rd_ext2; run load_kernel_tftp; run addmisc; bootm ${load_addr}'
setenv boot_tftp_hda 'run load_rd_tftp; run load_kernel_hda; run addmisc; bootm ${load_addr}'
setenv boot_tftp_ext2 'run load_rd_tftp; run load_kernel_ext2; run addmisc; bootm ${load_addr}'
setenv boot_tftp_flash 'run load_rd_tftp; run addmisc; bootm ${kernel_flash}'
setenv boot_tftp_tftp 'run load_rd_tftp; run load_kernel_tftp; run addmisc; bootm ${load_addr}'
setenv load_hello_tftp 'tftp ${load_addr_hello} /examples/hello_world.bin'
setenv go_tftp 'run load_hello_tftp; go ${load_addr_hello}'
setenv addmisc 'setenv bootargs ${bootargs} console=ttyS0,${baudrate} rd_start=${rd_start} rd_size=${rd_size} ethaddr=${ethaddr}'
setenv bootcmd 'run boot_tftp_flash'
10) Now you can boot from flash, ide, ide+ext2 and tfp
# qemu-system-mips -M mips -pflash flash -monitor null -nographic -net nic -net user -tftp `pwd` -hda ide
II) How to debug U-Boot
In order to debug U-Boot you need to start qemu with gdb server support (-s)
and waiting the connection to start the CPU (-S)
# qemu-system-mips -S -s -M mips -pflash flash -monitor null -nographic
# qemu-system-mips -S -s -M mips -pflash flash -monitor null -nographic
-net nic -net user -tftp `pwd` -hda ide
in an other console you start gdb
1) Debugging of U-Boot Before Relocation
Before relocation, the addresses in the ELF file can be used without any problems
b
u
y connecting to the gdb server localhost:1234
by connecting to the gdb server localhost:1234
# mipsel-unknown-linux-gnu-gdb u-boot
GNU gdb 6.6
...
...
include/configs/qemu-mips.h
浏览文件 @
22bab87d
...
...
@@ -150,7 +150,7 @@
#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1
#define CONFIG_ENV_IS_IN_FLASH 1
#define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE +
0x40000
)
#define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE +
CONFIG_SYS_MONITOR_LEN
)
/* Address and size of Primary Environment Sector */
#define CONFIG_ENV_SIZE 0x8000
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录