diff --git a/framework/aster-frame/src/arch/x86/cpu.rs b/framework/aster-frame/src/arch/x86/cpu.rs index 16997064..fb2ad119 100644 --- a/framework/aster-frame/src/arch/x86/cpu.rs +++ b/framework/aster-frame/src/arch/x86/cpu.rs @@ -309,7 +309,7 @@ impl UserContextApiInternal for UserContext { } } -/// As Osdev Wiki defines(https://wiki.osdev.org/Exceptions): +/// As Osdev Wiki defines(): /// CPU exceptions are classified as: /// /// Faults: These can be corrected and the program may continue as if nothing happened. diff --git a/framework/aster-frame/src/arch/x86/device/serial.rs b/framework/aster-frame/src/arch/x86/device/serial.rs index 30ae618a..e64f3cb0 100644 --- a/framework/aster-frame/src/arch/x86/device/serial.rs +++ b/framework/aster-frame/src/arch/x86/device/serial.rs @@ -7,7 +7,7 @@ use crate::arch::x86::device::io_port::{IoPort, ReadWriteAccess, WriteOnlyAccess /// A serial port. /// /// Serial ports are a legacy communications port common on IBM-PC compatible computers. -/// Ref: https://wiki.osdev.org/Serial_Ports +/// Ref: pub struct SerialPort { pub data: IoPort, pub int_en: IoPort, diff --git a/framework/aster-frame/src/arch/x86/timer/pit.rs b/framework/aster-frame/src/arch/x86/timer/pit.rs index c8151d5d..cc772d38 100644 --- a/framework/aster-frame/src/arch/x86/timer/pit.rs +++ b/framework/aster-frame/src/arch/x86/timer/pit.rs @@ -4,7 +4,7 @@ //! a prescaler and 3 independent frequency dividers. Each frequency divider has an output, which is //! used to allow the timer to control external circuitry (for example, IRQ 0). //! -//! Reference: https://wiki.osdev.org/Programmable_Interval_Timer +//! Reference: //! use crate::{ diff --git a/framework/aster-frame/src/boot/kcmdline.rs b/framework/aster-frame/src/boot/kcmdline.rs index 385d600e..d70345d9 100644 --- a/framework/aster-frame/src/boot/kcmdline.rs +++ b/framework/aster-frame/src/boot/kcmdline.rs @@ -5,7 +5,7 @@ //! The format of the Asterinas command line string conforms //! to the Linux kernel command line rules: //! -//! https://www.kernel.org/doc/html/v6.4/admin-guide/kernel-parameters.html +//! //! use alloc::{ diff --git a/framework/aster-frame/src/bus/pci/mod.rs b/framework/aster-frame/src/bus/pci/mod.rs index 47e26be2..328bb665 100644 --- a/framework/aster-frame/src/bus/pci/mod.rs +++ b/framework/aster-frame/src/bus/pci/mod.rs @@ -9,7 +9,7 @@ //! //! Use case: //! -//! ```rust norun +//! ```rust no_run //! #[derive(Debug)] //! pub struct PciDeviceA { //! common_device: PciCommonDevice, diff --git a/framework/aster-frame/src/trap/irq.rs b/framework/aster-frame/src/trap/irq.rs index a1e6b321..b265dadb 100644 --- a/framework/aster-frame/src/trap/irq.rs +++ b/framework/aster-frame/src/trap/irq.rs @@ -103,7 +103,7 @@ impl Drop for IrqLine { /// /// # Example /// -/// ``rust +/// ```rust /// use aster_frame::irq; /// /// { diff --git a/framework/libs/linux-bzimage/builder/src/pe_header.rs b/framework/libs/linux-bzimage/builder/src/pe_header.rs index f8848cd9..05a9afa0 100644 --- a/framework/libs/linux-bzimage/builder/src/pe_header.rs +++ b/framework/libs/linux-bzimage/builder/src/pe_header.rs @@ -3,10 +3,10 @@ //! Big zImage PE/COFF header generation. //! //! The definition of the PE/COFF header is in the Microsoft PE/COFF specification: -//! https://learn.microsoft.com/en-us/windows/win32/debug/pe-format +//! //! //! The reference to the Linux PE header definition: -//! https://github.com/torvalds/linux/blob/master/include/linux/pe.h +//! use std::{mem::size_of, ops::Range}; diff --git a/kernel/aster-nix/src/console.rs b/kernel/aster-nix/src/console.rs index 9368b593..3813a858 100644 --- a/kernel/aster-nix/src/console.rs +++ b/kernel/aster-nix/src/console.rs @@ -22,7 +22,7 @@ pub fn _print(args: Arguments) { VirtioConsolesPrinter.write_fmt(args).unwrap(); } -/// Copy from Rust std: https://github.com/rust-lang/rust/blob/master/library/std/src/macros.rs +/// Copied from Rust std: #[macro_export] macro_rules! print { ($($arg:tt)*) => {{ @@ -30,7 +30,7 @@ macro_rules! print { }}; } -/// Copy from Rust std: https://github.com/rust-lang/rust/blob/master/library/std/src/macros.rs +/// Copied from Rust std: #[macro_export] macro_rules! println { () => { diff --git a/kernel/aster-nix/src/net/iface/mod.rs b/kernel/aster-nix/src/net/iface/mod.rs index b40c21eb..59223be2 100644 --- a/kernel/aster-nix/src/net/iface/mod.rs +++ b/kernel/aster-nix/src/net/iface/mod.rs @@ -39,7 +39,7 @@ pub trait Iface: internal::IfaceInternal + Send + Sync { /// Bind a socket to the iface. So the packet for this socket will be dealt with by the interface. /// If port is None, the iface will pick up an empheral port for the socket. /// FIXME: The reason for binding socket and interface together is because there are limitations inside smoltcp. - /// See discussion at https://github.com/smoltcp-rs/smoltcp/issues/779. + /// See discussion at . fn bind_socket( &self, socket: Box, diff --git a/kernel/aster-nix/src/net/socket/util/shutdown_cmd.rs b/kernel/aster-nix/src/net/socket/util/shutdown_cmd.rs index 8eecdb4f..47a5b337 100644 --- a/kernel/aster-nix/src/net/socket/util/shutdown_cmd.rs +++ b/kernel/aster-nix/src/net/socket/util/shutdown_cmd.rs @@ -3,7 +3,7 @@ use crate::prelude::*; /// Shutdown types -/// From https://elixir.bootlin.com/linux/v6.0.9/source/include/linux/net.h +/// From #[repr(i32)] #[derive(Debug, Clone, Copy, PartialEq, Eq, TryFromInt)] #[allow(non_camel_case_types)] diff --git a/kernel/aster-nix/src/process/program_loader/elf/init_stack.rs b/kernel/aster-nix/src/process/program_loader/elf/init_stack.rs index 01064113..a5840974 100644 --- a/kernel/aster-nix/src/process/program_loader/elf/init_stack.rs +++ b/kernel/aster-nix/src/process/program_loader/elf/init_stack.rs @@ -2,7 +2,7 @@ //! This module defines the process initial stack. //! The process initial stack, contains arguments, environmental variables and auxiliary vectors -//! The data layout of init stack can be seen in Figure 3.9 in https://uclibc.org/docs/psABI-x86_64.pdf +//! The data layout of init stack can be seen in Figure 3.9 in use core::mem; diff --git a/kernel/aster-nix/src/util/net/options/mod.rs b/kernel/aster-nix/src/util/net/options/mod.rs index 3e8378cd..bb515425 100644 --- a/kernel/aster-nix/src/util/net/options/mod.rs +++ b/kernel/aster-nix/src/util/net/options/mod.rs @@ -24,7 +24,7 @@ //! //! First, the option should be added in the net module for the TCP socket. //! -//! ```rust norun +//! ```rust no_run //! impl_socket_option!(TcpNodelay(bool)); //! ``` //! @@ -32,15 +32,19 @@ //! in the utils module. These util functions can be shared if multiple options have the value //! of same type. //! -//! ```rust norun -//! impl ReadFromUser for bool { // content omitted here } -//! impl WriteFromUser for bool { // content omitted here } +//! ```rust compile_fail +//! impl ReadFromUser for bool { +//! // content omitted here +//! } +//! impl WriteFromUser for bool { +//! // content omitted here +//! } //! ``` //! //! At last, we can implement `RawSocketOption` for `TcpNodelay` so that it can be read/from //! user space. //! -//! ```rust norun +//! ```rust no_run //! impl_raw_socket_option!(TcpNodeley); //! ``` //! diff --git a/kernel/comps/virtio/src/device/input/mod.rs b/kernel/comps/virtio/src/device/input/mod.rs index 6a5d2315..5f9dae1c 100644 --- a/kernel/comps/virtio/src/device/input/mod.rs +++ b/kernel/comps/virtio/src/device/input/mod.rs @@ -35,7 +35,7 @@ use crate::transport::VirtioTransport; pub static DEVICE_NAME: &str = "Virtio-Input"; -/// Select value used for [`VirtIOInput::query_config_select()`]. +/// Select value used for [`device::InputDevice::query_config_select()`]. #[repr(u8)] #[derive(Debug, Clone, Copy)] pub enum InputConfigSelect { diff --git a/kernel/libs/aster-rights-proc/src/lib.rs b/kernel/libs/aster-rights-proc/src/lib.rs index 298d5823..2a3134b4 100644 --- a/kernel/libs/aster-rights-proc/src/lib.rs +++ b/kernel/libs/aster-rights-proc/src/lib.rs @@ -4,11 +4,11 @@ //! When use this crate, typeflags and typeflags-util should also be added as dependency. //! //! The require macro are used to ensure that an object has the enough capability to call the function. -//! The **require** macro can accept constraint [SomeRightSet] > [SomeRight], -//! which means the SomeRightSet should **contain** the SomeRight. -//! The **require** macro can also accept constraint [SomeRightSet] > [AnotherRightSet], -//! which means the SomeRightSet should **include** the AnotherRightSet. In this case, AnotherRightSet should be a **generic parameter**. -//! i.e., AnotherRightSet should occur the the generic param list of the function. +//! The **require** macro can accept constraint `SomeRightSet` > `SomeRight`, +//! which means the `SomeRightSet` should **contain** the `SomeRight`. +//! The **require** macro can also accept constraint `SomeRightSet` > `AnotherRightSet`, +//! which means the `SomeRightSet` should **include** the `AnotherRightSet`. In this case, `AnotherRightSet` should be a **generic parameter**. +//! i.e., `AnotherRightSet` should occur the the generic param list of the function. //! //! If there are multiple constraits, they can be seperated with `|`, which means all constraits should be satisfied. //! diff --git a/kernel/libs/aster-rights/src/lib.rs b/kernel/libs/aster-rights/src/lib.rs index 9c920455..96546ad6 100644 --- a/kernel/libs/aster-rights/src/lib.rs +++ b/kernel/libs/aster-rights/src/lib.rs @@ -55,7 +55,7 @@ pub type WriteOp = TRights![Write]; pub type FullOp = TRights![Read, Write, Dup]; /// Wrapper for TRights, used to bypass an error message from the Rust compiler, -/// the relevant issue is: https://github.com/rust-lang/rfcs/issues/2758 +/// the relevant issue is: /// /// Example: ///