- Added
proto::ata::AtaRequestBuilder::read_pio(). - Added
proto::shell::Shell::{var(), set_var(), vars()} - Added
proto::pci::root_bridge::PciRootBridgeIo::configuration(). - Added
proto::pci::root_bridge::PciRootBridgeIo::enumerate(). - Added
proto::nvme::pass_thru::NvmePassThru::broadcast(). - Added
proto::media::block::BlockIO2. - Added
proto::device_path::DevicePath::to_pool(). - Added
proto::device_path::DevicePathUtilities::duplicate_path(). - Added
proto::pci::enumeration::PciTree::device_path(). - Added
revision()anddevice_type_guid()toSerialprotocol - Implemented
DisplayforDevicePath,DevicePathNodeandScopedProtocol, enabling a easy and convenient way to visualize a device path. For example, this may printPciRoot(0x0)/Pci(0x6,0x0)/MAC(525400000001,0x1).ScopedProtocolonly implementsDisplayif the underlying protocol also implementsDisplay. - Added
Handle::component_name()andHandle::device_path()to simplify the common use-case of querying more information about a handle. - Added
fs::path::Path::join(). - Integration of
TimewithtimecrateTryFrom:time::PrimitiveDateTime <--> Time(without timezone)TryFrom:time::OffsetDateTime <--> Time(with timezone)
- Integration of
TimewithjiffcrateTryFrom:jiff::DateTime <--> Time(without timezone)TryFrom:jiff::Zoned <--> Time(with timezone)
- export all
text::{input, output}::*types - Changed ordering of
proto::pci::PciIoAddressto (bus -> dev -> fun -> reg -> ext_reg). - Return request with status as error data object for
proto::ata::pass_thru::AtaDevice. - Breaking:
SimpleNetwork::wait_for_packet- has been renamed to
wait_for_packet_event - now returns
Result<Event>instead of&Event
- has been renamed to
- Breaking:
Http::get_mode_datadoesn't consume a parameter anymore and instead return an owned value of typeHttpConfigData Input::wait_for_key_event()now returnsResult<Event>rather than an Option.Pointer::wait_for_input_event()now returnsResult<Event>rather than an Option.- Breaking:
boot::check_eventnow consumes&Eventrather thanEvent, removing the need for unnecessaryEvent::unsafe_clone()s. - MSRV increased to 1.88.
- Breaking: Renamed
DevicePath::to_string()toDevicePath::to_string16()to better differentiate with the newto_string()coming from the newDisplay. - Breaking: Renamed
DevicePathNode::to_string()toDevicePathNode::to_string16()to better differentiate with the newto_string()coming from the newDisplay. runtime::set_time()now consumes&TwhereT: Clone + TryInto<Time>instead of&Timeto improve the integration with other time types.
- Fixing build on https://docs.rs/uefi
- Added
ConfigTableEntry::MEMORY_ATTRIBUTES_GUIDandConfigTableEntry::IMAGE_SECURITY_DATABASE_GUID. - Added
proto::usb::io::UsbIo. - Added
proto::pci::PciRootBridgeIo. - Added
proto::hii::config::ConfigKeywordHandler. - Added
proto::hii::config::HiiConfigAccess. - Added
proto::hii::config_str::ConfigurationString. - Added
proto::acpi::AcpiTable. - Added
proto::hii::database::HiiDatabase. - Added
proto::hii::config_str::MultiConfigurationStringIter. - Added
proto::hii::config_routing::HiiConfigRouting.
- Breaking:
boot::stallnow takecore::time::Durationinstead ofusize. table::cfg::*_GUIDconstants now deprecated. UseConfigTableEntry::*_GUIDinstead.system::with_config_table,system::with_stdin,system::with_stdoutandsystem::with_stderrnow take mutably closure.- Breaking: The MSRV is now 1.85.1 and the crate uses the Rust 2024 edition.
- Breaking: All public APIs related to networking now use
core::net::{IpAddr, Ipv4Addr, Ipv6Addr}, i.e., the types from the standard library.- This especially affects the SNP and PXE protocols
- The new design makes writing network code much simpler.
- Breaking: Removed type
IpAddress. In case you still need a low-level EFI compatible type please useIpAddressfromuefi-raw. - The documentation in
lib.rsnow provides guidance on how to select features tailored to your use case. - Feature
log-debugconis no longer a default feature. You only need to add it in case you are also using theloggerfeature and if you run your UEFI image in QEMU or Cloud Hypervisor, when the debugcon/debug-console device is available. - The documentation for UEFI protocols has been streamlined and improved.
- Fixed memory safety bug in
SimpleNetwork::read_nv_data. Thebufferparameter is now mutable. - Removed all internal usages including public APIs using the unstable
allocator_apifeature. It may be reintroduced if it will have a chance of getting stabilized in stable Rust.- Removed
File::get_boxed_info_in - Removed
Directory::read_entry_boxed_in
- Removed
- Added
boot::signal_event. - Added conversions between
proto::network::IpAddressandcore::nettypes. - Added conversions between
proto::network::MacAddressand the[u8; 6]type that's more commonly used to represent MAC addresses. - Added
proto::media::disk_info::DiskInfo. - Added
mem::AlignedBuffer. - Added
proto::device_path::DevicePath::append_path(). - Added
proto::device_path::DevicePath::append_node(). - Added
proto::scsi::pass_thru::ExtScsiPassThru. - Added
proto::nvme::pass_thru::NvmePassThru. - Added
proto::ata::pass_thru::AtaPassThru. - Added
boot::ScopedProtocol::open_params(). - Added
boot::TplGuard::old_tpl(). - Added
boot::calculate_crc32().
- Breaking: Removed
BootPolicyErrorasBootPolicyconstruction is no longer fallible.BootPolicynow tightly integrates the newBooleantype ofuefi-raw. - Breaking: The
pxe::BaseCode::tftp_read_dirandpxe::BaseCode::mtftp_read_dirmethods now take&mut selfinstead of&self. - Breaking: The
pxe::Modestruct is now opaque. Use method calls to access mode data instead of direct field access. - Breaking:
PoolDevicePathNodeandPoolDevicePathmoved from moduleproto::device_path::texttoproto::device_path. - Breaking:
exit_boot_servicesnow consumes aOption<MemoryType>which defaults to the recommended value ofMemoryType::LOADER_DATA. - Breaking: Removed duplication in
DevicePathHeader. Instead of public fields, there is now a public constructor combined with public getters. boot::memory_map()will never returnStatus::BUFFER_TOO_SMALLfrom now on, as this is considered a hard internal error where users can't do anything about it anyway. It will panic instead.SimpleNetwork::transmitnow passes the correct buffer size argument. Previously it incorrectly added the header size to the buffer length, which could cause the firmware to read past the end of the buffer.boot::allocate_pagesno longer panics if the allocation is at address zero. The allocation is retried instead, and in all failure cases an error is returned rather than panicking.- The
Displayimpl forCStr8now excludes the trailing null character. VariableKeysinitializes with a larger name buffer to work around firmware bugs on some devices.- The UEFI
allocator::Allocatorhas been optimized for page-aligned allocations.
Trivial release to fix crate license documentation.
As of this release, the project has been relicensed from MPL-2.0 to Apache-2.0/MIT, to better align with the Rust crate ecosystem. (This does not alter the license of previous releases.) Details at #1470.
- Added
proto::device_path::PoolDevicePathandproto::device_path::PoolDevicePathNode.
- MSRV increased to 1.81.
core::error::Errorimpls are no longer gated by theunstablefeature.- Fixed missing checks in the
TryFromconversion from&DevicePathNodeto specific node types. The node type and subtype are now checked, andNodeConversionError::DifferentTypeis returned if they do not match. - Breaking: Fixed memory leaks in
DevicePathFromTextprotocol. The methods now return wrapper objects that free the device path / device path node on drop.
See Deprecating SystemTable/BootServices/RuntimeServices for details of the deprecated items that were removed in this release.
- Impl
PartialEqandEqforGptPartitionEntry. - Added
CStr16::from_u16_until_nulandCStr16::from_char16_until_nul.
- Breaking: Deleted the deprecated
BootServices,RuntimeServices, andSystemTablestructs. - Breaking: Deleted deprecated functions
allocator::init,allocator::exit_boot_services,helpers::system_table,table::system_table_boot, andtable::system_table_runtime. - Breaking:
FileSystemno longer has a lifetime parameter, and the deprecated conversion fromuefi::table::boot::ScopedProtocolhas been removed. - Fixed
boot::open_protocolto properly handle a null interface pointer. VariableKeynow has a publicnamefield. Thisnamefield always contains a valid string, so theVariableKey::name()method has been deprecated. Since all fields ofVariableKeyare now public, the type can be constructed by users.- The
VariableKeysiterator will now yield an error item if a variable name is not UCS-2.
See Deprecating SystemTable/BootServices/RuntimeServices for details of the deprecations in this release.
We added documentation to lib.rs and the uefi-rs book about how
uefi compares to "standard Rust binaries" for UEFI (those using std), and
how to integrate the uefi crate into them.
- Added
Handle::new. - Added the
uefi::boot,uefi::runtime, anduefi::systemmodules to the prelude. - Added
runtime::variable_exists.
- The
BootServices,RuntimeServices, andSystemTablestructs have been deprecated (as well as related typesBoot,Runtime, andSystemTableView). Use theuefi::bootanduefi::runtime, anduefi::systemmodules instead. - In
uefi::table::boot,ScopedProtocol,TplGuard,ProtocolsPerHandle, andHandleBufferhave been deprecated. Use the structs of the same name inuefi::bootinstead. uefi::table::system_table_bootanduefi::table::system_table_runtimehave been deprecated. Use theuefi::runtimeanduefi::bootmodules instead.- Breaking: The conversion functions between device paths and text no longer
take a
BootServicesargument. The global system table is used instead. - Breaking:
GraphicsOutput::modesno longer takes aBootServicesargument. The global system table is used instead. - Breaking:
ComponentName::openno longer takes aBootServicesargument. The global system table is used instead. allocator::initandallocator::exit_boot_serviceshave been deprecated. These functions are now no-ops. The allocator now internally uses the global system table.FileSystem::newnow acceptsboot::ScopedProtocolin addition totable::boot::ScopedProtocol.
See Deprecating SystemTable/BootServices/RuntimeServices for
details of the new system/boot/runtime modules, and upcoming deprecations.
uefi::systemis a new module that provides freestanding functions for accessing fields of the global system table.uefi::bootis a new module that provides freestanding functions for boot services using the global system table.uefi::runtimeis a new module that provides freestanding functions for runtime services using the global system table.uefi::table::system_table_rawis a new function to retrieve a raw pointer to the global system table.- Add standard derives for
ConfigTableEntry. PcrEvent/PcrEventInputsimplAlign,Eq, andPartialEq.- Added
PcrEvent::new_in_boxandPcrEventInputs::new_in_box. VariableKeyimplsClone,Eq,PartialEq,Ord,PartialOrd, andHash.- The traits
MemoryMapandMemoryMapMuthave been introduced together with the implementationsMemoryMapRef,MemoryMapRefMut, andMemoryMapOwned. This comes with some changes. Read below. We recommend to directly use the implementations instead of the traits. - Added
LoadFileandLoadFile2which abstracts over theLOAD_FILEandLOAD_FILE2protocols. The UEFI test runner includes an integration test that shows how Linux loaders can use this to implement the initrd loading mechanism used in Linux.
- Breaking:
uefi::helpers::initno longer takes an argument. - The lifetime of the
SearchTypereturned fromBootServices::register_protocol_notifyis now tied to the protocol GUID. The oldMemoryMapwas renamed toMemoryMapOwned.pub fn memory_map(&self, mt: MemoryType) -> Result<MemoryMap>now returns aMemoryMapOwned.
- Breaking:
PcrEvent::new_in_bufferandPcrEventInputs::new_in_buffernow take an initialized buffer ([u8] instead of[MaybeUninit<u8>]), and if the buffer is too small the required size is returned in the error data. - Breaking: The type
MemoryMapwas renamed toMemoryMapOwned.MemoryMapis now a trait. Read the documentation of theuefi > mem > memory_mapmodule to learn more. - Breaking: Exports of Memory Map-related types from
uefi::table::bootare now removed. Useuefi::mem::memory_mapinstead. The patch you have to apply to theusestatements of your code might look as follows:< use uefi::table::boot::{BootServices, MemoryMap, MemoryMapMut, MemoryType}; --- > use uefi::mem::memory_map::{MemoryMap, MemoryMapMut, MemoryType}; > use uefi::table::boot::BootServices;
- Breaking: Added a new
BootPolicytype which breaks existing usages ofLoadImageSource.
- Breaking:: Fixed a bug in the impls of
TryFrom<&[u8]>for&DevicePathHeader,&DevicePathNodeand&DevicePaththat could lead to memory unsafety. See #1281.
- Added
RuntimeServices::update_capsule. - Added
RuntimeServices::query_capsule_capabilities. - The logger from
uefi::helpersnow also logs to the debugcon device (QEMU) respectively the debug-console (cloud-hypervisor). This only works on x86. It is activated by default (only on x86) and can be deactivated by removing thelog-debugconcargo feature. The major benefit is that one can get log messages even after one exited the boot services. - Added
table::{set_system_table, system_table_boot, system_table_runtime}. This provides an initial API for global tables that do not require passing around a reference. - Added
ResetNotificationprotocol. - Added
TryFrom<&[u8]>forDevicePathHeader,DevicePathNodeandDevicePath. - Added
ByteConversionError. - Re-exported
CapsuleFlags. - One can now specify in
TimeErrorwhat fields ofTimeare outside its valid range.Time::is_validhas been updated accordingly. MemoryMap::as_rawwhich provides raw access to the memory map. This is for example useful if you create your own Multiboot2 bootloader that embeds the EFI mmap in a Multiboot2 boot information structure.Modeis nowCopyandClone.- Added
TryFrom<&[u8]>forTime.
SystemTable::exit_boot_servicesis nowunsafe. See that method's documentation for details of obligations for callers.BootServices::allocate_poolnow returnsNonZero<u8>instead of*mut u8.helpers::system_tableis deprecated, usetable::system_table_bootinstead.BootServices::memory_mapchanged its signature from
pub fn memory_map<'buf>(&self, buffer: &'buf mut [u8]) -> Result<MemoryMap<'buf>> {
to
pub fn memory_map(&self, mt: MemoryType) -> Result<MemoryMap>- Allocations now happen automatically internally on the UEFI heap. Also, the returned type is automatically freed on the UEFI heap, as long as boot services are not excited. By removing the need for that explicit buffer and the lifetime, the API is simpler.
GraphicsOutput::query_modeis now private. UseGraphicsOutput::modesinstead.
- Removed the
panic-on-logger-errorsfeature of theueficrate. Logger errors are now silently ignored.
- Added
Timestampprotocol. - Added
UnalignedSlice::as_ptr. - Added common derives for
EventandHandle. uefi::helpers::initwith the functionality that used to be inuefi::services. With that, new features were added:global_allocatorpanic_handlerqemu
- Implemented
PartialEq<char>forChar8andChar16. - Added
CStr16::from_char16_with_nulandChar16::from_char16_with_nul_unchecked. - Added terminal GUID constants to
device_path::messaging::Vendor. - Added
MemoryMap::from_raw. - Implemented
Hashfor all char and string types.
DevicePath::to_stringandDevicePathNode::to_stringnow return out-of-memory errors as part of the error type rather than with anOption.
- Implemented
Index,IndexMut,get, andget_mutonMemoryMap. - Added
SystemTable::as_ptr.
- We fixed a memory leak in
GraphicsOutput::query_mode. As a consequence, we had to add&BootServicesas additional parameter. BootServices::free_pagesandBootServices::free_poolare nowunsafeto call, since it is possible to trigger UB by freeing memory that is still in use.Loggerno longer requires exterior mutability.Logger::newis nowconst, takes no arguments, and creates the logger in a disabled state. CallLogger::set_outputto enable it.uefi::allocator::initnow takes a&mut SystemTable<Boot>instead of&BootServices.BootServices::{install,reinstall,uninstall}_protocol_interfacenow takeconstinterface pointers.
- MSRV bumped to 1.70.
Input::wait_for_key_eventnow returns anOption<Event>, and is no longerconst.Protocol::wait_for_input_eventnow returns anOption<Event>, and is no longerconst.LoadedImage::devicenow returns anOption<Handle>and is no longerconst.BootServices::get_image_file_systemnow returnsScopedProtocol<SimpleFileSystem>instead offs::FileSystem.uefi::proto::shimis now available on 32-bit x86 targets.ParityandStopBitsare now a newtype-enums instead of Rust enums. Their members now have upper-case names.FileSystem::try_existsnow returnsFileSystemResult<bool>.FileSystem::copyis now more efficient for large files.MpService::startup_all_apsandMpService::startup_this_apnow accept an optionaleventparameter to allow non-blocking operation.- Added
core::error::Errorimplementations to all error types. SystemTable::exit_boot_servicesnow takes one parammemory_typeto ensure the memory type of memory map.- Added the
ShellParamsprotocol
BootServices::memmoveandBootServices::set_memhave been removed, use standard functions likecore::ptr::copyandcore::ptr::write_bytesinstead.
DevicePath::to_boxed,DevicePath::to_owned, andDevicePath::as_bytesDevicePathInstance::to_boxed,DevicePathInstance::to_owned, andDevicePathInstance::as_bytesDevicePathNode::data- Added
Event::from_ptr,Event::as_ptr, andHandle::as_ptr. - Added
ScopedProtocol::getandScopedProtocol::get_mutto access potentially-null interfaces without panicking. DevicePath::to_stringandDevicePathNode::to_string
- Renamed
LoadImageSource::FromFilePathtoLoadImageSource::FromDevicePath - The
DerefandDerefMutimpls forScopedProtocolwill now panic if the interface pointer is null.
- Fixed function signature bug in
BootServices::install_configuration_table.
- Added
BootServices::install_configuration_table.
- Renamed
FileSystemIOErrorContexttoIoErrorContext. ResetTypeis now a newtype-enum instead of a Rust enum. Its members now have upper-case names.PointerModeandPointerStatenow contain arrays rather than tuples, as tuples are not FFI safe.RegularFile::readno longer returnsOption<usize>in error data. ABUFFER_TOO_SMALLerror can only occur when reading a directory, not a file.RegularFile::readnow reads in 1 MiB chunks to avoid a bug in some firmware. This fix also applies tofs::FileSystem::read.
- There is a new
fsmodule that provides a high-level API for file-system access. The API is close to thestd::fsmodule. The module also provides aPathand aPathBufabstraction that is similar to the ones fromstd::path. However, they are adapted for UEFI. - Multiple convenience methods for
CString16andCStr16, including:CStr16::as_slice()CStr16::num_chars()CStr16::is_empty()CString16::new()CString16::is_empty()CString16::num_chars()CString16::replace_char()CString16::push()CString16::push_str()From<&CStr16>forCString16From<&CStr16>forStringFrom<&CString16>forString
- Added
RuntimeServices::get_variable_boxed(requires theallocfeature). - Added
CStr16::as_bytes - Added
AsRef<[u8]>andBorrow<[u8]>forCstr8andCStr16. - Added
LoadedImageDevicePathprotocol. - Added
FileAttribute::is_directory(&self)andFileAttribute::is_regular_file(&self) - Added
LoadedImage::code_type()andLoadedImage::data_type() Allocatorwill now use the memory type of the running UEFI binary:MemoryType::LOADER_DATAfor UEFI applicationsMemoryType::BOOT_SERVICES_DATAfor UEFI boot driversMemoryType::RUNTIME_SERVICES_DATAfor UEFI runtime drivers
- The
global_allocatormodule has been renamed toallocator, and is now available regardless of whether theglobal_allocatorfeature is enabled. Theglobal_allocatorfeature now only controls whetherallocator::Allocatoris set as Rust's global allocator. Error::newandError::fromnow panic if the status isSUCCESS.Image::get_image_file_systemnow returns afs::FileSysteminstead of the protocol.CString16::defaultnow always contains a null character.- Conversion from
StatustoResulthas been reworked. Theinto_with,into_with_val, andinto_with_errmethods have been removed fromStatus.impl From<Status> for Resulthas also been removed. A newStatusExttrait has been added that provides conversion methods to replace the ones that have been removed.StatusExthas been added to the prelude. - The
Guidstruct andguid!macro implementations have been replaced with re-exports from theuguidcrate. Thefrom_valuesmethod has been removed; usually theguid!macro is a more convenient choice, butneworfrom_bytescan also be used if needed. There are also a number of newGuidmethods. - The
MEMORY_DESCRIPTOR_VERSIONconstant has been moved toMemoryDescriptor::VERSION. - The
Revisionstruct's one field is now public. - Renamed
CStr8::to_bytestoCStr8::as_bytesand changed the semantics: The trailing null character is now always included in the returned slice. DevicePathBuilder::with_vecnow clears theVecbefore use.bitflagsbumped from1.3to2.1GptPartitionAttributesnow has 16 additionalTYPE_SPECIFIC_BIT_<N>constants.
As of this release, the UEFI crates work on the stable channel. This requires Rust 1.68 or higher.
- Added the
ComponentName1andComponentName2protocols. TheComponentNamewrapper will automatically selectComponentName2if available, and fall back toComponentName1otherwise. FileType,FileHandle,RegularFile, andDirectorynow implementDebug.- Added
RuntimeServices::delete_variable()helper method. - Implement
BorrowforCString16andToOwnedforCStr16. - Every public struct now implements
Debug. Exceptions are cases when there is no sensible way of presenting a useful Debug representation, such as for Unions.
SystemTable::exit_boot_servicesnow takes no parameters and handles the memory map allocation itself. Errors are now treated as unrecoverable and will cause the system to reset.- Re-export the
cstr8,cstr16, andentrymacros from the root of theueficrate. HandleBufferandProtocolsPerHandlenow implementDeref. TheHandleBuffer::handlesandProtocolsPerHandle::protocolsmethods have been deprecated.- Removed
'bootlifetime from theGraphicsOutput,Output,Pointer, andSerialprotocols. - The generic type
Dataofuefi::Error<Data: Debug>doesn't need to beDisplayto be compatible withcore::error::Error. Note that the error Trait requires theunstablefeature. - deprecation removals:
- interfaces
BootServices::locate_protocolandBootServices::handle_protocolwere removed.BootServices::open_protocolandBootServices::open_protocol_exclusiveare better variants and available since EFI 1.10 (2002). ScopedProtocol::interfaceis not public anymore. Use theDereftrait.
- interfaces
- Added
table::boot::PAGE_SIZEconstant.
- Fixed several protocol functions so that they work with unsized protocols
(like
DevicePath):BootServices::locate_device_path,BootServices::get_handle_for_protocol,BootServices::test_protocol,BootServices::find_handles, andSearchType::from_proto. - Fixed a warning printed when using
uefias a dependency: "the following packages contain code that will be rejected by a future version".
- Implementations for the trait
EqStrUntilNulnow allow?Sizedinputs. This means that you can writesome_cstr16.eq_str_until_nul("test")instead ofsome_cstr16.eq_str_until_nul(&"test")now. - Added
TryFrom<core::ffi::CStr>implementation forCStr8. - Added
Directory::read_entry_boxedwhich works similar toFile::get_boxed_info. This allows easier iteration over the entries in a directory. (requires the alloc feature) - Added
Directory::read_entry_boxed_inandFile::get_boxed_info_inthat use theallocator_apifeature. (requires the unstable and alloc features) - Added an
core::error::Errorimplementation forErrorto ease integration with error-handling crates. (requires the unstable feature) - Added partial support for the TCG protocols for TPM devices under
uefi::proto::tcg.
UnalignedSlicenow implementsClone, and theDebugimpl now prints the elements instead of the internal fields.- The unstable
negative_implsfeature is no longer required to use this library. BootServices::memory_map()now returnsMemoryMapIterinstead ofimpl Iteratorwhich simplifies usage.BootServices::exit_boot_services()now returnsMemoryMapIterinstead ofimpl Iteratorwhich simplifies usage.GraphicsOutput::modes()now returnsModesIterinstead ofimpl Iteratorwhich simplifies usage.- Use of the unstable
ptr_metadatafeature has been replaced with a dependency on theptr_metacrate. pxe::DiscoverInfois now a DST. Create withnew_in_bufferby supplying aMaybeUninit<u8>slice of appropriate length.- Redundant private field used for padding in
MemoryDescriptorstructure was removed. Now all fields of this struct are public.
- Added
PhysicalAddressandVirtualAddresstype aliases. - Added
Guid::from_bytesandGuid::to_bytes. - Added
UnalignedSlicefor representing a reference to an unaligned slice. - Added
DeviceSubType::MESSAGING_REST_SERVICEandDeviceSubType::MESSAGING_NVME_OF_NAMESPACE. - Added
MemoryAttribute::SPECIAL_PURPOSE,MemoryAttribute::CPU_CRYPTO,MemoryAttribute::ISA_VALID, andMemoryAttribute::ISA_MASK. - Added the
UnicodeCollationprotocol - Added structs to represent each type of device path node. All node types specified in the UEFI 2.10 Specification are now supported.
- Added
DevicePathBuilderfor building new device paths. - Added
BootServices::install_protocol_interface,BootServices::uninstall_protocol_interface, andBootServices::reinstall_protocol_interface. - Added
BootServices::register_protocol_notify. - Added
SearchType::ByRegisterNotifyandProtocolSearchKey.
- Renamed crate feature
alloctoglobal_allocator. - Renamed crate feature
extstoalloc. - Fixed the definition of
AllocateTypeso thatMaxAddressandAddressalways take a 64-bit value, regardless of target platform. - The conversion methods on
DevicePathToTextandDevicePathFromTextnow return auefi::Resultinstead of anOption. Eventis now a newtype aroundNonNull<c_void>instead of*mut c_void.- Changed
SystemTable::firmware_revisionto return au32instead of aRevision. The firmware revision's format is vendor specific and may not have the same semantics as the UEFI revision. - Changed
Revisiontorepr(transparent). - Add
Revision::EFI_2_100constant. - The
Revisiontype now implementsDisplaywith correct formatting for all UEFI versions. The customDebugimpl has been removed and replaced with a derivedDebugimpl. CStr16::from_u16_with_nul_uncheckedandcstr16!are now allowed inconstcontexts.
- Removed
UnalignedCStr16; useUnalignedSliceinstead. AnUnalignedSlice<u16>can be converted to a string withto_cstr16orto_cstring16. - Removed
as_file_path_media_device_pathandas_hard_drive_media_device_pathfromDevicePathNode. UseDevicePathNode::as_enuminstead. Alternatively, convert withTryInto, e.g.let node: &proto::device_path::media::HardDrive = node.try_into()?. - Removed
AcpiDevicePathandHardDriveMediaDevicePath. Useproto::device_path::acpi::Acpiandproto::device_path::media::HardDriveinstead. `
- Added
DerefandDerefMuttrait implementations toScopedProtocol. This eliminates the need to explicitly access theinterfacefield, which is now marked as deprecated. - Implemented
core::fmt::Writefor theSerialprotocol. - Added the
MemoryProtectionprotocol. - Added
BootServices::get_handle_for_protocol. - Added trait
EqStrUntilNuland implemented it forCStr8,CStr16, andCString16(CString8 doesn't exist yet). Now you can compare everything that isAsRef<str>(such asStringandstrfrom the standard library) to UEFI strings. Please head to the documentation ofEqStrUntilNulto find out limitations and further information. - Added
BootServices::image_handleto get the handle of the executing image. The image is set automatically by the#[entry]macro; if a program does not use that macro then it should callBootServices::set_image_handle. - Added
BootServices::open_protocol_exclusive. This provides a safe and convenient subset ofopen_protocolthat can be used whenever a resource doesn't need to be shared. In same cases sharing is useful (e.g. you might want to draw to the screen using the graphics protocol, but still allow stdout output to go to the screen as well), and in those casesopen_protocolcan still be used. - Added
DiskIoandDiskIo2protocols. - Added
HardDriveMediaDevicePathand related types. - Added
PartialOrdandOrdto the traits derived byGuid. - The
Filetrait now knows the methodsis_regular_fileandis_directory. Developers profit from this on the structFileHandle, for example.
- Marked
BootServices::handle_protocolasunsafe. (This method is also deprecated -- useopen_protocol_exclusiveoropen_protocolinstead.) - Deprecated
BootServices::locate_protocoland marked itunsafe. UseBootServices::get_handle_for_protocolandBootServices::open_protocol_exclusive(orBootServices::open_protocol) instead. - Renamed feature
ignore-logger-errorstopanic-on-logger-errorsso that it is additive. It is now a default feature. - Corrected the name of
BlockIOMedia::is_media_presettois_media_present.
- Removed the
exts::allocate_bufferfunction. This function could cause undefined behavior when called with aLayoutwith an alignment other than 1. A safe alternative is to useVec::into_boxed_slice. - Removed
Fromconversions fromucs2::ErrortoStatusandError. - Removed use of the unstable
try_trait_v2feature, which allowed?to be used withStatusin a function returninguefi::Result. This can be replaced by callingstatus.into(), orResult::from(status)in cases where the compiler needs a type hint.
- Added EFI revision constants to
Revision.
- The table
Headerstruct'sDebugimpl now prints the correct signature. - The
BootServices::create_event_exandRuntimeServices::query_variable_infomethods now check the table version to make sure it's 2.0 or higher before calling the associated function pointers. This prevents potential invalid pointer access. - Fixed an incorrect pointer cast in the
Rngprotocol that could cause undefined behavior.
- Relaxed the version requirements for the
bitflagsandlogdependencies to allow earlier patch versions. - Enabled
doc_auto_cfgon docs.rs to show badges on items that are gated behind a feature.
- Added
FileHandle::into_directoryandFileHandle::into_regular_file. - Added
TimeParams,Time::invalid, andTime::is_invalid. - Added
RuntimeServices::query_variable_infoandVariableStorageInfo. - Added
DevicePathToTextandDevicePathFromText. - Added
LoadedImage::file_path - Implemented
TryFrom<Vec<u16>> for CString16. - Added
UnalignedCStr16. - Added
FilePathMediaDevicePath. - Added
DevicePath::as_acpi_device_pathandDevicePath::as_file_path_media_device_path. - Included
cstr8andcstr16macros fromuefi-macrosin the prelude. - Added
DevicePathInstance,DevicePathNode, andFfiDevicePath.
Time::newnow takes a singleTimeParamsargument so that date and time fields can be explicitly named at the call site.- The file info types now derive
PartialEqandEq. - The
FileAttributestype is nowrepr(transparent). DevicePathis now a DST that represents an entire device path. TheDevicePathInstanceandDevicePathNodeprovide views of path instances and nodes, respectively.- The methods of
Revisionare nowconst.
- Fixed undefined behavior in
proto::media::file::File::get_boxed_info.
- Added
PartialEqimpls forCStr16 == CStr16,&CStr16 == CString, andCString == &CStr16. - Added
Displayimpl forCString16. - Added
Handle::from_ptrandSystemTable<View>::from_ptr, which areunsafemethods for initializing from a raw pointer. - Added
CStr16::as_slice_with_nulto provide immutable access to the underlying slice. - Added
LoadedImage::load_options_as_bytesandLoadedImage::load_options_as_cstr16. - Added
Align::offset_up_to_alignment,Align::round_up_to_alignment, andAlign::align_buf. - Added
BootServices::connect_controllerandBootServices::disconnect_controller. - Added
BootServices::load_imageandLoadImageSource. Together these replaceBootServices::load_image_from_bufferand also allow an image to be loaded via theSimpleFileSystemprotocol. - Added
Rngprotocol. - Added
GptPartitionAttributesstruct and associated constants. - Added
Output::output_string_lossy. - Added
ResultExt::handle_warning.
- Updated to the 2021 edition.
File::opennow takes the filename as&CStr16instead of&str, avoiding an implicit string conversion.FileInfo::new,FileSystemInfo::new, andFileSystemVolumeLabel::newnow take theirnameparameter as&CStr16instead of&str, avoiding an implicit string conversion. Additionally, an unaligned storage buffer is now allowed as long as it is big enough to provide an aligned subslice.LoadImage::set_load_optionsnow takes au8pointer instead ofChar16.- The
Errortype is now public. - The type of
GptPartitionEntry.attributesis nowGptPartitionAttributes. - The
uefi::Resulttype now treats UEFI warnings as errors by default. Theuefi::Result::Okvariant no longer contains aCompletion, so the type behaves more like a regular RustResulttype.
- Removed
CStr16::as_stringmethod. UseToStringinstead. - Removed
FileInfoCreationError::InvalidChar. This error type is no longer needed due to the removal of implicit string conversions in file info types. - Removed
LoadedImage::load_options, useLoadedImage::load_options_as_bytesorLoadedImage::load_options_as_cstr16instead. - Removed
NamedFileProtocolInfo,FileInfoHeader,FileSystemInfoHeader, andFileSystemVolumeLabelHeader. UseFileInfo,FileSystemInfo, andFileSystemVolumeLabelinstead. - Removed
BootServices::load_image_from_buffer. UseBootServices::load_imageinstead. - Removed
Completiontype. Warnings are now treated as errors. - Removed many
ResultExtmethods, for most of them the standardResultmethods can be used instead. Useunwrapinstead ofunwrap_success,expectinstead ofexpect_success,expect_errinstead ofexpect_error, andmapinstead ofmap_inner. Thelog_warningmethod has also been removed, use the newResultExt::handle_warningmethod instead.
- Fixed compilation with Rust 1.60 by no longer enabling the
vec_spare_capacityfeature, which has been stabilized. - Fixed the header size calculated by
FileInfo::newandFileSystemInfo::new. - Fixed incorrect alignment of the volume label field in
FileSystemInfo. This caused the beginning of the string to be truncated and could result in out-of-bounds reads. - Fixed size check for file info types so that alignment padding is taken into account. This fixes potential out-of-bounds writes.