Patchwork Re : Re : [SeaBIOS] : Memory problem with Qemu/SeaBIOS

login
register
mail settings
Submitter Alain Ribière
Date May 9, 2012, 3:57 p.m.
Message ID <1336579073.87968.YahooMailNeo@web130105.mail.mud.yahoo.com>
Download mbox | patch
Permalink /patch/158001/
State New
Headers show

Comments

Alain Ribière - May 9, 2012, 3:57 p.m.
Tanks for your answer.


I have to apologize, I made a mistake. I rechecked my application and used git bisect.
So I found that this is not a SeaBIOS issue (actually it's more a C-DOS issues...). My problem comes from this Qemu commit :

49669fc551e0ccd2310a9584a9b7343a0bcae477 is the first bad commit
commit 49669fc551e0ccd2310a9584a9b7343a0bcae477
Author: Glauber Costa <glommer@redhat.com>
Date:   Thu Apr 23 15:20:55 2009 -0400

    suport device driver initialization model
    
    According to PnP specification, Appendix B, Option ROMs
    that support DDIM (device driver initialization model) should
    have their memory space writeable.
    
    KVM deviates from us here, by removing the IO_MEM_ROM flag,
    to allow for PCI option ROMs (they require DDIM). However,
    there's absolutely no reason we can't do the same.
    
    Signed-off-by: Glauber Costa <glommer@redhat.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

:040000 040000 5186361da34236c2680af6ed568b5f5bdb2915ac c968308168e23ffa2678011ed2ff010389b528bd M      hw



Also I found the theorical memory map of the C-DOS in the documentation of my legacy application :
start         end

000000    9FFFF    Program area

0A0000    0BFFFF    Video memory

0C00000    0C7FFF    BIOS graphic card
0C8000    0CBFFF    BIOS cache controller
0CC000    0CFFFF    BIOS removable disk
0D0000    0D3FFF    BIOS network adapter
0D4000    0EFFFF    CDOS system
0F0000    0FFFFF    ROM BIOS

I wonder what is the CDOS system at 0D4000... It seems a bit strange.


I do not understand why this commit affects the C-DOS memory allocation.
But you're probably right, C-DOS is using memory addresses he shouldn't for it's own purpose causing conflicts...

If you have any idea.


Thanks, and sorry again for the wrong issue (I will remove the SeaBIOS mailing list in the future mails)...


Alain

Patch

diff --git a/hw/pc.c b/hw/pc.c
index 61f6e7b..340b313 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -920,7 +920,8 @@  static void pc_init1(ram_addr_t ram_size, int vga_ram_size,
 
     option_rom_offset = qemu_ram_alloc(0x20000);
     oprom_area_size = 0;
-    cpu_register_physical_memory(0xc0000, 0x20000, option_rom_offset);
+    cpu_register_physical_memory(0xc0000, 0x20000,
+                                 option_rom_offset | IO_MEM_ROM);
 
     if (using_vga) {
         /* VGA BIOS load */