Skip to content

Commit 4694db8

Browse files
committed
chore: upgrade rust version
1 parent 23f4f63 commit 4694db8

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

docs/wiki/linux.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Linux 是一个开源的类 Unix 操作系统内核,它是一个典型的多
88

99
## 安装 Linux 系统
1010

11-
Linux 有许多发行版,这里出于环境一致性考虑,推荐使用 Ubuntu 22.04。
11+
Linux 有许多发行版,这里出于环境一致性考虑,推荐使用 Ubuntu 24.04。
1212

1313
其他发行版(如 Debian,Arch,Kali)也可以满足实验需求,但**请注意内核版本、QEMU 版本都不应低于本次实验的参考标准**
1414

@@ -84,9 +84,27 @@ wsl --install -d Ubuntu
8484

8585
在安装完成后,请使用如下命令,确保你的相关软件包**不低于**如下标准:
8686

87+
对于 Ubuntu 24.04:
88+
89+
```bash
90+
$ rustc --version
91+
rustc 1.79.0 (129f3b996 2024-06-10)
92+
93+
$ qemu-system-x86_64 --version
94+
QEMU emulator version 8.2.2 (Debian 1:8.2.2+ds-0ubuntu1)
95+
96+
$ gcc --version
97+
gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
98+
99+
$ gdb --version
100+
GNU gdb (Ubuntu 15.0.50.20240403-0ubuntu1) 15.0.50.20240403-git
101+
```
102+
103+
对于 Ubuntu 22.04:
104+
87105
```bash
88106
$ rustc --version
89-
rustc 1.76.0 (07dca489a 2024-02-04)
107+
rustc 1.79.0 (129f3b996 2024-06-10)
90108
91109
$ qemu-system-x86_64 --version
92110
QEMU emulator version 6.2.0 (Debian 1:6.2+dfsg-2ubuntu6.15)

src/0x02/pkg/kernel/src/memory/frames.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ guard_access_fn! {
88
pub get_frame_alloc(FRAME_ALLOCATOR: BootInfoFrameAllocator)
99
}
1010

11-
type BootInfoFrameIter = impl Iterator<Item = PhysFrame>;
11+
type BootInfoFrameIter = Box<dyn Iterator<Item = PhysFrame> + Send>;
1212

1313
/// A FrameAllocator that returns usable frames from the bootloader's memory map.
1414
pub struct BootInfoFrameAllocator {
@@ -54,13 +54,15 @@ impl FrameDeallocator<Size4KiB> for BootInfoFrameAllocator {
5454
}
5555

5656
unsafe fn create_frame_iter(memory_map: &MemoryMap) -> BootInfoFrameIter {
57-
memory_map
57+
let iter = memory_map
5858
.clone()
5959
.into_iter()
6060
// get usable regions from memory map
6161
.filter(|r| r.ty == MemoryType::CONVENTIONAL)
6262
// align to page boundary
6363
.flat_map(|r| (0..r.page_count).map(move |v| (v * 4096 + r.phys_start)))
6464
// create `PhysFrame` types from the start addresses
65-
.map(|addr| PhysFrame::containing_address(PhysAddr::new(addr)))
65+
.map(|addr| PhysFrame::containing_address(PhysAddr::new(addr)));
66+
67+
Box::new(iter)
6668
}

0 commit comments

Comments
 (0)