File tree Expand file tree Collapse file tree 3 files changed +2
-12
lines changed
src/0x01/pkg/kernel/src/utils Expand file tree Collapse file tree 3 files changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -291,7 +291,7 @@ targets = [ "x86_64-unknown-uefi" ]
291
291
292
292
```json
293
293
{
294
- "rust-analyzer.cargo.target": "x86_64-unknown-none "
294
+ "rust-analyzer.cargo.target": "x86_64-unknown-uefi "
295
295
}
296
296
```
297
297
Original file line number Diff line number Diff line change @@ -219,16 +219,6 @@ unsafe {
219
219
220
220
## UART 与日志输出
221
221
222
- !!! tip "rust-analyzer 总是提示有重复 ` panic_handler ` 的错误?"
223
-
224
- 通过 VSCode 配置项:`rust-analyzer.cargo.target` 来指定目标平台,避免 rust-analyzer 猜测你的目标架构为 `uefi`:
225
-
226
- ```json
227
- {
228
- "rust-analyzer.cargo.target": "x86_64-unknown-none"
229
- }
230
- ```
231
-
232
222
### 串口驱动
233
223
234
224
在 [ UART 串口通信] ( ../../wiki/uart.md ) 部分中介绍了 UART 的基本原理,以及相关的基础知识。在这一部分实验中,你将会实现一个简单的串口驱动,并将其用于内核的日志输出。
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ pub fn print_internal(args: Arguments) {
64
64
}
65
65
66
66
#[ allow( dead_code) ]
67
- #[ cfg_attr( not ( test ) , panic_handler) ]
67
+ #[ cfg_attr( target_os = "none" , panic_handler) ]
68
68
fn panic ( info : & core:: panic:: PanicInfo ) -> ! {
69
69
// force unlock serial for panic output
70
70
unsafe { SERIAL . get ( ) . unwrap ( ) . force_unlock ( ) } ;
You can’t perform that action at this time.
0 commit comments