Features/PC System Flash: Difference between revisions

From QEMU
No edit summary
No edit summary
 
(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
This is a proposal for PC System Flash emulation for on QEMU/KVM.
PC System Flash emulation was added for QEMU in pc-1.1.


=Flash Hardware=
=Flash Hardware=
Leverage the pre-existing CFI flash support in qemu/hw/pflash_cfi01.c. (Another option is to use qemu/hw/pflash_cfi02.c.)
Uses CFI flash support in hw/pflash_cfi01.c.


=Command line interface=
=Command line interface=
Currently the -pflash parameter has no use with
Usage of -bios and -pflash parameters as of pc-1.1:
an x86 or x86-64 system.  To enable PC system flash, this parameter
would now be used on x86 & x86-64 systems.
 
The -bios and -pflash parameters would both now have a use with qemu/kvm:


{| class='wikitable' border=1
{| class='wikitable' border=1
! -bios used !! -pflash used !! Result
! KVM enabled !! -pflash used !! -bios used !! Result
|-
|-
| <Center>No</Center> || <Center>No</Center> || (no change) 'bios.bin' will be loaded as rom image.
|rowspan=3 | <Center>No</Center>  
| <Center>Yes</Center> || <Center>-</Center>
| -pflash parameter will be loaded as flash image just below 4GB.
 
'bios.bin' and -bios parameter will be ''ignored''.
|-
| <Center>No</Center> || <Center>No</Center>
| 'bios.bin' will be used to create a read-only pflash drive.
 
A flash device is available, but it is read-only.
|-
|-
| <Center>No</Center> || <Center>Yes</Center>
| <Center>No</Center> || <Center>Yes</Center>
| ('''changing''') -pflash parameter will be loaded as flash image just below 4GB.
| -bios parameter will be used to create a read-only pflash drive.
 
A flash device is available, but it is read-only.
|-
|rowspan=3 | <Center>Yes</Center>
|| <Center>Yes</Center> || <Center>-</Center>
| An error message condition:


'bios.bin' will be ''ignored''.
PC system firmware (pflash) not available
|-
|-
| <Center>Yes</Center> || <Center>No</Center> || (no change) -bios parameter will be loaded as rom image.
|| <Center>No</Center> || <Center>No</Center>
| 'bios.bin' will be loaded as rom image.
 
No system flash is available.
|-
|-
| <Center>Yes</Center> || <Center>Yes</Center>
| <Center>No</Center> || <Center>Yes</Center>
| ('''changing''') -bios parameter will be loaded as rom image just below 4GB.
| -bios parameter filename will be loaded as rom image.


-pflash parameter will be loaded as flash image just below the bios rom image.
No system flash is available.
|}
|}


=Known Issues=
==pflash drives==
* KVM will not boot if -pflash is used and -bios is not used.  KVM currently only functions with this support if code is not attempting to run from the emulated flash.  This issue does not affect QEMU.
The flash image can be any drive image format supported by QEMU.
 
There are two ways to add the pflash drive when launching qemu-system-i386 or qemu-system-x86_64:
# Use the -pflash parameter
# Use the -drive parameter with if=pflash
 
[[Category:Completed feature pages]]

Latest revision as of 15:39, 11 October 2016

PC System Flash emulation was added for QEMU in pc-1.1.

Flash Hardware

Uses CFI flash support in hw/pflash_cfi01.c.

Command line interface

Usage of -bios and -pflash parameters as of pc-1.1:

KVM enabled -pflash used -bios used Result
No
Yes
-
-pflash parameter will be loaded as flash image just below 4GB.

'bios.bin' and -bios parameter will be ignored.

No
No
'bios.bin' will be used to create a read-only pflash drive.

A flash device is available, but it is read-only.

No
Yes
-bios parameter will be used to create a read-only pflash drive.

A flash device is available, but it is read-only.

Yes
Yes
-
An error message condition:

PC system firmware (pflash) not available

No
No
'bios.bin' will be loaded as rom image.

No system flash is available.

No
Yes
-bios parameter filename will be loaded as rom image.

No system flash is available.

pflash drives

The flash image can be any drive image format supported by QEMU.

There are two ways to add the pflash drive when launching qemu-system-i386 or qemu-system-x86_64:

  1. Use the -pflash parameter
  2. Use the -drive parameter with if=pflash