aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / vendor / uefi / CHANGELOG.md
| 1 | # uefi - [Unreleased] |
| 2 | |
| 3 | ## Added |
| 4 | |
| 5 | ## Changed |
| 6 | |
| 7 | ## Removed |
| 8 | |
| 9 | |
| 10 | # uefi - v0.41.0 (2026-09-21) |
| 11 | |
| 12 | This release is dominated by a LLM-assisted soundness audit of the safe |
| 13 | wrappers. Most entries below fix a place where a wrapper trusted the firmware: a |
| 14 | pointer that can be null, a length that can exceed the buffer it describes, |
| 15 | memory that the firmware may leave uninitialized, or a `BOOLEAN` that is neither |
| 16 | `0` nor `1`. Nearly all of those fixes are invisible to callers. The ones that |
| 17 | are not are listed under `## Changed`: they are breaking because a shared |
| 18 | reference is not sound where the firmware writes, or because a conversion that |
| 19 | used to panic now reports an error. |
| 20 | |
| 21 | We use LLMs to find problems, not to write code we do not understand. Nothing |
| 22 | unreviewed lands in this crate. |
| 23 | |
| 24 | ## Added |
| 25 | - `proto::console::pointer::AbsolutePointer` and |
| 26 | `proto::console::gop::EdidDiscovered`. `proto::console::pointer` re-exports |
| 27 | `AbsolutePointerMode`, `AbsolutePointerModeAttributes` and |
| 28 | `AbsolutePointerState`. |
| 29 | - `CString16::clear`, `CString16::extend` and `PathBuf::clear`. |
| 30 | - Exported `data_types::FromSliceUntilNulError`. |
| 31 | |
| 32 | ## Changed |
| 33 | - **Breaking**: `SimpleNetwork::{start, stop, initialize, reset, shutdown, |
| 34 | receive_filters, station_address, get_interrupt_status, |
| 35 | get_recycled_transmit_buffer_status}`, `BlockIO::read_blocks` and |
| 36 | `BlockIO2::read_blocks_ex` take `&mut self`. The firmware updates the mode |
| 37 | and media structures during these calls, which conflicted with the shared |
| 38 | reference returned by `mode` and `media`. |
| 39 | - **Breaking**: `SimpleNetwork::transmit` takes the packet as `&mut [u8]`, |
| 40 | because the firmware writes the media header into the buffer when |
| 41 | `header_size` is nonzero. |
| 42 | - **Breaking**: `Shell::{set_current_dir, set_var}` take `&mut self`. The shell |
| 43 | frees the strings returned by `current_dir` and `var` when the value changes, |
| 44 | so holding one across a setter was a use after free. |
| 45 | - **Breaking**: `PointerMode` and `PointerState` are re-exports of |
| 46 | `SimplePointerMode` and `SimplePointerState` from `uefi-raw`, instead of |
| 47 | duplicates that declared the firmware's `BOOLEAN` fields as Rust `bool`, |
| 48 | which is undefined behavior for any value other than `0` and `1`. The fields |
| 49 | are now named as in the specification; convert a button with `bool::from`. |
| 50 | - **Breaking**: `Key` and `KeyData` implement `TryFrom` instead of `From` for |
| 51 | the raw key types, and `Input::read_key` and `InputEx::read_key` return |
| 52 | `DEVICE_ERROR` when the firmware reports a character that is not valid UCS-2. |
| 53 | This previously panicked. |
| 54 | - **Breaking**: `FromUefi::from_uefi` is a safe function that takes the buffer |
| 55 | and the number of bytes written by the firmware and returns a `Result`. It |
| 56 | previously built a reference that could exceed the buffer and trusted the |
| 57 | firmware to NUL-terminate the name. The required size reported by |
| 58 | `File::get_info` now includes the trailing padding of the requested type. |
| 59 | - **Breaking**: `fs::path::Components::Item` is `&[Char16]` instead of |
| 60 | `CString16`, which avoids a heap allocation during iteration. Use the new |
| 61 | `CString16::extend` to collect one. |
| 62 | - **Breaking**: `Server::server_type` and the `server_type` parameter of |
| 63 | `Server::new` take `BootstrapType` instead of `u16`. |
| 64 | - **Breaking**: `boot::create_event_ex` takes the event group as |
| 65 | `Option<&Guid>` instead of `Option<NonNull<Guid>>`. |
| 66 | - Relaxed `boot::wait_for_event` to `&[Event]` and |
| 67 | `runtime::set_virtual_address_map` to `&[MemoryDescriptor]`. The firmware |
| 68 | only reads those inputs. |
| 69 | |
| 70 | ## Fixed |
| 71 | |
| 72 | ### Null pointers returned by the firmware |
| 73 | - `boot::{locate_handle, locate_handle_buffer, protocols_per_handle, |
| 74 | locate_device_path}` turned them into handles or references. |
| 75 | - `Shell::vars`, `ShellParameters::args`, `ComponentName::{driver_name, |
| 76 | controller_name, supported_languages}`, `HiiConfigRouting::export`, |
| 77 | `UsbIo::supported_languages`, `PciRootBridgeIo::configuration` and |
| 78 | `system::firmware_vendor` dereferenced them. |
| 79 | |
| 80 | ### Sizes and lengths reported by the firmware |
| 81 | - `boot::memory_map` trusted the reported map size, so sorting a map larger |
| 82 | than its buffer read out of bounds. |
| 83 | - The ATA, NVMe and SCSI pass-thru response accessors trusted the transfer |
| 84 | length and could return a slice pointing past the buffer. |
| 85 | - `GraphicsOutput::query_mode` read out of bounds when the firmware reports a |
| 86 | mode info buffer smaller than `ModeInfo`. |
| 87 | - `DevicePathNode::from_ffi_ptr` and the functions built on it underflowed the |
| 88 | node length for nodes shorter than the node header. They now panic instead. |
| 89 | - Parsing a TCG event log walked past the log, accepted a digest count larger |
| 90 | than the header allows, accepted an event extending past the last entry, and |
| 91 | overflowed the header offset arithmetic on 32-bit targets. |
| 92 | - The internal `make_boxed` helper deallocated with a layout that did not match |
| 93 | the allocation when the firmware reported a larger size than it wrote. This |
| 94 | affects `get_boxed_info`, `read_entry_boxed`, `get_variable_boxed`, |
| 95 | `load_file` and `HiiDatabase::export_all_raw`. |
| 96 | |
| 97 | ### Uninitialized memory |
| 98 | - `LoadFile::load_file`, `LoadFile2::load_file` and |
| 99 | `HiiDatabase::export_all_raw` returned a buffer with an uninitialized tail |
| 100 | when the firmware wrote less than it reported. |
| 101 | - `AlignedBuffer` exposed uninitialized memory through its safe accessors and |
| 102 | allocated with a zero-size layout for an empty buffer. |
| 103 | - The `DmaBuffer` of `Iommu::allocate_buffer` exposed uninitialized memory as |
| 104 | `[u8]`, and `DiscoverInfo::new_in_buffer` left padding uninitialized. |
| 105 | |
| 106 | ### Firmware writing through a pointer derived from a shared reference |
| 107 | - `PciRootBridgeIo::{pci, memory, io}` returned a `PciIoAccess` that held a |
| 108 | mutable reference into the protocol instance while a pointer to the whole |
| 109 | instance was passed to the firmware. |
| 110 | - `UsbIo::{control_transfer, sync_bulk_receive, sync_interrupt_receive}`, |
| 111 | `BaseCode::udp_read`, `HttpHelper::{request, response_first, response_more}` |
| 112 | and `Output::{current_mode, modes}` handed such a pointer to firmware that |
| 113 | writes through it. `HttpHelper` additionally left a token pointing into a |
| 114 | dead stack frame when polling failed. |
| 115 | |
| 116 | ### Layout and alignment |
| 117 | - `system::with_config_table` built a slice from a misaligned configuration |
| 118 | table. |
| 119 | - The `Http`, `HttpBinding` and `Ip4Config2` protocol wrappers were missing |
| 120 | `repr(transparent)`, although they are created by casting a raw pointer |
| 121 | provided by the firmware. |
| 122 | - Documented the alignment requirement of `FrameBuffer::{read_value, |
| 123 | write_value}`. |
| 124 | |
| 125 | ### Type invariants |
| 126 | - `UnicodeCollation::{str_lwr, str_upr, fat_to_str}` returned a `CStr16` |
| 127 | covering the whole output buffer, which violates the invariants of that type |
| 128 | when the buffer is larger than the string. |
| 129 | |
| 130 | ### Leaks |
| 131 | - `boot::start_image` frees the exit data buffer that the started image may |
| 132 | hand back, `HttpHelper::response_first` frees the response headers allocated |
| 133 | by the driver, and `HiiConfigRouting::export` frees the result string. All |
| 134 | three were leaked before. |
| 135 | |
| 136 | ### Panics |
| 137 | - `ScopedProtocol`, `TplGuard`, `HandleBuffer`, `ProtocolsPerHandle` and the |
| 138 | types backed by pool memory such as `PoolString` no longer panic in release |
| 139 | builds when dropped after boot services have exited. The cleanup is skipped, |
| 140 | as the resources are gone together with the boot services. Debug builds still |
| 141 | assert that boot services are active. |
| 142 | - `FileHandle` logs a failed close in `drop` instead of panicking, the |
| 143 | `Display` impls of `DevicePath` and `DevicePathNode` print the size when the |
| 144 | conversion to text fails, for example because the device path to text |
| 145 | protocol is not installed, and `HttpHelper::response_first` replaces invalid |
| 146 | UTF-8 in a response header with U+FFFD. |
| 147 | |
| 148 | # uefi - v0.40.0 (2026-08-25) |
| 149 | |
| 150 | ## Added |
| 151 | - Added `proto::pi::mp::{CpuPhysicalLocation2, CPU_V2_EXTENDED_TOPOLOGY}` for |
| 152 | the extended processor topology. |
| 153 | |
| 154 | ## Changed |
| 155 | - Added `char16!` const-compatible macro as convenient replacement for `Char16::try_from().unwrap()` |
| 156 | - `proto::debug::SystemContextARM` now contains the trailing `IFAR` field |
| 157 | mandated by the spec. |
| 158 | - **Breaking:** The `GptPartitionAttributes::TYPE_SPECIFIC_BIT_*` constants |
| 159 | now cover bits 48 to 63 as mandated by the spec, instead of bits 47 to 62. |
| 160 | - `boot::set_watchdog_timer` now passes the watchdog data size in bytes, as |
| 161 | mandated by the spec. Previously, firmware only saw half of the data. |
| 162 | - `proto::usb::io::UsbIo::supported_languages` no longer returns a slice with |
| 163 | twice the actual number of language IDs, whose second half was an |
| 164 | out-of-bounds read. |
| 165 | - `proto::network::pxe::DiscoverInfo::new_in_buffer` now accounts for the |
| 166 | alignment padding before the server list in its buffer size check. |
| 167 | Previously, an exactly-sized buffer was written 2 bytes out of bounds. |
| 168 | - **Breaking:** `proto::pi::mp::ProcessorInformation` now contains the |
| 169 | `extended_information` field mandated by the PI specification. Previously, |
| 170 | the struct was 24 bytes too small, which firmware could write past. |
| 171 | - **Breaking:** The revision-gated media fields `lowest_aligned_lba`, |
| 172 | `logical_blocks_per_physical_block`, and |
| 173 | `optimal_transfer_length_granularity` moved from `BlockIOMedia` to |
| 174 | `BlockIO` and return `None` if the protocol revision does not include |
| 175 | them. Previously, they read past the media structure on old revisions. |
| 176 | - `DevicePath::to_pool`, `append_path`, and `append_node` now locate the |
| 177 | `DevicePathUtilities` protocol by its own GUID instead of the |
| 178 | `DevicePathToText` GUID. |
| 179 | - `UnicodeCollation::str_to_fat` now zeroes the output buffer before the |
| 180 | conversion. Previously, the result could contain garbage from the |
| 181 | uninitialized buffer, or reference one byte past its end. |
| 182 | - **Breaking:** The response accessors of `proto::ata::AtaResponse`, |
| 183 | `proto::nvme::NvmeResponse` and `proto::scsi::ScsiResponse` now borrow from |
| 184 | `self` instead of returning the lifetime of the underlying buffer. |
| 185 | - `proto::media::file::FileSystemInfo` stores `read_only` as `Boolean` |
| 186 | instead of `bool`. Previously, a firmware value other than 0 or 1 produced |
| 187 | an invalid `bool`. |
| 188 | - `mem::memory_map::MemoryMapOwned::from_initialized_mem` now rejects a |
| 189 | `desc_size` that is not a multiple of the descriptor alignment, like the |
| 190 | other constructors. Previously, all entries but the first were accessed |
| 191 | through a misaligned reference. |
| 192 | - `proto::media::file::RegularFile::read` clamps the length reported by the |
| 193 | firmware to the requested size. Previously, a larger value wrote past the |
| 194 | end of the caller's buffer. |
| 195 | - `proto::network::ip4config2::Ip4Config2::get_interface_info` no longer |
| 196 | forms a misaligned reference into its byte-aligned buffer. |
| 197 | - PCI enumeration maps the dwords of the configuration space onto its |
| 198 | internal register views with `repr(C)`. Previously, the mapping relied on |
| 199 | the compiler happening to keep the declaration order of those fields. |
| 200 | |
| 201 | ## Removed |
| 202 | |
| 203 | |
| 204 | # uefi - v0.39.0 (2026-07-11) |
| 205 | |
| 206 | ## Added |
| 207 | - Added `driver::{Driver, install}` to streamline driver development. |
| 208 | - Added `proto::dma::iommu::Iommu` for IOMMU-based DMA buffer management. |
| 209 | |
| 210 | |
| 211 | # uefi - v0.38.0 (2026-06-21) |
| 212 | |
| 213 | ## Added |
| 214 | - Added `proto::console::text::InputEx`. |
| 215 | - Added `proto::pci::PciRootBridgeIo::{supported_attributes(), attributes(), |
| 216 | set_attributes(), set_attributes_with_range()}` |
| 217 | - Added `memory()` and `io()` address space access to `PciRootBridgeIo` |
| 218 | protocol. |
| 219 | |
| 220 | ## Changed |
| 221 | - MSRV increased from 1.88 to 1.91. |
| 222 | - **Breaking:** The variants of `TimerTrigger` now hold a `Duration` |
| 223 | - **Breaking:** The `driver_image` parameter of `boot::connect_controller` is |
| 224 | now a `None`-terminated slice. Callers that previously passed `None` for this |
| 225 | argument should pass in `&[]` instead. |
| 226 | - **Breaking:** Corrected function signature of `boot::exit` to enable handling |
| 227 | errors during exit. |
| 228 | - **Breaking:** Renamed `PciIoAccessPci` to `PciIoAccess` and added a generic |
| 229 | parameter to handle the PCI configuration, IO port, and MMIO address spaces. |
| 230 | - **Breaking:** Replace `ArpEntry`, `DhcpV4Flags`, `DhcpV4Packet`, |
| 231 | `DhcpV6Packet`, `IcmpError`, `IcmpErrorEcho`, `IcmpErrorUnion`, `IpFilter`, |
| 232 | `MtftpInfo`, `Packet`, `RouteEntry`, `Server`, and `TftpError` with re-exports |
| 233 | from `uefi-raw`. |
| 234 | - **Breaking:** Changed `ArpEntry` and `RouteEntry` to fix incorrect slicing in |
| 235 | `proto::network::pxe::Mode::{arp_cache(), route_table()}`. |
| 236 | - **Breaking:** Changed `Server::ty` to `Server::server_type`. |
| 237 | - **Breaking:** Changed `TftpError::error_string` from `[u8; 127]` to `[Char8; 127]`. |
| 238 | |
| 239 | ## Removed |
| 240 | - **Breaking:** Removed the deprecated `table::cfg::*_GUID` constants. Use |
| 241 | the matching `ConfigTableEntry::*_GUID` constants instead. |
| 242 | - **Breaking:** Removed the deprecated `VariableKey::name()` method. Use the |
| 243 | public `VariableKey::name` field instead. |
| 244 | |
| 245 | # uefi - v0.37.0 (2026-03-22) |
| 246 | |
| 247 | ## Added |
| 248 | - Added `proto::ata::AtaRequestBuilder::read_pio()`. |
| 249 | - Added `proto::shell::Shell::{var(), set_var(), vars()}` |
| 250 | - Added `proto::pci::root_bridge::PciRootBridgeIo::configuration()`. |
| 251 | - Added `proto::pci::root_bridge::PciRootBridgeIo::enumerate()`. |
| 252 | - Added `proto::nvme::pass_thru::NvmePassThru::broadcast()`. |
| 253 | - Added `proto::media::block::BlockIO2`. |
| 254 | - Added `proto::device_path::DevicePath::to_pool()`. |
| 255 | - Added `proto::device_path::DevicePathUtilities::duplicate_path()`. |
| 256 | - Added `proto::pci::enumeration::PciTree::device_path()`. |
| 257 | - Added `revision()` and `device_type_guid()` to `Serial` protocol |
| 258 | - Implemented `Display` for `DevicePath`, `DevicePathNode` and `ScopedProtocol`, |
| 259 | enabling an easy and convenient way to visualize a device path. For example, |
| 260 | this may print `PciRoot(0x0)/Pci(0x6,0x0)/MAC(525400000001,0x1)`. |
| 261 | `ScopedProtocol` only implements `Display` if the underlying protocol also |
| 262 | implements `Display`. |
| 263 | - Added `Handle::component_name()` and `Handle::device_path()` to simplify the |
| 264 | common use-case of querying more information about a handle. |
| 265 | - Added `fs::path::Path::join()`. |
| 266 | - Added `Serial::read_exact()` and `Serial::write_exact()` |
| 267 | - `CStr16::from_bytes_with_nul()`: This is especially useful to transform the |
| 268 | retrieved value from a UEFI variable into a UCS2 (CStr16) string. |
| 269 | - Integration of `Time` with `time` crate |
| 270 | - `TryFrom`: `time::PrimitiveDateTime <--> Time` (without timezone) |
| 271 | - `TryFrom`: `time::OffsetDateTime <--> Time` (with timezone) |
| 272 | - Integration of `Time` with `jiff` crate |
| 273 | - `TryFrom`: `jiff::DateTime <--> Time` (without timezone) |
| 274 | - `TryFrom`: `jiff::Zoned <--> Time` (with timezone) |
| 275 | |
| 276 | ## Changed |
| 277 | - export all `text::{input, output}::*` types |
| 278 | - Changed ordering of `proto::pci::PciIoAddress` to (bus -> dev -> fun -> reg -> ext_reg). |
| 279 | - Return request with status as error data object for `proto::ata::pass_thru::AtaDevice`. |
| 280 | - **Breaking:** `SimpleNetwork::wait_for_packet` |
| 281 | - has been renamed to `wait_for_packet_event` |
| 282 | - now returns `Result<Event>` instead of `&Event` |
| 283 | - **Breaking:** `Http::get_mode_data` doesn't consume a parameter anymore and instead return |
| 284 | an owned value of type `HttpConfigData` |
| 285 | - `Input::wait_for_key_event()` now returns `Result<Event>` rather than an |
| 286 | Option. |
| 287 | - `Pointer::wait_for_input_event()` now returns `Result<Event>` rather than an |
| 288 | Option. |
| 289 | - **Breaking:** `boot::check_event` now consumes `&Event` rather than `Event`, removing the |
| 290 | need for unnecessary `Event::unsafe_clone()`s. |
| 291 | - MSRV increased to 1.88. |
| 292 | - **Breaking:** Renamed `DevicePath::to_string()` to `DevicePath::to_string16()` |
| 293 | to better differentiate with the new `to_string()` coming from the new |
| 294 | `Display`. |
| 295 | - **Breaking:** Renamed `DevicePathNode::to_string()` to `DevicePathNode::to_string16()` |
| 296 | to better differentiate with the new `to_string()` coming from the new |
| 297 | `Display`. |
| 298 | - Fixed potential partial writes in `fmt::Write` impl for `Serial` protocol |
| 299 | |
| 300 | # uefi - v0.36.1 (2025-11-05) |
| 301 | |
| 302 | - Fixing build on <https://docs.rs/uefi> |
| 303 | |
| 304 | |
| 305 | # uefi - v0.36 (2025-10-21) |
| 306 | |
| 307 | ## Added |
| 308 | - Added `ConfigTableEntry::MEMORY_ATTRIBUTES_GUID` and `ConfigTableEntry::IMAGE_SECURITY_DATABASE_GUID`. |
| 309 | - Added `proto::usb::io::UsbIo`. |
| 310 | - Added `proto::pci::PciRootBridgeIo`. |
| 311 | - Added `proto::hii::config::ConfigKeywordHandler`. |
| 312 | - Added `proto::hii::config::HiiConfigAccess`. |
| 313 | - Added `proto::hii::config_str::ConfigurationString`. |
| 314 | - Added `proto::acpi::AcpiTable`. |
| 315 | - Added `proto::hii::database::HiiDatabase`. |
| 316 | - Added `proto::hii::config_str::MultiConfigurationStringIter`. |
| 317 | - Added `proto::hii::config_routing::HiiConfigRouting`. |
| 318 | |
| 319 | ## Changed |
| 320 | - **Breaking:** `boot::stall` now take `core::time::Duration` instead of `usize`. |
| 321 | - `table::cfg::*_GUID` constants now deprecated. Use `ConfigTableEntry::*_GUID` instead. |
| 322 | - `system::with_config_table`, `system::with_stdin`, `system::with_stdout` and `system::with_stderr` |
| 323 | now take mutably closure. |
| 324 | - **Breaking:** The MSRV is now 1.85.1 and the crate uses the Rust 2024 edition. |
| 325 | - **Breaking:** All public APIs related to networking now use |
| 326 | `core::net::{IpAddr, Ipv4Addr, Ipv6Addr}`, i.e., the types from the standard |
| 327 | library. |
| 328 | - This especially affects the SNP and PXE protocols |
| 329 | - The new design makes writing network code much simpler. |
| 330 | - **Breaking:** Removed type `IpAddress`. In case you still need a low-level |
| 331 | EFI compatible type please use `IpAddress` from `uefi-raw`. |
| 332 | - The documentation in `lib.rs` now provides guidance on how to select features |
| 333 | tailored to your use case. |
| 334 | - Feature `log-debugcon` is no longer a default feature. You only need to add |
| 335 | it in case you are also using the `logger` feature and if you run your UEFI |
| 336 | image in QEMU or Cloud Hypervisor, when the debugcon/debug-console device is |
| 337 | available. |
| 338 | - The documentation for UEFI protocols has been streamlined and improved. |
| 339 | - Fixed memory safety bug in `SimpleNetwork::read_nv_data`. The `buffer` |
| 340 | parameter is now mutable. |
| 341 | - Removed all internal usages including public APIs using the unstable |
| 342 | `allocator_api` feature. It may be reintroduced if it will have a chance of |
| 343 | getting stabilized in stable Rust. |
| 344 | - Removed `File::get_boxed_info_in` |
| 345 | - Removed `Directory::read_entry_boxed_in` |
| 346 | |
| 347 | |
| 348 | # uefi - 0.35.0 (2025-05-04) |
| 349 | |
| 350 | ## Added |
| 351 | - Added `boot::signal_event`. |
| 352 | - Added conversions between `proto::network::IpAddress` and `core::net` types. |
| 353 | - Added conversions between `proto::network::MacAddress` and the `[u8; 6]` type that's more commonly used to represent MAC addresses. |
| 354 | - Added `proto::media::disk_info::DiskInfo`. |
| 355 | - Added `mem::AlignedBuffer`. |
| 356 | - Added `proto::device_path::DevicePath::append_path()`. |
| 357 | - Added `proto::device_path::DevicePath::append_node()`. |
| 358 | - Added `proto::scsi::pass_thru::ExtScsiPassThru`. |
| 359 | - Added `proto::nvme::pass_thru::NvmePassThru`. |
| 360 | - Added `proto::ata::pass_thru::AtaPassThru`. |
| 361 | - Added `boot::ScopedProtocol::open_params()`. |
| 362 | - Added `boot::TplGuard::old_tpl()`. |
| 363 | - Added `boot::calculate_crc32()`. |
| 364 | |
| 365 | ## Changed |
| 366 | - **Breaking:** Removed `BootPolicyError` as `BootPolicy` construction is no |
| 367 | longer fallible. `BootPolicy` now tightly integrates the new `Boolean` type |
| 368 | of `uefi-raw`. |
| 369 | - **Breaking:** The `pxe::BaseCode::tftp_read_dir` and |
| 370 | `pxe::BaseCode::mtftp_read_dir` methods now take `&mut self` instead of |
| 371 | `&self`. |
| 372 | - **Breaking:** The `pxe::Mode` struct is now opaque. Use method calls to access |
| 373 | mode data instead of direct field access. |
| 374 | - **Breaking:** `PoolDevicePathNode` and `PoolDevicePath` moved from module |
| 375 | `proto::device_path::text` to `proto::device_path`. |
| 376 | - **Breaking:** `exit_boot_services` now consumes a `Option<MemoryType>` which |
| 377 | defaults to the recommended value of `MemoryType::LOADER_DATA`. |
| 378 | - **Breaking:** Removed duplication in `DevicePathHeader`. Instead of public fields, |
| 379 | there is now a public constructor combined with public getters. |
| 380 | - `boot::memory_map()` will never return `Status::BUFFER_TOO_SMALL` from now on, |
| 381 | as this is considered a hard internal error where users can't do anything |
| 382 | about it anyway. It will panic instead. |
| 383 | - `SimpleNetwork::transmit` now passes the correct buffer size argument. |
| 384 | Previously it incorrectly added the header size to the buffer length, which |
| 385 | could cause the firmware to read past the end of the buffer. |
| 386 | - `boot::allocate_pages` no longer panics if the allocation is at address |
| 387 | zero. The allocation is retried instead, and in all failure cases an error is |
| 388 | returned rather than panicking. |
| 389 | - The `Display` impl for `CStr8` now excludes the trailing null character. |
| 390 | - `VariableKeys` initializes with a larger name buffer to work around firmware |
| 391 | bugs on some devices. |
| 392 | - The UEFI `allocator::Allocator` has been optimized for page-aligned |
| 393 | allocations. |
| 394 | |
| 395 | |
| 396 | # uefi - 0.34.1 (2025-02-07) |
| 397 | |
| 398 | Trivial release to fix crate license documentation. |
| 399 | |
| 400 | |
| 401 | # uefi - 0.34.0 (2025-02-07) |
| 402 | |
| 403 | As of this release, the project has been relicensed from MPL-2.0 to |
| 404 | Apache-2.0/MIT, to better align with the Rust crate ecosystem. (This does not |
| 405 | alter the license of previous releases.) |
| 406 | Details at <https://github.com/rust-osdev/uefi-rs/issues/1470>. |
| 407 | |
| 408 | ## Added |
| 409 | - Added `proto::device_path::PoolDevicePath` and |
| 410 | `proto::device_path::PoolDevicePathNode`. |
| 411 | |
| 412 | ## Changed |
| 413 | - MSRV increased to 1.81. |
| 414 | - `core::error::Error` impls are no longer gated by the `unstable` feature. |
| 415 | - Fixed missing checks in the `TryFrom` conversion from `&DevicePathNode` to |
| 416 | specific node types. The node type and subtype are now checked, and |
| 417 | `NodeConversionError::DifferentType` is returned if they do not match. |
| 418 | - **Breaking:** Fixed memory leaks in `DevicePathFromText` protocol. The methods |
| 419 | now return wrapper objects that free the device path / device path node on |
| 420 | drop. |
| 421 | |
| 422 | |
| 423 | # uefi - 0.33.0 (2024-10-23) |
| 424 | |
| 425 | See [Deprecating SystemTable/BootServices/RuntimeServices][funcmigrate] for |
| 426 | details of the deprecated items that were removed in this release. |
| 427 | |
| 428 | ## Added |
| 429 | - Impl `PartialEq` and `Eq` for `GptPartitionEntry`. |
| 430 | - Added `CStr16::from_u16_until_nul` and `CStr16::from_char16_until_nul`. |
| 431 | |
| 432 | ## Changed |
| 433 | - **Breaking:** Deleted the deprecated `BootServices`, `RuntimeServices`, and |
| 434 | `SystemTable` structs. |
| 435 | - **Breaking:** Deleted deprecated functions `allocator::init`, |
| 436 | `allocator::exit_boot_services`, `helpers::system_table`, |
| 437 | `table::system_table_boot`, and `table::system_table_runtime`. |
| 438 | - **Breaking:** `FileSystem` no longer has a lifetime parameter, and the |
| 439 | deprecated conversion from `uefi::table::boot::ScopedProtocol` has been |
| 440 | removed. |
| 441 | - Fixed `boot::open_protocol` to properly handle a null interface pointer. |
| 442 | - `VariableKey` now has a public `name` field. This `name` field always contains |
| 443 | a valid string, so the `VariableKey::name()` method has been deprecated. Since |
| 444 | all fields of `VariableKey` are now public, the type can be constructed by |
| 445 | users. |
| 446 | - The `VariableKeys` iterator will now yield an error item if a variable name is |
| 447 | not UCS-2. |
| 448 | |
| 449 | # uefi - 0.32.0 (2024-09-09) |
| 450 | |
| 451 | See [Deprecating SystemTable/BootServices/RuntimeServices][funcmigrate] for |
| 452 | details of the deprecations in this release. |
| 453 | |
| 454 | We added documentation to `lib.rs` and the [uefi-rs book] about how |
| 455 | `uefi` compares to "standard Rust binaries" for UEFI (those using `std`), and |
| 456 | how to integrate the `uefi` crate into them. |
| 457 | |
| 458 | ## Added |
| 459 | - Added `Handle::new`. |
| 460 | - Added the `uefi::boot`, `uefi::runtime`, and `uefi::system` modules to the |
| 461 | prelude. |
| 462 | - Added `runtime::variable_exists`. |
| 463 | |
| 464 | ## Changed |
| 465 | - The `BootServices`, `RuntimeServices`, and `SystemTable` structs have been |
| 466 | deprecated (as well as related types `Boot`, `Runtime`, and |
| 467 | `SystemTableView`). Use the `uefi::boot` and `uefi::runtime`, and |
| 468 | `uefi::system` modules instead. |
| 469 | - In `uefi::table::boot`, `ScopedProtocol`, `TplGuard`, `ProtocolsPerHandle`, |
| 470 | and `HandleBuffer` have been deprecated. Use the structs of the same name in |
| 471 | `uefi::boot` instead. |
| 472 | - `uefi::table::system_table_boot` and `uefi::table::system_table_runtime` have |
| 473 | been deprecated. Use the `uefi::runtime` and `uefi::boot` modules instead. |
| 474 | - **Breaking:** The conversion functions between device paths and text no longer |
| 475 | take a `BootServices` argument. The global system table is used instead. |
| 476 | - **Breaking:** `GraphicsOutput::modes` no longer takes a `BootServices` |
| 477 | argument. The global system table is used instead. |
| 478 | - **Breaking:** `ComponentName::open` no longer takes a `BootServices` |
| 479 | argument. The global system table is used instead. |
| 480 | - `allocator::init` and `allocator::exit_boot_services` have been |
| 481 | deprecated. These functions are now no-ops. The allocator now internally uses |
| 482 | the global system table. |
| 483 | - `FileSystem::new` now accepts `boot::ScopedProtocol` in addition to |
| 484 | `table::boot::ScopedProtocol`. |
| 485 | |
| 486 | |
| 487 | # uefi - 0.31.0 (2024-08-21) |
| 488 | |
| 489 | See [Deprecating SystemTable/BootServices/RuntimeServices][funcmigrate] for |
| 490 | details of the new `system`/`boot`/`runtime` modules, and upcoming deprecations. |
| 491 | |
| 492 | ## Added |
| 493 | - `uefi::system` is a new module that provides freestanding functions for |
| 494 | accessing fields of the global system table. |
| 495 | - `uefi::boot` is a new module that provides freestanding functions for |
| 496 | boot services using the global system table. |
| 497 | - `uefi::runtime` is a new module that provides freestanding functions for |
| 498 | runtime services using the global system table. |
| 499 | - `uefi::table::system_table_raw` is a new function to retrieve a raw pointer to |
| 500 | the global system table. |
| 501 | - Add standard derives for `ConfigTableEntry`. |
| 502 | - `PcrEvent`/`PcrEventInputs` impl `Align`, `Eq`, and `PartialEq`. |
| 503 | - Added `PcrEvent::new_in_box` and `PcrEventInputs::new_in_box`. |
| 504 | - `VariableKey` impls `Clone`, `Eq`, `PartialEq`, `Ord`, `PartialOrd`, and `Hash`. |
| 505 | - The traits `MemoryMap` and `MemoryMapMut` have been introduced together with |
| 506 | the implementations `MemoryMapRef`, `MemoryMapRefMut`, and `MemoryMapOwned`. |
| 507 | This comes with some changes. Read below. We recommend to directly use the |
| 508 | implementations instead of the traits. |
| 509 | - Added `LoadFile` and `LoadFile2` which abstracts over the `LOAD_FILE` and |
| 510 | `LOAD_FILE2` protocols. The UEFI test runner includes an integration test |
| 511 | that shows how Linux loaders can use this to implement the initrd loading |
| 512 | mechanism used in Linux. |
| 513 | |
| 514 | ## Changed |
| 515 | - **Breaking:** `uefi::helpers::init` no longer takes an argument. |
| 516 | - The lifetime of the `SearchType` returned from |
| 517 | `BootServices::register_protocol_notify` is now tied to the protocol GUID. |
| 518 | The old `MemoryMap` was renamed to `MemoryMapOwned`. |
| 519 | - `pub fn memory_map(&self, mt: MemoryType) -> Result<MemoryMap>` now returns |
| 520 | a `MemoryMapOwned`. |
| 521 | - **Breaking:** `PcrEvent::new_in_buffer` and `PcrEventInputs::new_in_buffer` |
| 522 | now take an initialized buffer (`[u8`] instead of `[MaybeUninit<u8>]`), and if |
| 523 | the buffer is too small the required size is returned in the error data. |
| 524 | - **Breaking:** The type `MemoryMap` was renamed to `MemoryMapOwned`. `MemoryMap` |
| 525 | is now a trait. Read the [documentation](https://docs.rs/uefi/latest/uefi/) of the |
| 526 | `uefi > mem > memory_map` module to learn more. |
| 527 | - **Breaking:** Exports of Memory Map-related types from `uefi::table::boot` are |
| 528 | now removed. Use `uefi::mem::memory_map` instead. The patch you have to apply |
| 529 | to the `use` statements of your code might look as follows: |
| 530 | ```diff |
| 531 | < use uefi::table::boot::{BootServices, MemoryMap, MemoryMapMut, MemoryType}; |
| 532 | --- |
| 533 | > use uefi::mem::memory_map::{MemoryMap, MemoryMapMut, MemoryType}; |
| 534 | > use uefi::table::boot::BootServices; |
| 535 | ``` |
| 536 | - **Breaking:** Added a new `BootPolicy` type which breaks existing usages |
| 537 | of `LoadImageSource`. |
| 538 | |
| 539 | [funcmigrate]: ../docs/funcs_migration.md |
| 540 | |
| 541 | # uefi - 0.30.0 (2024-08-02) |
| 542 | |
| 543 | ## Changed |
| 544 | - **Breaking:**: Fixed a bug in the impls of `TryFrom<&[u8]>` for |
| 545 | `&DevicePathHeader`, `&DevicePathNode` and `&DevicePath` that could lead to |
| 546 | memory unsafety. See <https://github.com/rust-osdev/uefi-rs/issues/1281>. |
| 547 | |
| 548 | |
| 549 | # uefi - 0.29.0 (2024-07-02) |
| 550 | |
| 551 | ## Added |
| 552 | - Added `RuntimeServices::update_capsule`. |
| 553 | - Added `RuntimeServices::query_capsule_capabilities`. |
| 554 | - The logger from `uefi::helpers` now also logs to the [debugcon](https://phip1611.de/blog/how-to-use-qemus-debugcon-feature/) |
| 555 | device (QEMU) respectively the debug-console (cloud-hypervisor). This only |
| 556 | works on x86. It is activated by default (only on x86) and can be deactivated |
| 557 | by removing the `log-debugcon` cargo feature. The major benefit is that one |
| 558 | can get log messages even after one exited the boot services. |
| 559 | - Added `table::{set_system_table, system_table_boot, system_table_runtime}`. |
| 560 | This provides an initial API for global tables that do not require passing |
| 561 | around a reference. |
| 562 | - Added `ResetNotification` protocol. |
| 563 | - Added `TryFrom<&[u8]>` for `DevicePathHeader`, `DevicePathNode` and `DevicePath`. |
| 564 | - Added `ByteConversionError`. |
| 565 | - Re-exported `CapsuleFlags`. |
| 566 | - One can now specify in `TimeError` what fields of `Time` are outside its valid |
| 567 | range. `Time::is_valid` has been updated accordingly. |
| 568 | - `MemoryMap::as_raw` which provides raw access to the memory map. This is for |
| 569 | example useful if you create your own Multiboot2 bootloader that embeds the |
| 570 | EFI mmap in a Multiboot2 boot information structure. |
| 571 | - `Mode` is now `Copy` and `Clone`. |
| 572 | - Added `TryFrom<&[u8]>` for `Time`. |
| 573 | |
| 574 | ## Changed |
| 575 | - `SystemTable::exit_boot_services` is now `unsafe`. See that method's |
| 576 | documentation for details of obligations for callers. |
| 577 | - `BootServices::allocate_pool` now returns `NonZero<u8>` instead of |
| 578 | `*mut u8`. |
| 579 | - `helpers::system_table` is deprecated, use `table::system_table_boot` instead. |
| 580 | - `BootServices::memory_map` changed its signature from \ |
| 581 | `pub fn memory_map<'buf>(&self, buffer: &'buf mut [u8]) -> Result<MemoryMap<'buf>> {` \ |
| 582 | to \ |
| 583 | `pub fn memory_map(&self, mt: MemoryType) -> Result<MemoryMap>` |
| 584 | - Allocations now happen automatically internally on the UEFI heap. Also, the |
| 585 | returned type is automatically freed on the UEFI heap, as long as boot |
| 586 | services are not excited. By removing the need for that explicit buffer and |
| 587 | the lifetime, the API is simpler. |
| 588 | - `GraphicsOutput::query_mode` is now private. Use `GraphicsOutput::modes` |
| 589 | instead. |
| 590 | |
| 591 | ## Removed |
| 592 | - Removed the `panic-on-logger-errors` feature of the `uefi` crate. Logger |
| 593 | errors are now silently ignored. |
| 594 | |
| 595 | |
| 596 | # uefi - 0.28.0 (2024-04-19) |
| 597 | |
| 598 | ## Added |
| 599 | - Added `Timestamp` protocol. |
| 600 | - Added `UnalignedSlice::as_ptr`. |
| 601 | - Added common derives for `Event` and `Handle`. |
| 602 | - `uefi::helpers::init` with the functionality that used to be in |
| 603 | `uefi::services`. With that, new features were added: |
| 604 | - `global_allocator` |
| 605 | - `panic_handler` |
| 606 | - `qemu` |
| 607 | |
| 608 | |
| 609 | # uefi - 0.27.0 (2024-03-17) |
| 610 | |
| 611 | ## Added |
| 612 | - Implemented `PartialEq<char>` for `Char8` and `Char16`. |
| 613 | - Added `CStr16::from_char16_with_nul` and `Char16::from_char16_with_nul_unchecked`. |
| 614 | - Added terminal GUID constants to `device_path::messaging::Vendor`. |
| 615 | - Added `MemoryMap::from_raw`. |
| 616 | - Implemented `Hash` for all char and string types. |
| 617 | |
| 618 | ## Changed |
| 619 | - `DevicePath::to_string` and `DevicePathNode::to_string` now return |
| 620 | out-of-memory errors as part of the error type rather than with an `Option`. |
| 621 | |
| 622 | |
| 623 | # uefi - 0.26.0 (2023-11-12) |
| 624 | |
| 625 | ## Added |
| 626 | - Implemented `Index`, `IndexMut`, `get`, and `get_mut` on `MemoryMap`. |
| 627 | - Added `SystemTable::as_ptr`. |
| 628 | |
| 629 | ## Changed |
| 630 | - We fixed a memory leak in `GraphicsOutput::query_mode`. As a consequence, we |
| 631 | had to add `&BootServices` as additional parameter. |
| 632 | - `BootServices::free_pages` and `BootServices::free_pool` are now `unsafe` to |
| 633 | call, since it is possible to trigger UB by freeing memory that is still in use. |
| 634 | - `Logger` no longer requires exterior mutability. `Logger::new` is now `const`, |
| 635 | takes no arguments, and creates the logger in a disabled state. Call |
| 636 | `Logger::set_output` to enable it. |
| 637 | - `uefi::allocator::init` now takes a `&mut SystemTable<Boot>` instead of |
| 638 | `&BootServices`. |
| 639 | - `BootServices::{install,reinstall,uninstall}_protocol_interface` now take |
| 640 | `const` interface pointers. |
| 641 | |
| 642 | |
| 643 | # uefi - 0.25.0 (2023-10-10) |
| 644 | |
| 645 | ## Changed |
| 646 | - MSRV bumped to 1.70. |
| 647 | - `Input::wait_for_key_event` now returns an `Option<Event>`, and is no longer `const`. |
| 648 | - `Protocol::wait_for_input_event` now returns an `Option<Event>`, and is no longer `const`. |
| 649 | - `LoadedImage::device` now returns an `Option<Handle>` and is no longer `const`. |
| 650 | - `BootServices::get_image_file_system` now returns |
| 651 | `ScopedProtocol<SimpleFileSystem>` instead of `fs::FileSystem`. |
| 652 | - `uefi::proto::shim` is now available on 32-bit x86 targets. |
| 653 | - `Parity` and `StopBits` are now a newtype-enums instead of Rust enums. Their |
| 654 | members now have upper-case names. |
| 655 | - `FileSystem::try_exists` now returns `FileSystemResult<bool>`. |
| 656 | - `FileSystem::copy` is now more efficient for large files. |
| 657 | - `MpService::startup_all_aps` and `MpService::startup_this_ap` now accept an |
| 658 | optional `event` parameter to allow non-blocking operation. |
| 659 | - Added `core::error::Error` implementations to all error types. |
| 660 | - `SystemTable::exit_boot_services` now takes one param `memory_type` to ensure |
| 661 | the memory type of memory map. |
| 662 | - Added the `ShellParams` protocol |
| 663 | |
| 664 | ## Removed |
| 665 | - `BootServices::memmove` and `BootServices::set_mem` have been removed, use |
| 666 | standard functions like `core::ptr::copy` and `core::ptr::write_bytes` instead. |
| 667 | |
| 668 | |
| 669 | # uefi - 0.24.0 (2023-06-20) |
| 670 | |
| 671 | ## Added |
| 672 | - `DevicePath::to_boxed`, `DevicePath::to_owned`, and `DevicePath::as_bytes` |
| 673 | - `DevicePathInstance::to_boxed`, `DevicePathInstance::to_owned`, and `DevicePathInstance::as_bytes` |
| 674 | - `DevicePathNode::data` |
| 675 | - Added `Event::from_ptr`, `Event::as_ptr`, and `Handle::as_ptr`. |
| 676 | - Added `ScopedProtocol::get` and `ScopedProtocol::get_mut` to access |
| 677 | potentially-null interfaces without panicking. |
| 678 | - `DevicePath::to_string` and `DevicePathNode::to_string` |
| 679 | |
| 680 | ## Changed |
| 681 | - Renamed `LoadImageSource::FromFilePath` to `LoadImageSource::FromDevicePath` |
| 682 | - The `Deref` and `DerefMut` impls for `ScopedProtocol` will now panic if the |
| 683 | interface pointer is null. |
| 684 | |
| 685 | |
| 686 | # uefi - 0.23.0 (2023-06-04) |
| 687 | |
| 688 | ## Changed |
| 689 | - Fixed function signature bug in `BootServices::install_configuration_table`. |
| 690 | |
| 691 | |
| 692 | # uefi - 0.22.0 (2023-06-01) |
| 693 | |
| 694 | ## Added |
| 695 | - Added `BootServices::install_configuration_table`. |
| 696 | |
| 697 | ## Changed |
| 698 | - Renamed `FileSystemIOErrorContext` to `IoErrorContext`. |
| 699 | - `ResetType` is now a newtype-enum instead of a Rust enum. Its members now have |
| 700 | upper-case names. |
| 701 | - `PointerMode` and `PointerState` now contain arrays rather than tuples, as |
| 702 | tuples are not FFI safe. |
| 703 | - `RegularFile::read` no longer returns `Option<usize>` in error data. A |
| 704 | `BUFFER_TOO_SMALL` error can only occur when reading a directory, not a file. |
| 705 | - `RegularFile::read` now reads in 1 MiB chunks to avoid a bug in some |
| 706 | firmware. This fix also applies to `fs::FileSystem::read`. |
| 707 | |
| 708 | |
| 709 | # uefi - 0.21.0 (2023-05-15) |
| 710 | |
| 711 | ## Added |
| 712 | - There is a new `fs` module that provides a high-level API for file-system |
| 713 | access. The API is close to the `std::fs` module. The module also provides a |
| 714 | `Path` and a `PathBuf` abstraction that is similar to the ones from |
| 715 | `std::path`. However, they are adapted for UEFI. |
| 716 | - Multiple convenience methods for `CString16` and `CStr16`, including: |
| 717 | - `CStr16::as_slice()` |
| 718 | - `CStr16::num_chars()` |
| 719 | - `CStr16::is_empty()` |
| 720 | - `CString16::new()` |
| 721 | - `CString16::is_empty()` |
| 722 | - `CString16::num_chars()` |
| 723 | - `CString16::replace_char()` |
| 724 | - `CString16::push()` |
| 725 | - `CString16::push_str()` |
| 726 | - `From<&CStr16>` for `CString16` |
| 727 | - `From<&CStr16>` for `String` |
| 728 | - `From<&CString16>` for `String` |
| 729 | - Added `RuntimeServices::get_variable_boxed` (requires the `alloc` feature). |
| 730 | - Added `CStr16::as_bytes` |
| 731 | - Added `AsRef<[u8]>` and `Borrow<[u8]>` for `Cstr8` and `CStr16`. |
| 732 | - Added `LoadedImageDevicePath` protocol. |
| 733 | - Added `FileAttribute::is_directory(&self)` and |
| 734 | `FileAttribute::is_regular_file(&self)` |
| 735 | - Added `LoadedImage::code_type()` and `LoadedImage::data_type()` |
| 736 | - `Allocator` will now use the memory type of the running UEFI binary: |
| 737 | - `MemoryType::LOADER_DATA` for UEFI applications |
| 738 | - `MemoryType::BOOT_SERVICES_DATA` for UEFI boot drivers |
| 739 | - `MemoryType::RUNTIME_SERVICES_DATA` for UEFI runtime drivers |
| 740 | |
| 741 | ## Changed |
| 742 | - The `global_allocator` module has been renamed to `allocator`, and is now |
| 743 | available regardless of whether the `global_allocator` feature is enabled. The |
| 744 | `global_allocator` feature now only controls whether `allocator::Allocator` is |
| 745 | set as Rust's global allocator. |
| 746 | - `Error::new` and `Error::from` now panic if the status is `SUCCESS`. |
| 747 | - `Image::get_image_file_system` now returns a `fs::FileSystem` instead of the |
| 748 | protocol. |
| 749 | - `CString16::default` now always contains a null character. |
| 750 | - Conversion from `Status` to `Result` has been reworked. The `into_with`, |
| 751 | `into_with_val`, and `into_with_err` methods have been removed from |
| 752 | `Status`. `impl From<Status> for Result` has also been removed. A new |
| 753 | `StatusExt` trait has been added that provides conversion methods to replace |
| 754 | the ones that have been removed. `StatusExt` has been added to the prelude. |
| 755 | - The `Guid` struct and `guid!` macro implementations have been replaced with |
| 756 | re-exports from the [`uguid`](https://docs.rs/uguid) crate. The `from_values` |
| 757 | method has been removed; usually the `guid!` macro is a more convenient |
| 758 | choice, but `new` or `from_bytes` can also be used if needed. There are also a |
| 759 | number of new `Guid` methods. |
| 760 | - The `MEMORY_DESCRIPTOR_VERSION` constant has been moved to |
| 761 | `MemoryDescriptor::VERSION`. |
| 762 | - The `Revision` struct's one field is now public. |
| 763 | - Renamed `CStr8::to_bytes` to `CStr8::as_bytes` and changed the semantics: |
| 764 | The trailing null character is now always included in the returned slice. |
| 765 | - `DevicePathBuilder::with_vec` now clears the `Vec` before use. |
| 766 | - `bitflags` bumped from `1.3` to `2.1` |
| 767 | - `GptPartitionAttributes` now has 16 additional `TYPE_SPECIFIC_BIT_<N>` |
| 768 | constants. |
| 769 | |
| 770 | |
| 771 | # uefi - 0.20.0 (2023-03-19) |
| 772 | |
| 773 | As of this release, the UEFI crates work on the stable channel. This requires |
| 774 | Rust 1.68 or higher. |
| 775 | |
| 776 | ## Added |
| 777 | - Added the `ComponentName1` and `ComponentName2` protocols. The `ComponentName` |
| 778 | wrapper will automatically select `ComponentName2` if available, and fall back |
| 779 | to `ComponentName1` otherwise. |
| 780 | - `FileType`, `FileHandle`, `RegularFile`, and `Directory` now implement `Debug`. |
| 781 | - Added `RuntimeServices::delete_variable()` helper method. |
| 782 | - Implement `Borrow` for `CString16` and `ToOwned` for `CStr16`. |
| 783 | - Every public struct now implements `Debug`. Exceptions are cases when there |
| 784 | is no sensible way of presenting a useful Debug representation, such as for |
| 785 | Unions. |
| 786 | |
| 787 | ## Changed |
| 788 | - `SystemTable::exit_boot_services` now takes no parameters and handles |
| 789 | the memory map allocation itself. Errors are now treated as |
| 790 | unrecoverable and will cause the system to reset. |
| 791 | - Re-export the `cstr8`, `cstr16`, and `entry` macros from the root of the |
| 792 | `uefi` crate. |
| 793 | - `HandleBuffer` and `ProtocolsPerHandle` now implement `Deref`. The |
| 794 | `HandleBuffer::handles` and `ProtocolsPerHandle::protocols` methods have been |
| 795 | deprecated. |
| 796 | - Removed `'boot` lifetime from the `GraphicsOutput`, `Output`, `Pointer`, and |
| 797 | `Serial` protocols. |
| 798 | - The generic type `Data` of `uefi::Error<Data: Debug>` doesn't need to be |
| 799 | `Display` to be compatible with `core::error::Error`. Note that the error |
| 800 | Trait requires the `unstable` feature. |
| 801 | - deprecation removals: |
| 802 | - interfaces `BootServices::locate_protocol` and |
| 803 | `BootServices::handle_protocol` were removed. `BootServices::open_protocol` |
| 804 | and `BootServices::open_protocol_exclusive` are better variants and |
| 805 | available since EFI 1.10 (2002). |
| 806 | - `ScopedProtocol::interface` is not public anymore. Use the `Deref` trait. |
| 807 | |
| 808 | |
| 809 | # uefi - 0.19.1 (2023-02-04) |
| 810 | |
| 811 | ## Added |
| 812 | - Added `table::boot::PAGE_SIZE` constant. |
| 813 | |
| 814 | ## Changed |
| 815 | - Fixed several protocol functions so that they work with unsized protocols |
| 816 | (like `DevicePath`): `BootServices::locate_device_path`, |
| 817 | `BootServices::get_handle_for_protocol`, `BootServices::test_protocol`, |
| 818 | `BootServices::find_handles`, and `SearchType::from_proto`. |
| 819 | - Fixed a warning printed when using `uefi` as a dependency: "the following |
| 820 | packages contain code that will be rejected by a future version". |
| 821 | |
| 822 | |
| 823 | # uefi - 0.19.0 (2023-01-16) |
| 824 | |
| 825 | ## Added |
| 826 | - Implementations for the trait `EqStrUntilNul` now allow `?Sized` inputs. This means that |
| 827 | you can write `some_cstr16.eq_str_until_nul("test")` instead of |
| 828 | `some_cstr16.eq_str_until_nul(&"test")` now. |
| 829 | - Added `TryFrom<core::ffi::CStr>` implementation for `CStr8`. |
| 830 | - Added `Directory::read_entry_boxed` which works similar to `File::get_boxed_info`. This allows |
| 831 | easier iteration over the entries in a directory. (requires the **alloc** feature) |
| 832 | - Added `Directory::read_entry_boxed_in` and `File::get_boxed_info_in` that use the `allocator_api` |
| 833 | feature. (requires the **unstable** and **alloc** features) |
| 834 | - Added an `core::error::Error` implementation for `Error` to ease |
| 835 | integration with error-handling crates. (requires the **unstable** feature) |
| 836 | - Added partial support for the TCG protocols for TPM devices under `uefi::proto::tcg`. |
| 837 | |
| 838 | ## Changed |
| 839 | - `UnalignedSlice` now implements `Clone`, and the `Debug` impl now |
| 840 | prints the elements instead of the internal fields. |
| 841 | - The unstable `negative_impls` feature is no longer required to use this library. |
| 842 | - `BootServices::memory_map()` now returns `MemoryMapIter` instead of |
| 843 | `impl Iterator` which simplifies usage. |
| 844 | - `BootServices::exit_boot_services()` now returns `MemoryMapIter` instead of |
| 845 | `impl Iterator` which simplifies usage. |
| 846 | - `GraphicsOutput::modes()` now returns `ModesIter` instead of `impl Iterator` |
| 847 | which simplifies usage. |
| 848 | - Use of the unstable `ptr_metadata` feature has been replaced with a dependency |
| 849 | on the [`ptr_meta`](https://docs.rs/ptr_meta) crate. |
| 850 | - `pxe::DiscoverInfo` is now a DST. Create with `new_in_buffer` by supplying a |
| 851 | `MaybeUninit<u8>` slice of appropriate length. |
| 852 | - Redundant private field used for padding in `MemoryDescriptor` structure was removed. Now all |
| 853 | fields of this struct are public. |
| 854 | |
| 855 | |
| 856 | # uefi - 0.18.0 (2022-11-15) |
| 857 | |
| 858 | ## Added |
| 859 | - Added `PhysicalAddress` and `VirtualAddress` type aliases. |
| 860 | - Added `Guid::from_bytes` and `Guid::to_bytes`. |
| 861 | - Added `UnalignedSlice` for representing a reference to an unaligned |
| 862 | slice. |
| 863 | - Added `DeviceSubType::MESSAGING_REST_SERVICE` and |
| 864 | `DeviceSubType::MESSAGING_NVME_OF_NAMESPACE`. |
| 865 | - Added `MemoryAttribute::SPECIAL_PURPOSE`, `MemoryAttribute::CPU_CRYPTO`, |
| 866 | `MemoryAttribute::ISA_VALID`, and `MemoryAttribute::ISA_MASK`. |
| 867 | - Added the `UnicodeCollation` protocol |
| 868 | - Added structs to represent each type of device path node. All node |
| 869 | types specified in the UEFI 2.10 Specification are now supported. |
| 870 | - Added `DevicePathBuilder` for building new device paths. |
| 871 | - Added `BootServices::install_protocol_interface`, |
| 872 | `BootServices::uninstall_protocol_interface`, and |
| 873 | `BootServices::reinstall_protocol_interface`. |
| 874 | - Added `BootServices::register_protocol_notify`. |
| 875 | - Added `SearchType::ByRegisterNotify`and `ProtocolSearchKey`. |
| 876 | |
| 877 | ## Changed |
| 878 | - Renamed crate feature `alloc` to `global_allocator`. |
| 879 | - Renamed crate feature `exts` to `alloc`. |
| 880 | - Fixed the definition of `AllocateType` so that `MaxAddress` and |
| 881 | `Address` always take a 64-bit value, regardless of target platform. |
| 882 | - The conversion methods on `DevicePathToText` and `DevicePathFromText` |
| 883 | now return a `uefi::Result` instead of an `Option`. |
| 884 | - `Event` is now a newtype around `NonNull<c_void>` instead of `*mut c_void`. |
| 885 | - Changed `SystemTable::firmware_revision` to return a `u32` instead of |
| 886 | a `Revision`. The firmware revision's format is vendor specific and |
| 887 | may not have the same semantics as the UEFI revision. |
| 888 | - Changed `Revision` to `repr(transparent)`. |
| 889 | - Add `Revision::EFI_2_100` constant. |
| 890 | - The `Revision` type now implements `Display` with correct formatting |
| 891 | for all UEFI versions. The custom `Debug` impl has been removed and |
| 892 | replaced with a derived `Debug` impl. |
| 893 | - `CStr16::from_u16_with_nul_unchecked` and `cstr16!` are now allowed in |
| 894 | `const` contexts. |
| 895 | |
| 896 | ## Removed |
| 897 | - Removed `UnalignedCStr16`; use `UnalignedSlice` instead. An |
| 898 | `UnalignedSlice<u16>` can be converted to a string with `to_cstr16` or |
| 899 | `to_cstring16`. |
| 900 | - Removed `as_file_path_media_device_path` and |
| 901 | `as_hard_drive_media_device_path` from `DevicePathNode`. Use |
| 902 | `DevicePathNode::as_enum` instead. Alternatively, convert with `TryInto`, |
| 903 | e.g. `let node: &proto::device_path::media::HardDrive = node.try_into()?`. |
| 904 | - Removed `AcpiDevicePath` and `HardDriveMediaDevicePath`. Use |
| 905 | `proto::device_path::acpi::Acpi` and |
| 906 | `proto::device_path::media::HardDrive` instead. ` |
| 907 | |
| 908 | |
| 909 | # uefi - 0.17.0 (2022-09-09) |
| 910 | |
| 911 | ## Added |
| 912 | - Added `Deref` and `DerefMut` trait implementations to `ScopedProtocol`. |
| 913 | This eliminates the need to explicitly access the `interface` field, |
| 914 | which is now marked as deprecated. |
| 915 | - Implemented `core::fmt::Write` for the `Serial` protocol. |
| 916 | - Added the `MemoryProtection` protocol. |
| 917 | - Added `BootServices::get_handle_for_protocol`. |
| 918 | - Added trait `EqStrUntilNul` and implemented it for `CStr8`, `CStr16`, and `CString16` |
| 919 | (CString8 doesn't exist yet). Now you can compare everything that is `AsRef<str>` |
| 920 | (such as `String` and `str` from the standard library) to UEFI strings. Please head to the |
| 921 | documentation of `EqStrUntilNul` to find out limitations and further information. |
| 922 | - Added `BootServices::image_handle` to get the handle of the executing |
| 923 | image. The image is set automatically by the `#[entry]` macro; if a |
| 924 | program does not use that macro then it should call |
| 925 | `BootServices::set_image_handle`. |
| 926 | - Added `BootServices::open_protocol_exclusive`. This provides a safe |
| 927 | and convenient subset of `open_protocol` that can be used whenever a |
| 928 | resource doesn't need to be shared. In same cases sharing is useful |
| 929 | (e.g. you might want to draw to the screen using the graphics |
| 930 | protocol, but still allow stdout output to go to the screen as |
| 931 | well), and in those cases `open_protocol` can still be used. |
| 932 | - Added `DiskIo` and `DiskIo2` protocols. |
| 933 | - Added `HardDriveMediaDevicePath` and related types. |
| 934 | - Added `PartialOrd` and `Ord` to the traits derived by `Guid`. |
| 935 | - The `File` trait now knows the methods `is_regular_file` and `is_directory`. |
| 936 | Developers profit from this on the struct `FileHandle`, for example. |
| 937 | |
| 938 | ## Changed |
| 939 | - Marked `BootServices::handle_protocol` as `unsafe`. (This method is |
| 940 | also deprecated -- use `open_protocol_exclusive` or `open_protocol` instead.) |
| 941 | - Deprecated `BootServices::locate_protocol` and marked it `unsafe`. Use |
| 942 | `BootServices::get_handle_for_protocol` and |
| 943 | `BootServices::open_protocol_exclusive` (or |
| 944 | `BootServices::open_protocol`) instead. |
| 945 | - Renamed feature `ignore-logger-errors` to `panic-on-logger-errors` so that it is |
| 946 | additive. It is now a default feature. |
| 947 | - Corrected the name of `BlockIOMedia::is_media_preset` to `is_media_present`. |
| 948 | |
| 949 | ## Removed |
| 950 | - Removed the `exts::allocate_buffer` function. This function could |
| 951 | cause undefined behavior when called with a `Layout` with an alignment |
| 952 | other than 1. A safe alternative is to use |
| 953 | [`Vec::into_boxed_slice`](https://doc.rust-lang.org/std/vec/struct.Vec.html#method.into_boxed_slice). |
| 954 | - Removed `From` conversions from `ucs2::Error` to `Status` and `Error`. |
| 955 | - Removed use of the unstable `try_trait_v2` feature, which allowed `?` |
| 956 | to be used with `Status` in a function returning `uefi::Result`. This |
| 957 | can be replaced by calling `status.into()`, or `Result::from(status)` |
| 958 | in cases where the compiler needs a type hint. |
| 959 | |
| 960 | |
| 961 | # uefi - 0.16.1 |
| 962 | |
| 963 | ## Added |
| 964 | - Added EFI revision constants to `Revision`. |
| 965 | |
| 966 | ## Fixed |
| 967 | - The table `Header` struct's `Debug` impl now prints the correct signature. |
| 968 | - The `BootServices::create_event_ex` and |
| 969 | `RuntimeServices::query_variable_info` methods now check the table |
| 970 | version to make sure it's 2.0 or higher before calling the associated |
| 971 | function pointers. This prevents potential invalid pointer access. |
| 972 | - Fixed an incorrect pointer cast in the `Rng` protocol that could cause |
| 973 | undefined behavior. |
| 974 | |
| 975 | ## Changed |
| 976 | - Relaxed the version requirements for the `bitflags` and `log` |
| 977 | dependencies to allow earlier patch versions. |
| 978 | - Enabled `doc_auto_cfg` on docs.rs to show badges on items that are |
| 979 | gated behind a feature. |
| 980 | |
| 981 | |
| 982 | # uefi - 0.16.0 (2022-05-16) |
| 983 | |
| 984 | ## Added |
| 985 | - Added `FileHandle::into_directory` and `FileHandle::into_regular_file`. |
| 986 | - Added `TimeParams`, `Time::invalid`, and `Time::is_invalid`. |
| 987 | - Added `RuntimeServices::query_variable_info` and `VariableStorageInfo`. |
| 988 | - Added `DevicePathToText` and `DevicePathFromText`. |
| 989 | - Added `LoadedImage::file_path` |
| 990 | - Implemented `TryFrom<Vec<u16>> for CString16`. |
| 991 | - Added `UnalignedCStr16`. |
| 992 | - Added `FilePathMediaDevicePath`. |
| 993 | - Added `DevicePath::as_acpi_device_path` and |
| 994 | `DevicePath::as_file_path_media_device_path`. |
| 995 | - Included `cstr8` and `cstr16` macros from `uefi-macros` in the prelude. |
| 996 | - Added `DevicePathInstance`, `DevicePathNode`, and `FfiDevicePath`. |
| 997 | |
| 998 | ## Changed |
| 999 | - `Time::new` now takes a single `TimeParams` argument so that date and |
| 1000 | time fields can be explicitly named at the call site. |
| 1001 | - The file info types now derive `PartialEq` and `Eq`. |
| 1002 | - The `FileAttributes` type is now `repr(transparent)`. |
| 1003 | - `DevicePath` is now a DST that represents an entire device path. The |
| 1004 | `DevicePathInstance` and `DevicePathNode` provide views of path |
| 1005 | instances and nodes, respectively. |
| 1006 | - The methods of `Revision` are now `const`. |
| 1007 | |
| 1008 | ## Fixed |
| 1009 | |
| 1010 | - Fixed undefined behavior in `proto::media::file::File::get_boxed_info`. |
| 1011 | |
| 1012 | |
| 1013 | # uefi - 0.15.2 (2022-03-15) |
| 1014 | |
| 1015 | ## Added |
| 1016 | - Added `PartialEq` impls for `CStr16 == CStr16`, `&CStr16 == CString`, |
| 1017 | and `CString == &CStr16`. |
| 1018 | - Added `Display` impl for `CString16`. |
| 1019 | - Added `Handle::from_ptr` and `SystemTable<View>::from_ptr`, which are |
| 1020 | `unsafe` methods for initializing from a raw pointer. |
| 1021 | - Added `CStr16::as_slice_with_nul` to provide immutable access to the |
| 1022 | underlying slice. |
| 1023 | - Added `LoadedImage::load_options_as_bytes` and |
| 1024 | `LoadedImage::load_options_as_cstr16`. |
| 1025 | - Added `Align::offset_up_to_alignment`, `Align::round_up_to_alignment`, |
| 1026 | and `Align::align_buf`. |
| 1027 | - Added `BootServices::connect_controller` and |
| 1028 | `BootServices::disconnect_controller`. |
| 1029 | - Added `BootServices::load_image` and `LoadImageSource`. Together these |
| 1030 | replace `BootServices::load_image_from_buffer` and also allow an image |
| 1031 | to be loaded via the `SimpleFileSystem` protocol. |
| 1032 | - Added `Rng` protocol. |
| 1033 | - Added `GptPartitionAttributes` struct and associated constants. |
| 1034 | - Added `Output::output_string_lossy`. |
| 1035 | - Added `ResultExt::handle_warning`. |
| 1036 | |
| 1037 | ## Changed |
| 1038 | - Updated to the 2021 edition. |
| 1039 | - `File::open` now takes the filename as `&CStr16` instead of `&str`, |
| 1040 | avoiding an implicit string conversion. |
| 1041 | - `FileInfo::new`, `FileSystemInfo::new`, and |
| 1042 | `FileSystemVolumeLabel::new` now take their `name` parameter as |
| 1043 | `&CStr16` instead of `&str`, avoiding an implicit string |
| 1044 | conversion. Additionally, an unaligned storage buffer is now allowed |
| 1045 | as long as it is big enough to provide an aligned subslice. |
| 1046 | - `LoadImage::set_load_options` now takes a `u8` pointer instead of |
| 1047 | `Char16`. |
| 1048 | - The `Error` type is now public. |
| 1049 | - The type of `GptPartitionEntry.attributes` is now |
| 1050 | `GptPartitionAttributes`. |
| 1051 | - The `uefi::Result` type now treats UEFI warnings as errors by |
| 1052 | default. The `uefi::Result::Ok` variant no longer contains a |
| 1053 | `Completion`, so the type behaves more like a regular Rust `Result` |
| 1054 | type. |
| 1055 | |
| 1056 | ## Removed |
| 1057 | - Removed `CStr16::as_string` method. Use |
| 1058 | [`ToString`](https://doc.rust-lang.org/alloc/string/trait.ToString.html) |
| 1059 | instead. |
| 1060 | - Removed `FileInfoCreationError::InvalidChar`. This error type is no |
| 1061 | longer needed due to the removal of implicit string conversions in |
| 1062 | file info types. |
| 1063 | - Removed `LoadedImage::load_options`, use |
| 1064 | `LoadedImage::load_options_as_bytes` or |
| 1065 | `LoadedImage::load_options_as_cstr16` instead. |
| 1066 | - Removed `NamedFileProtocolInfo`, `FileInfoHeader`, |
| 1067 | `FileSystemInfoHeader`, and `FileSystemVolumeLabelHeader`. Use |
| 1068 | `FileInfo`, `FileSystemInfo`, and `FileSystemVolumeLabel` instead. |
| 1069 | - Removed `BootServices::load_image_from_buffer`. Use |
| 1070 | `BootServices::load_image` instead. |
| 1071 | - Removed `Completion` type. Warnings are now treated as errors. |
| 1072 | - Removed many `ResultExt` methods, for most of them the standard |
| 1073 | `Result` methods can be used instead. Use `unwrap` instead of |
| 1074 | `unwrap_success`, `expect` instead of `expect_success`, `expect_err` |
| 1075 | instead of `expect_error`, and `map` instead of `map_inner`. The |
| 1076 | `log_warning` method has also been removed, use the new |
| 1077 | `ResultExt::handle_warning` method instead. |
| 1078 | |
| 1079 | ## Fixed |
| 1080 | - Fixed compilation with Rust 1.60 by no longer enabling the |
| 1081 | `vec_spare_capacity` feature, which has been stabilized. |
| 1082 | - Fixed the header size calculated by `FileInfo::new` and |
| 1083 | `FileSystemInfo::new`. |
| 1084 | - Fixed incorrect alignment of the volume label field in |
| 1085 | `FileSystemInfo`. This caused the beginning of the string to be |
| 1086 | truncated and could result in out-of-bounds reads. |
| 1087 | - Fixed size check for file info types so that alignment padding is |
| 1088 | taken into account. This fixes potential out-of-bounds writes. |
| 1089 | |
| 1090 | |
| 1091 | [uefi-rs book]: https://rust-osdev.github.io/uefi-rs/HEAD |