fix linuxboot.bin and multiboot.bin to not hijack int19
Currently linuxboot.bin and multiboot.bin option roms override int19vector to intercept boot process. No sane option rom should do that.Provide bev entry instead that will be called by BIOS if option rom...
Add scripts directory
Move build and user scripts into scripts directory.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
optionrom: fix bugs in signrom.sh
signrom.sh has multiple bugs:
- the last byte is considered when calculating the existing checksum, but not when computing the correction- apprently the 'expr' expression overflows and produces incorrect results with...
Fix multiboot compilation
Commit dd4239d6574ca41c94fc0d0f77ddc728510ffc57 broke multiboot. It replaced theinstruction "rep insb (%dx), %es:(%edi)" by the binary output of"addr32 rep insb (%dx), %es:(%di)".
Linuxboot calls the respective helper function in a code16 section. So the...
linuxboot: fix gdt address calculation
The gdt address calculation in linuxboot.bin is broken in two ways: firstit loads %cs into %eax, but that instruction leaves the high bits of %eaxundefined and we did not clear them. Secondly, we completely ignore the...
Use vpath directive
The vpath directive has two advantages over the VPATH variable:1) it allows to skip searching of .o files; 2) the default semanticsare to append to the vpath, so there is no confusion between "VPATH=xyz" and "VPATH+=xyz".
Since "vpath %.c %.h PATH" is not valid, I'm introducing a wrapper...
Fix thinko in linuxboot.S
The %gs segment that was used was not matching the comments.I just moved the GDT descriptor on the stack instead.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Make -kernel for linux work with bochsbios
While trying to run -kernel with -bios pc-bios/pcbios.bin, I realizedthat I was actually writing data to %es, but only set up %ds to a 32-bitsegment we want to write to.
So at the end of the day the data hasn't actually been copied. Oops....
multiboot: Fix module loading and setting of mmap.
Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>Acked-by: Alexander Graf <agraf@suse.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Allow build of linuxboot.S with old assemblers
In the spirit of ff56954baf9cfab5cbbe18d10b4a09e4a17f39a8, fix thebuild of linuxboot.S with old as(1) (as found in some BSD base systems)by emitting the bytes of the insn it doesn't like instead.
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>...
Move common option rom code to header file
We will have a linux boot option rom soon, so let's take all functionalitythat might be useful for both to a header file that both roms can include.
That way we only have to write fw_cfg access code once.
Signed-off-by: Alexander Graf <agraf@suse.de>...
Convert linux bootrom to external rom and fw_cfg
We already have a working multiboot implementation that uses fw_cfg to getits kernel module etc. data in int19 runtime now.
So what's missing is a working linux boot option rom. While at it I figured itwould be a good idea to take the opcode generator out of pc.c and instead use...
Convert multiboot to fw_cfg backed data storage
Right now we load the guest kernel to RAM, fire off the BIOS, hope itdoesn't clobber memory and run an option rom that jumps into the kernel.
That breaks with SeaBIOS, as that clears memory. So let's read all...
multiboot.S patch for old as(1) (was: Re: [Qemu-devel] Some OpenBSD/amd64 build fixes)
On Wed, Sep 23, 2009 at 10:55:02PM +0200, Juergen Lock wrote:
On Wed, Sep 23, 2009 at 09:31:16PM +0100, Laurence Tratt wrote:[...] then the above error doesn't occur, but...
On Wed, Sep 23, 2009 at 09:31:16PM +0100, Laurence Tratt wrote:[...]
then the above error doesn't occur, but...
optionrom: remove use of implicit RM variable
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
optionrom: create .PHONY variable
restore CFLAGS check for conflict and fix recursive CFLAGS issue
cc-option uses more make-syntax to replace the shell "if/else".
Issue with recursive += is fixed by doing the first assignmentsimply-expanded, as explained inhttp://www.gnu.org/software/make/manual/html_node/Appending.html...
otionrom: Use local CFLAGS no global one
It is needed by %.o : %.c rule.
optionrom: make clean should remove raw and .d
Remove CFLAGS parameter in cc-option
With cc-option we are testing if gcc just accept a particular option, we don't need CFLAGS at all. And this fixes the recursive problem with CFLAGS
Rename CPPFLAGS to QEMU_CFLAGS
Now we have to variables: QEMU_CFLAGS: flags without which we can't compileCFLAGS: "-g -O2"
We can now run:
make CFLAGS="-fbar" foo.omake CFLAGS="" foo.omake CFLAGS="-O3" foo.o
And it all should work.
Signed-off-by: Juan Quintela <quintela@redhat.com>...
Fix checksum writing in signboot.sh
The printf command takes an octal value after \, so we have to convertour decimal representation to octal first and then write it.
This unbreaks extboot signing. Multiboot wasn't affected yet becausethe checksum was < 8....
Do not try to invoke shebang scripts directly (NFS issues)
Signed-off-by: malc <av1474@comtv.ru>
Option rom makefile fixes
Fix toplevel option rom makefile rules.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Fix out of tree build broken by 791e08c753a9f9be3c3880b4ea83b6dfa4b6ccad
Use quiet-command for building optionrom
use cc-option for optionrom
signrom.sh: portability fix
Attached patch makes signrom.sh working on NetBSD.The output of the 'od' command leads to a syntax errorwhich breaks the build.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Update to a hopefully more future proof FSF address
Fix multiboot.bin build on mingw32
This combination of ld/object was suggested by Bartlomiej Celary
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Don't copy multiboot.bin into pc-bios after built
That dirties the working directory of the tree.
Replace signrom with shell script v3
In order to not execute code we just compiled, let's replace signromwith a shell script that does the same thing while staying compatibleto pretty much every system available.
This should make cross-compilation for windows easier....
Work around Solaris gas problem
Multiboot build system v4
In order to build the multiboot option rom, we need a Makefile and a toolto sign the rom with.
Both are provided by this patch and mostly taken from the extboot source,written by Anthony Liguori.
Once built, the resulting binary gets copied to pc-bios automatically....
Multiboot support v5
This patch implements support for Multiboot on x86 for -kernel.Multiboot is a "new" approach to get rid of different bootloaders, providinga unified interface for the kernel. It supports command line options andkernel modules.
The two probably best known projects using multiboot are Xen and GNU Hurd....