Closed josephlr closed 3 years ago
Sounds good to me!
Make
PhysToVirt
actually mapPhysAddr
toVirtAddr
(instead of returning a pointer)
You mean changing the function signature to something like fn phys_to_virt(&self, phys_addr: PhysAddr) -> VirtAddr
? This would make sense to me. The current signature could become an private function for the MappedPageTable
type.
(I added https://github.com/rust-osdev/x86_64/pull/199 to the list.)
(I added https://github.com/rust-osdev/x86_64/pull/207 to the list)
I implemented most changes in the next
branch. The two remaining items are:
u64
even though they are only 16 bitI'm not sure what to do about the segment selectors, which are pushed as u64 even though they are only 16 bit
Could a padded newtype work?
#[repr(C)]
struct PaddedSegmentSelector {
inner: SegmentSelector,
_u16: u16,
_u32: u32,
}
Yes, I think that should work.
Given that most of the items from this issue are done, it might make sense to create separate tracking issues for the two remaining items and then close this one.
Closing as #262 now tracks the 0.15 release.
Many issues/PR currently proposed would break the API of this create. This seems reasonable, but we should try to consolidate changes as much as possible. This issue tracks these changes.
Add any breaking changes you're interested in:
PageTableFlags
in the result oftranslate
(~#150~ https://github.com/rust-osdev/x86_64/pull/207)MapperAllSizes
toTranslate
(https://github.com/rust-osdev/x86_64/issues/152, done in https://github.com/rust-osdev/x86_64/pull/211)Mapper
(https://github.com/rust-osdev/x86_64/issues/192)~map_range_with_table_flags
with a default implementation) does not require any breaking changes.PhysFrameRange
,PhysFrameRangeInclusive
,PageRange
,PageRangeInclusive
to instead use the Rust types.Step
trait is stablePhysToVirt
actually mapPhysAddr
toVirtAddr
(instead of returning a pointer) (tried in https://github.com/rust-osdev/x86_64/pull/213, but it doesn't work)~PhysToVirt
trait toPageTableFrameMapping
(https://github.com/rust-osdev/x86_64/pull/214)DescriptorTablePointer::base
aVirtAddr
(makes it clear segmentation is applied before paging). (done in https://github.com/rust-osdev/x86_64/pull/215)read_rip
return a VirtAddr (done in https://github.com/rust-osdev/x86_64/pull/216)InterruptStackFrameValue
:code_segment
should be aSegmentSelector
SegmentSelector
is anu16
, but the field inInterruptStackFrameValue
must be anu64
cpu_flags
should be aRFlags
stack_segment
should be aSegmentSelector
_-> same problem as forcode_segment
_UnusedPhysFrame
ExceptionStackFrame
VirtAddr::new_unchecked
PortReadWrite
(it no longer makes sense to have it given theconst fn
changes toPort
) (done in https://github.com/rust-osdev/x86_64/pull/217)rflags
(done in https://github.com/rust-osdev/x86_64/pull/219)write
/write_raw
unsafe (they can cause instant UB or crashes)()
(https://github.com/rust-osdev/x86_64/pull/199)MapperAllSizes::translate()
(https://github.com/rust-osdev/x86_64/pull/207)