diff -ru ./hw/pc.c ../qpatch/hw/pc.c --- ./hw/pc.c 2010-02-26 03:34:00.000000000 +0100 +++ ../qpatch/hw/pc.c 2010-04-19 17:18:12.000000000 +0200 @@ -1130,7 +1130,7 @@ } if (pci_enabled) { - pci_bus = i440fx_init(&i440fx_state, &piix3_devfn, isa_irq); + pci_bus = i440fx_init(&i440fx_state, &piix3_devfn, isa_irq, ram_size); } else { pci_bus = NULL; isa_bus_new(NULL); diff -ru ./hw/pc.h ../qpatch/hw/pc.h --- ./hw/pc.h 2010-02-26 03:34:00.000000000 +0100 +++ ../qpatch/hw/pc.h 2010-04-19 17:10:50.000000000 +0200 @@ -129,7 +129,7 @@ struct PCII440FXState; typedef struct PCII440FXState PCII440FXState; -PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix_devfn, qemu_irq *pic); +PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix_devfn, qemu_irq *pic, int ram_size); void i440fx_set_smm(PCII440FXState *d, int val); void i440fx_init_memory_mappings(PCII440FXState *d); diff -ru ./hw/piix_pci.c ../qpatch/hw/piix_pci.c --- ./hw/piix_pci.c 2010-02-26 03:34:00.000000000 +0100 +++ ../qpatch/hw/piix_pci.c 2010-04-19 17:27:59.000000000 +0200 @@ -209,7 +209,7 @@ static PIIX3State *piix3_dev; -PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn, qemu_irq *pic) +PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn, qemu_irq *pic, int ram_size) { DeviceState *dev; PCIBus *b; @@ -236,6 +236,11 @@ piix3_dev = piix3; + ram_size = ram_size / 8 / 1024 / 1024; + if (ram_size > 255) + ram_size = 255; + (*pi440fx_state)->dev.config[0x57]=ram_size; + return b; }