Instead of calling bin2c helper we just include 16-bit pure code with .incbin
and export the symbols we need.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Use the KVM_SET_MSRS ioctl() to set up model-specific registers (MSRs) to a
known state. The MSRs are initialized to zero for now because I'm not sure
what are the right values.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
We substitute hardcoded fake bios handlers with ones generated
from assembly sources. This way we may extend them if needed.
In particular new int0x10 handler just write output into video
guest memory so the node machine may read the output anytime
it needs (though, to be fair, the kernel uses int0x10 only once
at bootup procedure if there was an attempt to boot directly
from disk/floppy, any other output is done via video port I/O
which is not implemented yet).
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
In case if some particular interrupt entry needs
to be modified we should use interrupt_table__set
helper.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Instead of hacking boot protocol header better to place interrupt handlers into
BDA.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Though ivt stands for interrupt vector table it's not that clear, lets use
real_intr_desc for that.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
In particular this will keep boot agruments for kernel. The commit technically
prepares ground for real argument pass.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
The Linux kernel expects stack to be set up for it. Fixes a bug in the program
where we start to run an instruction stream filled with zeros.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Booting to a Linux kernel is no longer supported. Therefore, start executing
at offset 0x200 of bzImage which has a jump to real-mode setup code. See
Documentation/x86/boot.txt for more details.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
We start KVM in 16-bit mode so we should set cs:ip to point to the real-mode
boot sector and setup code, not the protected mode kernel that starts at 1M.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
This patch adds segmentation setup for the guest. It's not perfect yet as we
get KVM_EXIT_UNKNOWN but it's a start nevertheless.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>