2 * Dummy board with just RAM and CPU for use as an ISS.
4 * Copyright (c) 2007 CodeSourcery.
6 * This code is licenced under the GPL
13 #define KERNEL_LOAD_ADDR 0x10000
17 static void dummy_m68k_init(ram_addr_t ram_size
,
18 const char *boot_device
,
19 const char *kernel_filename
, const char *kernel_cmdline
,
20 const char *initrd_filename
, const char *cpu_model
)
29 env
= cpu_init(cpu_model
);
31 fprintf(stderr
, "Unable to find m68k CPU definition\n");
35 /* Initialize CPU registers. */
38 /* RAM at address zero */
39 cpu_register_physical_memory(0, ram_size
,
40 qemu_ram_alloc(ram_size
) | IO_MEM_RAM
);
43 if (kernel_filename
) {
44 kernel_size
= load_elf(kernel_filename
, 0, &elf_entry
, NULL
, NULL
);
46 if (kernel_size
< 0) {
47 kernel_size
= load_uimage(kernel_filename
, &entry
, NULL
, NULL
);
49 if (kernel_size
< 0) {
50 kernel_size
= load_image_targphys(kernel_filename
,
52 ram_size
- KERNEL_LOAD_ADDR
);
53 entry
= KERNEL_LOAD_ADDR
;
55 if (kernel_size
< 0) {
56 fprintf(stderr
, "qemu: could not load kernel '%s'\n",
66 static QEMUMachine dummy_m68k_machine
= {
68 .desc
= "Dummy board",
69 .init
= dummy_m68k_init
,
72 static void dummy_m68k_machine_init(void)
74 qemu_register_machine(&dummy_m68k_machine
);
77 machine_init(dummy_m68k_machine_init
);