From: Pekka Enberg Date: Sat, 27 Mar 2010 09:15:31 +0000 (+0200) Subject: kvm: Document the 'reset vector' hack X-Git-Tag: next-20110824~3^2~528^2~230 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=23b22409630e2aceb8294f7180839cf64fd01962;p=karo-tx-linux.git kvm: Document the 'reset vector' hack Signed-off-by: Pekka Enberg --- diff --git a/tools/kvm/kvm.c b/tools/kvm/kvm.c index e922b93804c8..b7ec6e625ad3 100644 --- a/tools/kvm/kvm.c +++ b/tools/kvm/kvm.c @@ -153,6 +153,13 @@ static inline uint32_t segment_to_flat(uint16_t selector, uint16_t offset) return ((uint32_t)selector << 4) + (uint32_t) offset; } +/* + * HACK ALERT! KVM seems to be unable to run 16-bit real mode if 'cs' selector + * does not equal to 0xf000 at the beginning. To work around that, we need a + * 'reset vector' at 0xf000:0xfff0 that has an hard-coded jump to 0x000:0x7c000 + * where we also load the Linux kernel boot sector and setup code. + */ + #define RESET_VECTOR_CS 0xf000 #define RESET_VECTOR_IP 0xfff0