- Add
MapperFlushmethod to get page - add
update()toCr3,Dr7,SFMask,UCet,SCet,mxcsr,rflags, andXCr0 - add IA32_APIC_BASE support
- add memory encryption support
- implement functions for accessing CR8
- add forwarding
impl PageTableFrameMapping for &P - add PageFaultErrorCode::HLAT
- fix panic in
impl fmt::Debug for EntryOptions - Ensure that addition and subtraction of addresses panics on overflow/underflow
- fix typo
- fix warnings & remove broken CI job
- use default python again
- don't pass -Crelocation-model=static to host targets
- fix kani build job
- improve
VirtAddrAdd&Subimpls - Add "FMask" alias for SFMask
- Bump actions/checkout from 4 to 5
This release is compatible with Rust nightlies starting with nightly-2024-11-23 (this only applies when the nightly feature is used).
- add
GlobalDescriptorTable::limit - constify PhysFrame functions
- add
sizeandlenforPageRange,PhysFrameRange,PageRangeInclusiveandPhysFrameRangeInclusive - TryFrom implementation for ExceptionVector
- Only enable instructions on
x86_64 - Ensure that Page actually implements Hash
- fix field order for INVPCID descriptor
- fix typo in "InvPicdCommand"
- fix signature of Step::steps_between implementations
- docs: add aliases for
in{,b,w,l}andout{,b,w,l} - ci: migrate away from unmaintained actions
- chore: migrate from legacy
rust-toolchaintorust-toolchain.toml - test: replace
x86_64-bare-metal.jsonwithx86_64-unknown-none - docs: fix and detect warnings
- CI: Set
-Crelocation-model=staticinRUSTFLAGSfor bootloader test job - silence warning about cast
- fix cfg related warnings
- fix warnings
- don't use label starting with 1
- fix testing
- remove
#![feature(asm_const)] - Remove stabilized const_mut_refs feature
- Fix clippy warnings
- fix CI job for building on MSRV
- gate HandlerFunc behind target_arch = "x86{_64}"
- Typo fix in TaskStateSegment comment
- Minor clarification DescriptorTablePointer::limit comment
- replace software_interrupt! macro with generic function
- Use SegmentSelector in InterruptStackFrame
- add
InvalidStarSegmentSelectorserror - add
PcidTooBigerror - implement
Index<u8>for IDT instead ofIndex<usize> - change
cpu_flags's type toRFlags - fix
load_tssandGlobalDescriptorTable - add an immutable getter for the level 4 page table
- make
Cr2::readreturn a result - remove
external_asmandinline_asmfeatures - Allow the GDT to be of any length
- Remove software_interrupt! macro
- Remove usize trait impls
- Remove deprecated functions/flags
- VirtAddr improvements
- Add structures::gdt::Entry type
- Allow GDT to be loaded with shared reference
- seal off the
PageSizetrait - idt: Fixup Options structure and cleanup set_handler_fn
- Add missing IDT entries #CP and #HV`
- Adding next_higher_level to PageLevelIndex
- Adding
is_emptyto PageTable - Add
Descriptor::tss_segment_unchecked - Add the
iretqfunction to theInterruptStackFrameValuestruct. - add
flush_broadcastandtlbsyncfunctions
- Change Star::write() to use checked subtractions
- add workaround for recursive page tables with recursive index 511
- Fix off-by-one in documentation
- Fix misc doc typos
- add compiler fences to enable and disable
- set repr to transparent for various types
- Remove unused
doc_cfgfeature - Enable
doc_auto_cfgondocs.rsbuilds - Add Descriptor::dpl const method and use it in GDT construction
- Bump bitflags to 2.3.2
- Add
inlineattribute to segment functions
- Add
registers::debug - Provide null segment selector as associated constant on
SegmentSelector - Add getters for the page table frame mapping
- Address in
VirtAddrNotValidandPhysAddrNotValidis now public (#340).- This field now contains the whole invalid address (#347).
- Remove all uses of external assembly (#343)
external_asmandinline_asmfeatures are deprecated and now have no effect.instructionsfeature (on by default) now requires Rust 1.59- Specific MSRV now noted in
README(#355)
- Implement
core::iter::StepforVirtAddrandPage(#342)- This trait is only available on nightly.
- Gated behind
step_traitfeature flag
- Add
UCetandSCetregisters (#349) - Use
rustversionto mark certain functionsconst fnon Rust 1.61 (#353) Entry::handler_addr()is now public (#354)- Increase packed structure alignment (#362)
- Make more address methods
const fn(#369)VirtAddr::as_ptr()VirtAddr::as_mut_ptr()PhysAddr::new()PhysAddr::try_new()
- Fixed overflow bug in PageRangeInclusive (#351)
- Remove stabilized
const_fn_fn_ptr_basicsandconst_fn_trait_boundfeatures (#352) - Don't set
nomeminload_tss(#358) - Correctly initialize TSS's IOPB to be empty (#357)
- Improve
GlobalDescriptorTable::add_entryerror handling (#361) - Update
tss_segmentdocumentation (#366)
- fix: build error on the latest nightly (#329)
- add
set_general_handlermacro (#285) - Derive common traits for number, range and enum types (#315)
- Add the VMM Communication Exception (
#VC) to theInterruptDescriptorTable(#313) - fix: enable manipulation of
InterruptStackFrame(#312) - fix docs for
page_table_index(#318) - Remove redundant alignment check (#314)
- fix(idt): fix panic messages for
indexand#VC(#321) - remove
const_assert!in favor of std'sassert!(#326) - Move bootloader integration test to separate CI job (#330)
- New
registers::segmentationmodule (#309), containing:instructions::segmentation::{Segment, Segment64, CS, DS, ES, FS, GS, SS}structures::gdt::SegmentSelector- Old locations still re-export all the types, so this is not a breaking change.
- Fixes build so that
cargo doc --no-default-featuressucceeds.
- Add
ExceptionVectorenum and additional flags toPageFaultErrorCode(#303) - Add
clean_upandclean_up_with_filtermethods to deallocate unused page tables (#264) - Rename some XCr0 and CR4 flags (#275)
- Expose
MapperFlush::newandMapperFlushAll::newconstructor functions (#296) - Use
#[cfg(doc)]instead of docs.rs-specific cfg flag (#287) - Some documentation updates:
- Update
bit_fielddependency (#306)
- Add
instructions::tables::sgdt(#279) - Improve control register bits (#273)
- Add
Cr0bits:EXTENSION_TYPE(ET) - Add
Cr4bits:KEY_LOCKER(KL)CONTROL_FLOW_ENFORCEMENT(CET)PROTECTION_KEY_SUPERVISOR(PKS)
- Add
XCr0bits:BNDREG,BNDCSR,OPMASK,ZMM_HI256,HI16_ZMM - Add consistency checks for
XCr0bits
- Add
- Add
SelectorErrorCodefor parsing interrupt error codes from#TS,#NP,#SS, and#GP(#274) - Make
addr::{align_up, align_down}const (#270) - Make
structures::idtavailable on stable Rust (#271)- Use dummy types for the
HandlerFuncs if the"abi_x86_interrupt"feature is disabled - Add unsafe
set_handler_addrthat just takes aVirtAddr
- Use dummy types for the
- Add common abstractions for x86 Segments (#258)
- Add
SS,CS,DS,ES,FS,GSmarker types - Add
Segmenttrait for reading/writing the segment register - Add
Segment64trait for reading/writing the segment base - Add
GS::swap() - Deprecate the corresponding free functions:
cs,set_csswap_gsload_{ss,ds,es,fs,gs}{wr,rd}{fs,gs}base
- Add
- Bug fixes:
- Make the following types aliases of the new
PortGenerictype (#248):Port<T> = PortGeneric<T, ReadWriteAccess>PortReadOnly<T> = PortGeneric<T, ReadOnlyAccess>PortWriteOnly<T> = PortGeneric<T, WriteOnlyAccess>
- The following methods no longer require the
nightlyfeature to beconst fns (#255):PageTable::newGlobalDescriptorTable::from_raw_sliceMappedFrame::{start_address, size}Page<Size4KiB>::p1_index
- Add
Debugimplementation forInterruptDescriptorTable(#253)- Improve
Debugimplementations forEntryandEntryOptions
- Improve
- Multiple improvements to assembly code (#251)
- Added
external_asmimplementations forbochs_breakpointandXCr0 - Updated
optionsforasm!blocks (to improve performance) - Updated docs to use
doc_cfg
- Added
- Use new
const_fn_trait_boundfeature to fix build on latest nightly (#250)- Attention: The
const_fnfeature now requires at least Rust nightly2021-05-06.
- Attention: The
- Add support for
sidtinstruction (#246) - Fix Debug and PartialEq implementations for IDT entry type (#249)
- Looser trait bounds for Port types (#247)
- Breaking: Take the interrupt stack frame by value (not by reference) #242
- Breaking: Change
InterruptStackFrame::as_mutto return aVolatile<_>wrapper #242
- Add support for
XCR0register (#239)
- Implement more fmt traits for addr types (#237)
- Implement
CloneforPageTable(#236)
- Fix build on latest nightly: The feature
const_in_array_repeat_expressionswas removed (#230)
- PCID support instructions ([#169])(#169))
- Breaking: Also return flags for
MapperAllSizes::translate()(#207) - Breaking: Restructure the
TranslateResulttype and create separateTranslatetrait (#211) - Breaking: Rename
PhysToVirttrait toPageTableFrameMapping(#214) - Breaking: Use custom error types instead of
()(#199) - Breaking: Remove deprecated items
UnusedPhysFrameExceptionStackFrameVirtAddr::new_uncheckedinterrupts::enable_interrupts_and_hlt
- Breaking: Make
DescriptorTablePointer::baseaVirtAddr(#215) - Breaking: Change return type of
read_riptoVirtAddr(#216) - Breaking: Make writing the RFLAGS register unsafe (#219)
- Breaking: Remove
PortReadWritetrait, which is no longer needed (#217) - Relaxe
Sizedrequirement forFrameAllocatorinMapper::map_to(204)
- Fix bad conversion from llvm_asm! to asm! (#218)
- GDT: Add
load_unchecked,from_raw_slice, andas_raw_slice(#210)
- Use
asm!instead of perma-unstablellvm_asm!macro (#165) - Make
GlobalDescriptorTable::add_entrya const fn (#191) - Rename
enable_interrupts_and_hlttoenable_and_hlt(#206) - Provide functions for accessing the underlying L4 table for mapper types (#184)
- Remove Trait constraint for
Port::new()(#188)
- Add additional
DescriptorFlagsand aliases compatible withsyscall/sysenter(#181) - Fix (another) build error on latest nightly (#186)
- Fix build error on latest nightly (#182)
- Breaking: Decouple instructions into a separate feature flag (#179)
- Gates the
instructionsmodule by a newinstructionsfeature (enabled by default). - Rename the
stablefeature toexternal_asm PageTable::newis no longer aconst fnon stable (i.e. without thenightlyfeature)
- Gates the
- Add
VirtAddr::is_null(#180)
- Fix const_item_mutation warnings added in latest Rust nightly (#178)
- (accidental empty release)
- Don't rely on promotion of
PageTableEntry::newinside aconst fn(#175)
- Add a function for the
nopinstruction (#174)
- (accidental release, yanked)
- Add rdfsbase, rdgsbase, wrfsbase, wrgsbase (#172)
- Export
PhysAddrNotValidandVirtAddrNotValiderror types (#163)
- Breaking: Handle parent table flags in Mapper methods (#114)
- Fix: Inclusive ranges is_empty() comparison (#156)
- Nightly Breakage: Use
llvm_asm!instead of deprecatedasm!macro (#151) - Return the correct RPL from GDT::add_entry() (#153)
- Add InterruptDescriptorTable::load_unsafe (#137)
- Breaking: Make
map_toandupdate_flagsunsafe (#135) - Breaking: Make
FrameDeallocator::deallocate_frameunsafe (#146) - Breaking: Don't pass small trivially copyable types by reference (#147)
- Various improvements to VirtAddr and PhysAddr (#141)
- Among other things, this renamed the
VirtAddr::new_uncheckedfunction tonew_truncate.
- Among other things, this renamed the
- Add
const_fn!{}macro to make functions const without duplication (#144)- Also makes some more functions
const.
- Also makes some more functions
- Add
{PhysFrame,Page}::from_start_address_unchecked(#142) - Use
#[inline]everywhere (#145) - In
VirtAddr::new_truncate, use shift instead of mul and div (#143) - Use
Self::new()inInterruptDescriptorTable::reset()(#148)
- Add an enable_interrupts_and_hlt function that executes
sti; hlt(#138) - Fix some clippy warnings (#130)
- Resolve remaining clippy warnings and add clippy job to CI (#132)
- Add
#[inline]attribute to small functions (#129)
- asm: add target_env = "musl" to pickup the underscore asm names (#128)
- Enable usage with non-nightly rust (#127)
- Remove the
castdependency (#124)
- Improve PageTableIndex and PageOffset (#122)
- Breaking: Return the UnusedPhysFrame on MapToError::PageAlreadyMapped (#118)
- Add User Mode registers (#119)
- Add support for cr4 control register (#111)
- Fix: Add required reexport for new UnusedPhysFrame type (#110)
- Breaking: Replace
uxdependency with custom wrapper structs (#91) - Breaking: Add new UnsafePhysFrame type and use it in Mapper::map_to (#89)
- Breaking: Rename divide_by_zero field of interrupt descriptor table to divide_error (#108)
- Breaking: Introduce new diverging handler functions for double faults and machine check exceptions (#109)
- Possibly Breaking: Make Mapper trait object safe by adding
Self: Sizedbounds on generic functions (#84)
- Add
sliceandslice_mutmethods to IDT (#95)
- Use repr C to suppress not-ffi-safe when used with extern handler functions (#94)
- Add FsBase and GsBase register support (#87)
- Remove raw-cpuid dependency and use rdrand intrinsics (#85)
- Update integration tests to use new testing framework (#86)
- Add a new
OffsetPageTablemapper type (#83)
- Add
instructions::bochs_breakpointandregisters::read_ripfunctions (#79) - Mark all single instruction functions as
#[inline](#79) - Update GDT docs, add user_data_segment function and WRITABLE flag (#78)
- Reexport MappedPageTable on non-x86_64 platforms too (#82)
- Add ring-3 flag to GDT descriptor (#77)
- Breaking:
Port::readandPortReadOnly::readnow take&mut selfinstead of&self(#76).
- Breaking: Make the
FrameAllocatorunsafe to implement. This way, we can force the implementer to guarantee that all frame allocators are valid. See #69 for more information.
- Use
castcrate instead of less generalusize_conversionscrate.
- Update dependencies to latest versions (fix #67)
- Add
PortReadOnlyandPortWriteOnlytypes ininstructions::portmodule (#66).
- Update documentation of
MappedPageTable: Require that passedlevel_4_tableis valid.
- Add
PageTable::{iter, iter_mut}functions to iterate over page table entries.
- The
randommodule is now a submodule of theinstructionsmodule. - The
structures::pagingmodule was split into several submodules:- The
NotGiantPageSize,PageRange, andPageRangeInclusivetypes were moved to a newpagesubmodule. - The
PhysFrameRangeandPhysFrameRangeInclusivetypes were moved to a newframesubmodule. - The
FrameErrorandPageTableEntrytypes were moved to a newpage_tablesubmodule. - The
MapperFlush,MapToError,UnmapError, andFlagUpdateErrortypes were moved to a newmappersubmodule.
- The
- The
structures::pagingmodule received the following changes:- The
Mapper::translate_pagefunction now returns aResultwith a newTranslateErrorerror type. - The
NotRecursivelyMappederror type was removed.
- The
- The
instructions::int3function was moved into theinstructions::interruptsmodule. - Removed some old deprecated functions.
- Made modifications of the interrupt stack frame unsafe by introducing a new wrapper type and an unsafe
as_mutmethod.
- Added a new
structures::paging::MapperAllSizestrait with generic translation methods and implement it forMappedPageTableandRecursivePageTable. - Added a new
structures::paging::MappedPageTabletype that implements theMapperandMapperAllSizestraits. - Added a
software_interruptmacro to invoke arbitraryint xinstructions. - Renamed the
ExceptionStackFrametype toInterruptStackFrame.
- Add
RdRand::get_u{16, 32, 64}methods - Deprecate
RdRand::getbecause it does not check for failure - Make
RdRandCopy
- Add support for the RdRand instruction (random number generation)
- Make
Mapper::map_toandMapper::identity_mapunsafe because it is possible to break memory safety by passing invalid arguments. - Rename
FrameAllocator::alloctoallocate_frameandFrameDeallocator::dealloctodeallocate_frame. - Remove
From<os_bootinfo::FrameRange>implementation forPhysFrameRange- The
os_bootinfocrate is no longer used by thebootloadercrate. - It is not possible to provide an implementation for all
os_bootinfoversions.
- The
- Update to 2018 edition
- Add a
SIZEconstant to thePagetype - Add two interrupt tests to the
testingsub-crate