这段时间一直在研究ecos,所以有了把ecos移植到mini2440的qemu平台的想法。经过几天的折腾,终于可以在qemu的上面看到redboot的命令了。
先看看成果,然后进入枯燥的coding历程
现在开始看代码,:-)
1. 获得代码
git clone git://repo.or.cz/qemu/mini2440.git qemu
修改启动部分为ram的最小地址直接启动
ricky@ricky-laptop:~/ecos/projects/mini2440-qemu/mini2440$ git diff
diff --git a/hw/mini2440.c b/hw/mini2440.c
index 5decf4b..7a70aae 100644
--- a/hw/mini2440.c
+++ b/hw/mini2440.c
@@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)
struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;
uint32_t image_size;
- /*
- * Normally we would load 4 KB of nand to SRAM and jump there, but
- * it is not working perfectly as expected, so we cheat and load
- * it from nand directly relocated to 0x33f80000 and jump there
- */
- if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*1
- mini2440_printf("loaded default u-boot from NAND/n");
- s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start addr
- }
-#if 0 && defined(LATER)
- if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM
- s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT; /* start address
- mini2440_printf("4KB SteppingStone loaded from NAND/n");
- }
-#endif
:
diff --git a/hw/mini2440.c b/hw/mini2440.c
index 5decf4b..7a70aae 100644
--- a/hw/mini2440.c
+++ b/hw/mini2440.c
@@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)
struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;
uint32_t image_size;
- /*
- * Normally we would load 4 KB of nand to SRAM and jump there, but
- * it is not working perfectly as expected, so we cheat and load
- * it from nand directly relocated to 0x33f80000 and jump there
- */
- if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*10
- mini2440_printf("loaded default u-boot from NAND/n");
- s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start addre
- }
-#if 0 && defined(LATER)
- if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_
- s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT; /* start address,
- mini2440_printf("4KB SteppingStone loaded from NAND/n");
- }
-#endif
- /*
:
diff --git a/hw/mini2440.c b/hw/mini2440.c
index 5decf4b..7a70aae 100644
--- a/hw/mini2440.c
+++ b/hw/mini2440.c
@@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)
struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;
uint32_t image_size;
- /*
- * Normally we would load 4 KB of nand to SRAM and jump there, but
- * it is not working perfectly as expected, so we cheat and load
- * it from nand directly relocated to 0x33f80000 and jump there
- */
- if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*102
- mini2440_printf("loaded default u-boot from NAND/n");
- s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start addres
- }
-#if 0 && defined(LATER)
- if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_S
- s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT; /* start address,
- mini2440_printf("4KB SteppingStone loaded from NAND/n");
- }
-#endif
- /*
- * if a u--boot is available as a file, we always use it
:
diff --git a/hw/mini2440.c b/hw/mini2440.c
index 5decf4b..7a70aae 100644
--- a/hw/mini2440.c
+++ b/hw/mini2440.c
@@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)
struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;
uint32_t image_size;
- /*
- * Normally we would load 4 KB of nand to SRAM and jump there, but
- * it is not working perfectly as expected, so we cheat and load
- * it from nand directly relocated to 0x33f80000 and jump there
- */
- if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*1024)>
- mini2440_printf("loaded default u-boot from NAND/n");
- s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start address,
- }
-#if 0 && defined(LATER)
- if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_SIZE
- s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT; /* start address, u-b
-
- mini2440_printf("4KB SteppingStone loaded from NAND/n");