qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] sh4: r2d --append option support


From: takasi-y
Subject: [Qemu-devel] sh4: r2d --append option support
Date: Wed, 11 Feb 2009 22:15:52 +0900 (JST)

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 <address@hidden>
---
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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]