- Add missing IDT entries #CP and #HV`
- Adding next_higher_level to PageLevelIndex
- Adding
is_empty
to PageTable - Add
Descriptor::tss_segment_unchecked
- Add the
iretq
function to theInterruptStackFrameValue
struct. - add
flush_broadcast
andtlbsync
functions
- 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_cfg
feature - Enable
doc_auto_cfg
ondocs.rs
builds - Add Descriptor::dpl const method and use it in GDT construction
- Bump bitflags to 2.3.2
- Add
inline
attribute 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
VirtAddrNotValid
andPhysAddrNotValid
is now public (#340).- This field now contains the whole invalid address (#347).
- Remove all uses of external assembly (#343)
external_asm
andinline_asm
features are deprecated and now have no effect.instructions
feature (on by default) now requires Rust 1.59- Specific MSRV now noted in
README
(#355)
- Implement
core::iter::Step
forVirtAddr
andPage
(#342)- This trait is only available on nightly.
- Gated behind
step_trait
feature flag
- Add
UCet
andSCet
registers (#349) - Use
rustversion
to mark certain functionsconst fn
on 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_basics
andconst_fn_trait_bound
features (#352) - Don't set
nomem
inload_tss
(#358) - Correctly initialize TSS's IOPB to be empty (#357)
- Improve
GlobalDescriptorTable::add_entry
error handling (#361) - Update
tss_segment
documentation (#366)
- fix: build error on the latest nightly (#329)
- add
set_general_handler
macro (#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
index
and#VC
(#321) - remove
const_assert!
in favor of std'sassert!
(#326) - Move bootloader integration test to separate CI job (#330)
- New
registers::segmentation
module (#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-features
succeeds.
- Add
ExceptionVector
enum and additional flags toPageFaultErrorCode
(#303) - Add
clean_up
andclean_up_with_filter
methods to deallocate unused page tables (#264) - Rename some XCr0 and CR4 flags (#275)
- Expose
MapperFlush::new
andMapperFlushAll::new
constructor functions (#296) - Use
#[cfg(doc)]
instead of docs.rs-specific cfg flag (#287) - Some documentation updates:
- Update
bit_field
dependency (#306)
- Add
instructions::tables::sgdt
(#279) - Improve control register bits (#273)
- Add
Cr0
bits:EXTENSION_TYPE
(ET) - Add
Cr4
bits:KEY_LOCKER
(KL)CONTROL_FLOW_ENFORCEMENT
(CET)PROTECTION_KEY_SUPERVISOR
(PKS)
- Add
XCr0
bits:BNDREG
,BNDCSR
,OPMASK
,ZMM_HI256
,HI16_ZMM
- Add consistency checks for
XCr0
bits
- Add
- Add
SelectorErrorCode
for parsing interrupt error codes from#TS
,#NP
,#SS
, and#GP
(#274) - Make
addr::{align_up, align_down}
const (#270) - Make
structures::idt
available on stable Rust (#271)- Use dummy types for the
HandlerFunc
s if the"abi_x86_interrupt"
feature is disabled - Add unsafe
set_handler_addr
that just takes aVirtAddr
- Use dummy types for the
- Add common abstractions for x86 Segments (#258)
- Add
SS
,CS
,DS
,ES
,FS
,GS
marker types - Add
Segment
trait for reading/writing the segment register - Add
Segment64
trait for reading/writing the segment base - Add
GS::swap()
- Deprecate the corresponding free functions:
cs
,set_cs
swap_gs
load_{ss,ds,es,fs,gs}
{wr,rd}{fs,gs}base
- Add
- Bug fixes:
- Make the following types aliases of the new
PortGeneric
type (#248):Port<T> = PortGeneric<T, ReadWriteAccess>
PortReadOnly<T> = PortGeneric<T, ReadOnlyAccess>
PortWriteOnly<T> = PortGeneric<T, WriteOnlyAccess>
- The following methods no longer require the
nightly
feature to beconst fn
s (#255):PageTable::new
GlobalDescriptorTable::from_raw_slice
MappedFrame::{start_address, size}
Page<Size4KiB>::p1_index
- Add
Debug
implementation forInterruptDescriptorTable
(#253)- Improve
Debug
implementations forEntry
andEntryOptions
- Improve
- Multiple improvements to assembly code (#251)
- Added
external_asm
implementations forbochs_breakpoint
andXCr0
- Updated
options
forasm!
blocks (to improve performance) - Updated docs to use
doc_cfg
- Added
- Use new
const_fn_trait_bound
feature to fix build on latest nightly (#250)- Attention: The
const_fn
feature now requires at least Rust nightly2021-05-06
.
- Attention: The
- Add support for
sidt
instruction (#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_mut
to return aVolatile<_>
wrapper #242
- Add support for
XCR0
register (#239)
- Implement more fmt traits for addr types (#237)
- Implement
Clone
forPageTable
(#236)
- Fix build on latest nightly: The feature
const_in_array_repeat_expressions
was removed (#230)
- PCID support instructions ([#169])(rust-osdev#169))
- Breaking: Also return flags for
MapperAllSizes::translate()
(#207) - Breaking: Restructure the
TranslateResult
type and create separateTranslate
trait (#211) - Breaking: Rename
PhysToVirt
trait toPageTableFrameMapping
(#214) - Breaking: Use custom error types instead of
()
(#199) - Breaking: Remove deprecated items
UnusedPhysFrame
ExceptionStackFrame
VirtAddr::new_unchecked
interrupts::enable_interrupts_and_hlt
- Breaking: Make
DescriptorTablePointer::base
aVirtAddr
(#215) - Breaking: Change return type of
read_rip
toVirtAddr
(#216) - Breaking: Make writing the RFLAGS register unsafe (#219)
- Breaking: Remove
PortReadWrite
trait, which is no longer needed (#217) - Relaxe
Sized
requirement forFrameAllocator
inMapper::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_entry
a const fn (#191) - Rename
enable_interrupts_and_hlt
toenable_and_hlt
(#206) - Provide functions for accessing the underlying L4 table for mapper types (#184)
- Remove Trait constraint for
Port::new()
(#188)
- Add additional
DescriptorFlags
and 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
instructions
module by a newinstructions
feature (enabled by default). - Rename the
stable
feature toexternal_asm
PageTable::new
is no longer aconst fn
on stable (i.e. without thenightly
feature)
- 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::new
inside aconst fn
(#175)
- Add a function for the
nop
instruction (#174)
- (accidental release, yanked)
- Add rdfsbase, rdgsbase, wrfsbase, wrgsbase (#172)
- Export
PhysAddrNotValid
andVirtAddrNotValid
error 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_to
andupdate_flags
unsafe (#135) - Breaking: Make
FrameDeallocator::deallocate_frame
unsafe (#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_unchecked
function 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
cast
dependency (#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
ux
dependency 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: Sized
bounds on generic functions (#84)
- Add
slice
andslice_mut
methods 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
OffsetPageTable
mapper type (#83)
- Add
instructions::bochs_breakpoint
andregisters::read_rip
functions (#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::read
andPortReadOnly::read
now take&mut self
instead of&self
(#76).
- Breaking: Make the
FrameAllocator
unsafe to implement. This way, we can force the implementer to guarantee that all frame allocators are valid. See #69 for more information.
- Use
cast
crate instead of less generalusize_conversions
crate.
- Update dependencies to latest versions (fix #67)
- Add
PortReadOnly
andPortWriteOnly
types ininstructions::port
module (#66).
- Update documentation of
MappedPageTable
: Require that passedlevel_4_table
is valid.
- Add
PageTable::{iter, iter_mut}
functions to iterate over page table entries.
- The
random
module is now a submodule of theinstructions
module. - The
structures::paging
module was split into several submodules:- The
NotGiantPageSize
,PageRange
, andPageRangeInclusive
types were moved to a newpage
submodule. - The
PhysFrameRange
andPhysFrameRangeInclusive
types were moved to a newframe
submodule. - The
FrameError
andPageTableEntry
types were moved to a newpage_table
submodule. - The
MapperFlush
,MapToError
,UnmapError
, andFlagUpdateError
types were moved to a newmapper
submodule.
- The
- The
structures::paging
module received the following changes:- The
Mapper::translate_page
function now returns aResult
with a newTranslateError
error type. - The
NotRecursivelyMapped
error type was removed.
- The
- The
instructions::int3
function was moved into theinstructions::interrupts
module. - Removed some old deprecated functions.
- Made modifications of the interrupt stack frame unsafe by introducing a new wrapper type and an unsafe
as_mut
method.
- Added a new
structures::paging::MapperAllSizes
trait with generic translation methods and implement it forMappedPageTable
andRecursivePageTable
. - Added a new
structures::paging::MappedPageTable
type that implements theMapper
andMapperAllSizes
traits. - Added a
software_interrupt
macro to invoke arbitraryint x
instructions. - Renamed the
ExceptionStackFrame
type toInterruptStackFrame
.
- Add
RdRand::get_u{16, 32, 64}
methods - Deprecate
RdRand::get
because it does not check for failure - Make
RdRand
Copy
- Add support for the RdRand instruction (random number generation)
- Make
Mapper::map_to
andMapper::identity_map
unsafe because it is possible to break memory safety by passing invalid arguments. - Rename
FrameAllocator::alloc
toallocate_frame
andFrameDeallocator::dealloc
todeallocate_frame
. - Remove
From<os_bootinfo::FrameRange>
implementation forPhysFrameRange
- The
os_bootinfo
crate is no longer used by thebootloader
crate. - It is not possible to provide an implementation for all
os_bootinfo
versions.
- The
- Update to 2018 edition
- Add a
SIZE
constant to thePage
type - Add two interrupt tests to the
testing
sub-crate