On Fri, Apr 01, 2016 at 01:43:47PM +0100, Richard W.M. Jones wrote: > From: Marc Marí <mar...@redhat.com> > > This optionrom is based on linuxboot.S. > > Signed-off-by: Marc Marí <mar...@redhat.com> > Signed-off-by: Richard W.M. Jones <rjo...@redhat.com> > --- > .gitignore | 4 + > hw/i386/pc.c | 9 +- > hw/nvram/fw_cfg.c | 2 +- > include/hw/nvram/fw_cfg.h | 1 + > pc-bios/optionrom/Makefile | 7 +- > pc-bios/optionrom/linuxboot_dma.c | 297 > ++++++++++++++++++++++++++++++++++++++ > 6 files changed, 315 insertions(+), 5 deletions(-) > create mode 100644 pc-bios/optionrom/linuxboot_dma.c
It would be great to merge this but there's more work necessary. I CCed Marc's current email address. He was interning at Red Hat but is now back at university so the Red Hat address is not being read. Marc: What was still missing from this patch? > diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile > index ce4852a..bdd0cc1 100644 > --- a/pc-bios/optionrom/Makefile > +++ b/pc-bios/optionrom/Makefile > @@ -13,15 +13,18 @@ CFLAGS := -Wall -Wstrict-prototypes -Werror > -fomit-frame-pointer -fno-builtin > CFLAGS += -I$(SRC_PATH) > CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector) > CFLAGS += $(CFLAGS_NOPIE) > +CFLAGS += -m32 > QEMU_CFLAGS = $(CFLAGS) > > -build-all: multiboot.bin linuxboot.bin kvmvapic.bin > +ASFLAGS += -32 > + > +build-all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin > > # suppress auto-removal of intermediate files > .SECONDARY: > > %.img: %.o > - $(call quiet-command,$(LD) $(LDFLAGS_NOPIE) -Ttext 0 -e _start -s -o $@ > $<," Building $(TARGET_DIR)$@") > + $(call quiet-command,$(LD) $(LDFLAGS_NOPIE) -m elf_i386 -Ttext 0 -e > _start -s -o $@ $<," Building $(TARGET_DIR)$@") Gerd noted in <1454411187.9300.54.ca...@redhat.com>: Hmm, that breaks the windows cross build: make: Entering directory `/home/kraxel/projects/qemu/build-win32' Building optionrom/linuxboot_dma.img i686-w64-mingw32-ld: unrecognised emulation mode: elf_i386 Supported emulations: i386pe make[1]: *** [linuxboot_dma.img] Error 1 and then: Testing shows two more problems: (1) initrd loading is broken, kernel complains it finds only gibberish: [ 0.934582] Unpacking initramfs... [ 1.166983] Initramfs unpacking failed: junk in compressed archive [ 1.168458] Freeing initrd memory: 32812k freed (2) going back to non-dma boot via -M pc-$old doesn't work, appearently fw_cfg dma is enabled even for old machine types.
signature.asc
Description: PGP signature