Update to work with latest nightly
This commit is contained in:
parent
c84aefa2e8
commit
6ae16cc6df
22
Cargo.lock
generated
22
Cargo.lock
generated
@ -22,7 +22,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bootloader"
|
name = "bootloader"
|
||||||
version = "0.9.0"
|
version = "0.9.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bit_field 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"bit_field 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@ -39,7 +39,7 @@ dependencies = [
|
|||||||
"polling_serial 0.1.0",
|
"polling_serial 0.1.0",
|
||||||
"static_assertions 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"static_assertions 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"vga_buffer 0.1.0",
|
"vga_buffer 0.1.0",
|
||||||
"x86_64 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"x86_64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -64,14 +64,14 @@ name = "dendrobates_tinctoreus_azureus"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"bootloader 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"bootloader 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"cache_utils 0.1.0",
|
"cache_utils 0.1.0",
|
||||||
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"linked_list_allocator 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"linked_list_allocator 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"polling_serial 0.1.0",
|
"polling_serial 0.1.0",
|
||||||
"vga_buffer 0.1.0",
|
"vga_buffer 0.1.0",
|
||||||
"volatile 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"volatile 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"x86_64 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"x86_64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -102,7 +102,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "linked_list_allocator"
|
name = "linked_list_allocator"
|
||||||
version = "0.8.1"
|
version = "0.8.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"spinning_top 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"spinning_top 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@ -134,7 +134,7 @@ version = "0.1.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"x86_64 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"x86_64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -181,7 +181,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "x86_64"
|
name = "x86_64"
|
||||||
version = "0.9.6"
|
version = "0.11.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bit_field 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"bit_field 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
@ -193,14 +193,14 @@ dependencies = [
|
|||||||
"checksum bit_field 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a165d606cf084741d4ac3a28fb6e9b1eb0bd31f6cd999098cfddb0b2ab381dc0"
|
"checksum bit_field 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a165d606cf084741d4ac3a28fb6e9b1eb0bd31f6cd999098cfddb0b2ab381dc0"
|
||||||
"checksum bit_field 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ed8765909f9009617974ab6b7d332625b320b33c326b1e9321382ef1999b5d56"
|
"checksum bit_field 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ed8765909f9009617974ab6b7d332625b320b33c326b1e9321382ef1999b5d56"
|
||||||
"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
|
"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
|
||||||
"checksum bootloader 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "47a31d0af1b59774ea1470bf40b4bf9fed0bbead2f2d9d614c4c2e13382414dd"
|
"checksum bootloader 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)" = "56452f4da420d25cf4bbf5b8fdc1529a8bde79a081f2619ce7ebc6d581117261"
|
||||||
"checksum cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)" = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd"
|
"checksum cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)" = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd"
|
||||||
"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
|
"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
|
||||||
"checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3"
|
"checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3"
|
||||||
"checksum itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"
|
"checksum itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"
|
||||||
"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
||||||
"checksum libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)" = "99e85c08494b21a9054e7fe1374a732aeadaff3980b6990b94bfd3a70f690005"
|
"checksum libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)" = "99e85c08494b21a9054e7fe1374a732aeadaff3980b6990b94bfd3a70f690005"
|
||||||
"checksum linked_list_allocator 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5825aea823c659d0fdcdbe8c9b78baf56f3a10365d783db874f6d360df72626f"
|
"checksum linked_list_allocator 0.8.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e70e46c13c0e8374c26cec5752e3347ca1087d9711de8f45aa513a7700efd73d"
|
||||||
"checksum lock_api 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "79b2de95ecb4691949fea4716ca53cdbcfccb2c612e19644a8bad05edcf9f47b"
|
"checksum lock_api 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "79b2de95ecb4691949fea4716ca53cdbcfccb2c612e19644a8bad05edcf9f47b"
|
||||||
"checksum nix 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "50e4785f2c3b7589a0d0c1dd60285e1188adac4006e8abd6dd578e1567027363"
|
"checksum nix 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "50e4785f2c3b7589a0d0c1dd60285e1188adac4006e8abd6dd578e1567027363"
|
||||||
"checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
"checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
||||||
@ -209,4 +209,4 @@ dependencies = [
|
|||||||
"checksum static_assertions 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
"checksum static_assertions 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
||||||
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
|
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
|
||||||
"checksum volatile 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "6af0edf5b4faacc31fc51159244d78d65ec580f021afcef7bd53c04aeabc7f29"
|
"checksum volatile 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "6af0edf5b4faacc31fc51159244d78d65ec580f021afcef7bd53c04aeabc7f29"
|
||||||
"checksum x86_64 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4206b60c9f99766329b66962aa8ddc01df6c7edd02edc046b7a69d5df9fcdbcf"
|
"checksum x86_64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "365de37eb7c6da582cbb510dd0f3f1235d24ff6309a8a96e8a9909cc9bfd608f"
|
||||||
|
@ -25,11 +25,11 @@ test-success-exit-code = 33 # (0x10 << 1) | 1
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
x86_64 = "0.9.6"
|
x86_64 = "0.11.0"
|
||||||
vga_buffer = { path = "vga_buffer" }
|
vga_buffer = { path = "vga_buffer" }
|
||||||
polling_serial = { path = "polling_serial" }
|
polling_serial = { path = "polling_serial" }
|
||||||
volatile = "0.2.6"
|
volatile = "0.2.6"
|
||||||
linked_list_allocator = "0.8.1"
|
linked_list_allocator = "0.8.4"
|
||||||
cache_utils = { path = "cache_utils", features = ["no_std"], default-features = false }
|
cache_utils = { path = "cache_utils", features = ["no_std"], default-features = false }
|
||||||
arrayref = "0.3.6"
|
arrayref = "0.3.6"
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ version = "1.4.0"
|
|||||||
features = ["spin_no_std"]
|
features = ["spin_no_std"]
|
||||||
|
|
||||||
[dependencies.bootloader]
|
[dependencies.bootloader]
|
||||||
version = "0.9.0"
|
version = "0.9.4"
|
||||||
features = ["sse", "map_physical_memory"]
|
features = ["sse", "map_physical_memory"]
|
||||||
|
|
||||||
#[patch.crates-io]
|
#[patch.crates-io]
|
||||||
|
@ -10,7 +10,7 @@ edition = "2018"
|
|||||||
polling_serial = { path = "../polling_serial", optional = true }
|
polling_serial = { path = "../polling_serial", optional = true }
|
||||||
vga_buffer = { path = "../vga_buffer", optional = true }
|
vga_buffer = { path = "../vga_buffer", optional = true }
|
||||||
cpuid = { path = "../cpuid", default-features = false }
|
cpuid = { path = "../cpuid", default-features = false }
|
||||||
x86_64 = "0.9.2"
|
x86_64 = "0.11.0"
|
||||||
static_assertions = "1.1.0"
|
static_assertions = "1.1.0"
|
||||||
itertools = { version = "0.9.0", default-features = false }
|
itertools = { version = "0.9.0", default-features = false }
|
||||||
|
|
||||||
|
@ -7,9 +7,9 @@ edition = "2018"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
x86_64 = "0.9.2"
|
x86_64 = "0.11.0"
|
||||||
spin = "0.5.2"
|
spin = "0.5.2"
|
||||||
|
|
||||||
[dependencies.lazy_static]
|
[dependencies.lazy_static]
|
||||||
version = "1.0"
|
version = "1.4.0"
|
||||||
features = ["spin_no_std"]
|
features = ["spin_no_std"]
|
||||||
|
@ -25,7 +25,7 @@ pub fn init_heap(
|
|||||||
.allocate_frame()
|
.allocate_frame()
|
||||||
.ok_or(MapToError::FrameAllocationFailed)?;
|
.ok_or(MapToError::FrameAllocationFailed)?;
|
||||||
let flags = PageTableFlags::PRESENT | PageTableFlags::WRITABLE;
|
let flags = PageTableFlags::PRESENT | PageTableFlags::WRITABLE;
|
||||||
mapper.map_to(page, frame, flags, frame_allocator)?.flush();
|
unsafe {mapper.map_to(page, frame, flags, frame_allocator)}?.flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -39,7 +39,7 @@ extern "x86-interrupt" fn double_fault_handler(sf: &mut InterruptStackFrame, e:
|
|||||||
let error_code: u64;
|
let error_code: u64;
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
asm!("push rax" :::: "intel");
|
llvm_asm!("push rax" :::: "intel");
|
||||||
let s = sf as *mut InterruptStackFrame;
|
let s = sf as *mut InterruptStackFrame;
|
||||||
stack_frame = &mut *((s as *mut u64).offset(1) as *mut InterruptStackFrame);
|
stack_frame = &mut *((s as *mut u64).offset(1) as *mut InterruptStackFrame);
|
||||||
error_code = *(&e as *const u64).offset(1);
|
error_code = *(&e as *const u64).offset(1);
|
||||||
@ -71,7 +71,7 @@ extern "x86-interrupt" fn page_fault_handler(sf: &mut InterruptStackFrame, e: Pa
|
|||||||
use x86_64::registers::control::Cr2;
|
use x86_64::registers::control::Cr2;
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
asm!("push rax" :::: "intel");
|
llvm_asm!("push rax" :::: "intel");
|
||||||
let s = sf as *mut InterruptStackFrame;
|
let s = sf as *mut InterruptStackFrame;
|
||||||
stack_frame = &mut *((s as *mut u64).offset(1) as *mut InterruptStackFrame);
|
stack_frame = &mut *((s as *mut u64).offset(1) as *mut InterruptStackFrame);
|
||||||
error_code = *(&e as *const PageFaultErrorCode).offset(1) as PageFaultErrorCode;
|
error_code = *(&e as *const PageFaultErrorCode).offset(1) as PageFaultErrorCode;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#![test_runner(crate::test_runner)]
|
#![test_runner(crate::test_runner)]
|
||||||
#![reexport_test_harness_main = "test_main"]
|
#![reexport_test_harness_main = "test_main"]
|
||||||
#![feature(abi_x86_interrupt)]
|
#![feature(abi_x86_interrupt)]
|
||||||
#![feature(asm)]
|
#![feature(llvm_asm)]
|
||||||
#![feature(alloc_error_handler)]
|
#![feature(alloc_error_handler)]
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
|
|
||||||
|
@ -175,13 +175,13 @@ fn kernel_main(boot_info: &'static BootInfo) -> ! {
|
|||||||
})
|
})
|
||||||
{
|
{
|
||||||
//serial_println!("Mapping page {:x} on frame {:?}", page, frame);
|
//serial_println!("Mapping page {:x} on frame {:?}", page, frame);
|
||||||
mapper
|
unsafe {mapper
|
||||||
.map_to(
|
.map_to(
|
||||||
Page::<Size4KiB>::containing_address(VirtAddr::new(page)),
|
Page::<Size4KiB>::containing_address(VirtAddr::new(page)),
|
||||||
unsafe { UnusedPhysFrame::new(frame) },
|
frame,
|
||||||
PageTableFlags::PRESENT | PageTableFlags::WRITABLE,
|
PageTableFlags::PRESENT | PageTableFlags::WRITABLE,
|
||||||
&mut frame_allocator,
|
&mut frame_allocator,
|
||||||
)
|
)}
|
||||||
.expect("Failed to map the experiment buffer")
|
.expect("Failed to map the experiment buffer")
|
||||||
.flush();
|
.flush();
|
||||||
let phys = mapper.translate_addr(VirtAddr::new(page));
|
let phys = mapper.translate_addr(VirtAddr::new(page));
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
use x86_64::{
|
use x86_64::{
|
||||||
structures::paging::{
|
structures::paging::{
|
||||||
FrameAllocator, Mapper, OffsetPageTable, Page, PageTable, PhysFrame, Size4KiB,
|
FrameAllocator, Mapper, OffsetPageTable, Page, PageTable, PhysFrame, Size4KiB,
|
||||||
UnusedPhysFrame,
|
|
||||||
},
|
},
|
||||||
PhysAddr, VirtAddr,
|
PhysAddr, VirtAddr,
|
||||||
};
|
};
|
||||||
@ -46,10 +45,9 @@ pub fn create_example_mapping(
|
|||||||
use x86_64::structures::paging::PageTableFlags as Flags;
|
use x86_64::structures::paging::PageTableFlags as Flags;
|
||||||
|
|
||||||
let frame = PhysFrame::containing_address(PhysAddr::new(0xb8000));
|
let frame = PhysFrame::containing_address(PhysAddr::new(0xb8000));
|
||||||
let not_really_unused_frame = unsafe { UnusedPhysFrame::new(frame) };
|
|
||||||
let flags = Flags::PRESENT | Flags::WRITABLE;
|
let flags = Flags::PRESENT | Flags::WRITABLE;
|
||||||
|
|
||||||
let map_to_result = mapper.map_to(page, not_really_unused_frame, flags, frame_allocator);
|
let map_to_result = unsafe {mapper.map_to(page, frame, flags, frame_allocator)};
|
||||||
map_to_result.expect("map_to failed").flush();
|
map_to_result.expect("map_to failed").flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,9 +85,9 @@ impl BootInfoFrameAllocator {
|
|||||||
|
|
||||||
// We only allocate 4k pages
|
// We only allocate 4k pages
|
||||||
unsafe impl FrameAllocator<Size4KiB> for BootInfoFrameAllocator {
|
unsafe impl FrameAllocator<Size4KiB> for BootInfoFrameAllocator {
|
||||||
fn allocate_frame(&mut self) -> Option<UnusedPhysFrame> {
|
fn allocate_frame(&mut self) -> Option<PhysFrame> {
|
||||||
let frame = self.usable_frames().nth(self.next);
|
let frame = self.usable_frames().nth(self.next);
|
||||||
self.next += 1;
|
self.next += 1;
|
||||||
frame.map(|f| unsafe { UnusedPhysFrame::new(f) })
|
frame
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,5 @@ volatile = "0.2.6"
|
|||||||
spin = "0.5.2"
|
spin = "0.5.2"
|
||||||
|
|
||||||
[dependencies.lazy_static]
|
[dependencies.lazy_static]
|
||||||
version = "1.0"
|
version = "1.4.0"
|
||||||
features = ["spin_no_std"]
|
features = ["spin_no_std"]
|
||||||
|
Loading…
Reference in New Issue
Block a user