@@ -21,6 +21,8 @@ use alloc::vec::Vec;
21
21
use arraydeque:: ArrayDeque ;
22
22
use spin:: RwLock ;
23
23
24
+ static BIOS_BLOB : & ' static [ u8 ] = include_bytes ! ( "blob/bios.bin" ) ;
25
+
24
26
static VIRTUAL_MACHINES : RoAfterInit < VirtualMachines > =
25
27
RoAfterInit :: uninitialized ( ) ;
26
28
@@ -218,7 +220,6 @@ pub struct PhysicalDeviceConfig {
218
220
pub struct VirtualMachineConfig {
219
221
cpus : Vec < percore:: CoreId > ,
220
222
images : Vec < ( String , GuestPhysAddr ) > ,
221
- bios : Option < String > ,
222
223
virtual_devices : DeviceMap ,
223
224
physical_devices : PhysicalDeviceConfig ,
224
225
memory : u64 , // in MB
@@ -241,7 +242,6 @@ impl VirtualMachineConfig {
241
242
images : vec ! [ ] ,
242
243
virtual_devices : DeviceMap :: default ( ) ,
243
244
physical_devices : physical_devices,
244
- bios : None ,
245
245
memory : memory,
246
246
}
247
247
}
@@ -259,18 +259,6 @@ impl VirtualMachineConfig {
259
259
Ok ( ( ) )
260
260
}
261
261
262
- /// Specify that the given image 'path' should be mapped as the BIOS
263
- ///
264
- /// The precise meaning of `image` will vary by platform. This will be a
265
- /// value suitable to be passed to `VmServices::read_file`.
266
- ///
267
- /// The BIOS image will be mapped such that the end of the image is at
268
- /// 0xffffffff and 0xfffff (i.e., it will be mapped in two places)
269
- pub fn map_bios ( & mut self , bios : String ) -> Result < ( ) > {
270
- self . bios = Some ( bios) ;
271
- Ok ( ( ) )
272
- }
273
-
274
262
/// Access the configurations virtual `DeviceMap`
275
263
pub fn virtual_devices ( & self ) -> & DeviceMap {
276
264
& self . virtual_devices
@@ -398,25 +386,15 @@ impl VirtualMachine {
398
386
Self :: map_data ( data, addr, space)
399
387
}
400
388
401
- fn map_bios (
402
- bios : & str ,
403
- space : & mut GuestAddressSpace ,
404
- info : & BootInfo ,
405
- ) -> Result < ( ) > {
406
- let data = info
407
- . find_module ( bios)
408
- . ok_or_else ( || {
409
- Error :: InvalidValue ( format ! ( "No such bios '{}'" , bios) )
410
- } ) ?
411
- . data ( ) ;
412
- let bios_size = data. len ( ) as u64 ;
389
+ fn map_bios ( space : & mut GuestAddressSpace ) -> Result < ( ) > {
390
+ let bios_size = BIOS_BLOB . len ( ) as u64 ;
413
391
Self :: map_data (
414
- data ,
392
+ BIOS_BLOB ,
415
393
& memory:: GuestPhysAddr :: new ( ( 1024 * 1024 ) - bios_size) ,
416
394
space,
417
395
) ?;
418
396
Self :: map_data (
419
- data ,
397
+ BIOS_BLOB ,
420
398
& memory:: GuestPhysAddr :: new ( ( 4 * 1024 * 1024 * 1024 ) - bios_size) ,
421
399
space,
422
400
)
@@ -429,9 +407,7 @@ impl VirtualMachine {
429
407
let mut guest_space = GuestAddressSpace :: new ( ) ?;
430
408
431
409
// First map the bios
432
- if let Some ( ref bios) = config. bios {
433
- Self :: map_bios ( & bios, & mut guest_space, info) ?;
434
- }
410
+ Self :: map_bios ( & mut guest_space) ?;
435
411
436
412
// Now map any guest iamges
437
413
for image in config. images . iter ( ) {
0 commit comments