- Added
ScsiIoProtocol.
- Added
RuntimeServices::update_capsule.
- Removed the
panic-on-logger-errorsfeature of theueficrate. Logger errors are now silently ignored.
- Added
ResetNotificationprotocol.
- 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.