File tree Expand file tree Collapse file tree 2 files changed +25
-5
lines changed
src/0x02/pkg/kernel/src/memory Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ Linux 是一个开源的类 Unix 操作系统内核,它是一个典型的多
8
8
9
9
## 安装 Linux 系统
10
10
11
- Linux 有许多发行版,这里出于环境一致性考虑,推荐使用 Ubuntu 22 .04。
11
+ Linux 有许多发行版,这里出于环境一致性考虑,推荐使用 Ubuntu 24 .04。
12
12
13
13
其他发行版(如 Debian,Arch,Kali)也可以满足实验需求,但** 请注意内核版本、QEMU 版本都不应低于本次实验的参考标准** 。
14
14
@@ -84,9 +84,27 @@ wsl --install -d Ubuntu
84
84
85
85
在安装完成后,请使用如下命令,确保你的相关软件包** 不低于** 如下标准:
86
86
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
+
87
105
` ` ` bash
88
106
$ rustc --version
89
- rustc 1.76 .0 (07dca489a 2024-02-04 )
107
+ rustc 1.79 .0 (129f3b996 2024-06-10 )
90
108
91
109
$ qemu-system-x86_64 --version
92
110
QEMU emulator version 6.2.0 (Debian 1:6.2+dfsg-2ubuntu6.15)
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ guard_access_fn! {
8
8
pub get_frame_alloc( FRAME_ALLOCATOR : BootInfoFrameAllocator )
9
9
}
10
10
11
- type BootInfoFrameIter = impl Iterator < Item = PhysFrame > ;
11
+ type BootInfoFrameIter = Box < dyn Iterator < Item = PhysFrame > + Send > ;
12
12
13
13
/// A FrameAllocator that returns usable frames from the bootloader's memory map.
14
14
pub struct BootInfoFrameAllocator {
@@ -54,13 +54,15 @@ impl FrameDeallocator<Size4KiB> for BootInfoFrameAllocator {
54
54
}
55
55
56
56
unsafe fn create_frame_iter ( memory_map : & MemoryMap ) -> BootInfoFrameIter {
57
- memory_map
57
+ let iter = memory_map
58
58
. clone ( )
59
59
. into_iter ( )
60
60
// get usable regions from memory map
61
61
. filter ( |r| r. ty == MemoryType :: CONVENTIONAL )
62
62
// align to page boundary
63
63
. flat_map ( |r| ( 0 ..r. page_count ) . map ( move |v| ( v * 4096 + r. phys_start ) ) )
64
64
// 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)
66
68
}
You can’t perform that action at this time.
0 commit comments