10 #define BIOS_SELECTOR 0xf000
11 #define BIOS_IP 0xfff0
12 #define BIOS_SP 0x8000
14 bool kvm__load_firmware(struct kvm *kvm, const char *firmware_filename)
21 fd = open(firmware_filename, O_RDONLY);
28 if (st.st_size > MB_FIRMWARE_BIOS_SIZE)
29 die("firmware image %s is too big to fit in memory (%Lu KB).\n", firmware_filename, (u64)(st.st_size / 1024));
31 p = guest_flat_to_host(kvm, MB_FIRMWARE_BIOS_BEGIN);
33 while ((nr = read(fd, p, st.st_size)) > 0)
36 kvm->arch.boot_selector = BIOS_SELECTOR;
37 kvm->arch.boot_ip = BIOS_IP;
38 kvm->arch.boot_sp = BIOS_SP;