rust-osdev / x86_64

Library to program x86_64 hardware.
https://docs.rs/x86_64
Apache License 2.0
757 stars 130 forks source link

Tracking issue for breaking changes #193

Closed josephlr closed 3 years ago

josephlr commented 3 years ago

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:

phil-opp commented 3 years ago

Sounds good to me!

Make PhysToVirt actually map PhysAddr to VirtAddr (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.

phil-opp commented 3 years ago

(I added https://github.com/rust-osdev/x86_64/pull/199 to the list.)

phil-opp commented 3 years ago

(I added https://github.com/rust-osdev/x86_64/pull/207 to the list)

phil-opp commented 3 years ago

I implemented most changes in the next branch. The two remaining items are:

mental32 commented 3 years ago

I'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,
}
phil-opp commented 3 years ago

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.

josephlr commented 3 years ago

Closing as #262 now tracks the 0.15 release.