25 |
#include "m48t08.h" |
#include "m48t08.h" |
26 |
|
|
27 |
#define KERNEL_LOAD_ADDR 0x00004000 |
#define KERNEL_LOAD_ADDR 0x00004000 |
28 |
|
#define INITRD_LOAD_ADDR 0x00800000 |
29 |
#define PROM_ADDR 0xffd00000 |
#define PROM_ADDR 0xffd00000 |
30 |
#define PROM_FILENAMEB "proll.bin" |
#define PROM_FILENAMEB "proll.bin" |
31 |
#define PROM_FILENAMEE "proll.elf" |
#define PROM_FILENAMEE "proll.elf" |
136 |
{ |
{ |
137 |
char buf[1024]; |
char buf[1024]; |
138 |
int ret, linux_boot; |
int ret, linux_boot; |
139 |
unsigned long vram_size = 0x100000, prom_offset; |
unsigned int i; |
140 |
|
unsigned long vram_size = 0x100000, prom_offset, initrd_size; |
141 |
|
|
142 |
linux_boot = (kernel_filename != NULL); |
linux_boot = (kernel_filename != NULL); |
143 |
|
|
182 |
kernel_filename); |
kernel_filename); |
183 |
exit(1); |
exit(1); |
184 |
} |
} |
185 |
|
|
186 |
|
/* load initrd */ |
187 |
|
initrd_size = 0; |
188 |
|
if (initrd_filename) { |
189 |
|
initrd_size = load_image(initrd_filename, phys_ram_base + INITRD_LOAD_ADDR); |
190 |
|
if (initrd_size < 0) { |
191 |
|
fprintf(stderr, "qemu: could not load initial ram disk '%s'\n", |
192 |
|
initrd_filename); |
193 |
|
exit(1); |
194 |
|
} |
195 |
|
} |
196 |
|
if (initrd_size > 0) { |
197 |
|
for (i = 0; i < 64 * TARGET_PAGE_SIZE; i += TARGET_PAGE_SIZE) { |
198 |
|
if (ldl_raw(phys_ram_base + KERNEL_LOAD_ADDR + i) |
199 |
|
== 0x48647253) { // HdrS |
200 |
|
stl_raw(phys_ram_base + KERNEL_LOAD_ADDR + i + 16, INITRD_LOAD_ADDR); |
201 |
|
stl_raw(phys_ram_base + KERNEL_LOAD_ADDR + i + 20, initrd_size); |
202 |
|
break; |
203 |
|
} |
204 |
|
} |
205 |
|
} |
206 |
} |
} |
207 |
} |
} |