qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] sh4: r2d --append option support
@ 2009-02-11 13:15 takasi-y
  2009-02-13 13:59 ` Shin-ichiro KAWASAKI
  2009-03-03  6:20 ` Aurelien Jarno
  0 siblings, 2 replies; 9+ messages in thread
From: takasi-y @ 2009-02-11 13:15 UTC (permalink / raw)
  To: qemu-devel

Add linux kernel command line ("--append" option) support.
Fix kernel loading address to appropriate position when --append used.
Using --kernel but --append case is left untouched for backward compatibility.

Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
---
I found this has not been posted as a patch to apply.
I hope this be merged into the branch(if any:) for next stable release.
/yoshii
---
 hw/r2d.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/hw/r2d.c b/hw/r2d.c
index e6b2bf4..7dcb723 100644
--- a/hw/r2d.c
+++ b/hw/r2d.c
@@ -233,20 +233,25 @@ static void r2d_init(ram_addr_t ram_size, int vga_ram_size,
         pci_nic_init(pci, &nd_table[i], -1, "ne2k_pci");
 
     /* Todo: register on board registers */
-    {
+    if (kernel_filename) {
       int kernel_size;
       /* initialization which should be done by firmware */
       stl_phys(SH7750_BCR1, 1<<3); /* cs3 SDRAM */
       stw_phys(SH7750_BCR2, 3<<(3*2)); /* cs3 32bit */
 
-      kernel_size = load_image(kernel_filename, phys_ram_base);
+      if (kernel_cmdline) {
+          kernel_size = load_image(kernel_filename, phys_ram_base + 0x80000);
+          env->pc = (SDRAM_BASE + 0x80000) | 0xa0000000;
+          pstrcpy(phys_ram_base + 0x10100, 256, kernel_cmdline);
+      } else {
+          kernel_size = load_image(kernel_filename, phys_ram_base);
+          env->pc = SDRAM_BASE | 0xa0000000; /* Start from P2 area */
+      }
 
       if (kernel_size < 0) {
         fprintf(stderr, "qemu: could not load kernel '%s'\n", kernel_filename);
         exit(1);
       }
-
-      env->pc = SDRAM_BASE | 0xa0000000; /* Start from P2 area */
     }
 }
 
-- 
1.5.6.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-03-29 15:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-11 13:15 [Qemu-devel] sh4: r2d --append option support takasi-y
2009-02-13 13:59 ` Shin-ichiro KAWASAKI
2009-03-03  6:20 ` Aurelien Jarno
2009-03-07 17:23   ` [Qemu-devel] [PATCH] fread_targphys(): Do not cut off the tail takasi-y
2009-03-09 18:09     ` Blue Swirl
2009-03-07 18:00   ` [Qemu-devel] sh4: r2d --append option support takasi-y
2009-03-28 22:51     ` Aurelien Jarno
2009-03-28 23:20       ` Aurelien Jarno
2009-03-29 15:47         ` takasi-y

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).