Skip to content

Commit 07a6423

Browse files
kianmengAndy-Python-Programmer
authored andcommitted
Fix typos
Found via: - `codespell -S patches,bundled -L crate,struc,inout,statics,ist,ser,doas` - `typos --format brief`.
1 parent 967eaea commit 07a6423

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+149
-149
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ No, Aero runs its own kernel that does *not* originate from Linux and does not s
3434
# Goals
3535

3636
* Creating a modern, safe, beautiful and fast operating system.
37-
* Targetting modern 64-bit architectures and CPU features.
37+
* Targeting modern 64-bit architectures and CPU features.
3838
* Good source-level compatibility with Linux so we can port programs over easily.
3939
* Making a usable OS which can run on real hardware, not just on emulators or virtual machines.
4040

@@ -119,8 +119,8 @@ will not have any effect when you are simply checking or documenting the build.
119119
- `--debug` toggles off the release build flag when calling cargo.
120120

121121
**Summary**: If the `--debug` flag is not passed then it will build Aero in release mode
122-
and debug symbols will be avaliable. On the other hand, if the debug flag is passed
123-
then it will be built in debug mode and debug symbols will be still avaliable. By default
122+
and debug symbols will be available. On the other hand, if the debug flag is passed
123+
then it will be built in debug mode and debug symbols will be still available. By default
124124
Aero is built in release mode (with debug symbols) since it generates faster and smaller
125125
binaries which are easier to test.
126126
- `--no-run` prevents from running the built disk image in the emulator

aero.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def log_error(msg):
4949
import requests
5050
import xbstrap
5151
except ImportError:
52-
log_error('Please install required libraires using the following command:')
52+
log_error('Please install required libraries using the following command:')
5353
log_error(' - python3 -m pip install requests xbstrap')
5454

5555
sys.exit(0)
@@ -575,7 +575,7 @@ def is_kvm_supported() -> bool:
575575

576576
fd.close()
577577

578-
# KVM is not avaliable on Windows
578+
# KVM is not available on Windows
579579
return False
580580

581581

base-files/hello.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ _start:
1313
mov rax, 5 ; SYS_EXIT
1414
syscall
1515

16-
ud2 ; unreacheable
16+
ud2 ; unreachable
1717

1818
section .data
1919
msg db "Hello, world!", 0xa

bootstrap.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,22 +302,22 @@ tools:
302302
- args: |
303303
cat << EOF > config.toml
304304
changelog-seen = 2
305-
305+
306306
[llvm]
307307
targets = "X86"
308-
308+
309309
[build]
310310
target = ["x86_64-unknown-aero-system", "x86_64-unknown-linux-gnu"]
311311
build-dir = "@THIS_BUILD_DIR@"
312312
docs = false
313-
313+
314314
[install]
315315
prefix = "@PREFIX@"
316-
316+
317317
[rust]
318318
codegen-tests = false
319319
deny-warnings = false # work around rust-num-cpus warning
320-
320+
321321
[target.x86_64-unknown-linux-gnu]
322322
llvm-config = "@BUILD_ROOT@/tools/host-llvm/bin/llvm-config"
323323

src/aero_kernel/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fn main() -> Result<(), Box<dyn Error>> {
6363
Some(ext) if ext.eq(&OsString::from("inc")) => {
6464
let path = path
6565
.to_str()
66-
.expect("invalud UTF-8 for file path (skill issue)");
66+
.expect("invalid UTF-8 for file path (skill issue)");
6767
inc_files.push(path.to_string())
6868
}
6969

src/aero_kernel/src/acpi/fadt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub struct Fadt {
3434
// Field used in ACPI 1.0; no longer in use, for compatibility only
3535
reserved: u8,
3636

37-
pub preferred_power_managament: u8,
37+
pub preferred_power_management: u8,
3838
pub sci_interrupt: u16,
3939
pub smi_command_port: u32,
4040
pub acpi_enable: u8,

src/aero_kernel/src/acpi/mcfg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl Mcfg {
5757
///
5858
/// ## Notes
5959
/// Returns false if called before the ACPI tables were initialized.
60-
pub fn is_avaliable() -> bool {
60+
pub fn is_available() -> bool {
6161
MCFG.get().is_some()
6262
}
6363

src/aero_kernel/src/acpi/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
//! The ACPI (Advanced Configuration and Power Interface) tables help to gather the
21-
//! CPU, interrupt, and timer informations.
21+
//! CPU, interrupt, and timer information.
2222
//!
2323
//! **Notes**: <https://wiki.osdev.org/ACPI>
2424

src/aero_kernel/src/arch/aarch64/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ extern "C" fn arch_aero_main() -> ! {
5555
.expect("limine: invalid kernel file pointer");
5656

5757
// Before we start the initialization process, we need to make sure
58-
// the unwind info is avaliable; just in case if there is a kernel
58+
// the unwind info is available; just in case if there is a kernel
5959
// panic, it will be able to unwind the stack.
6060
crate::unwind::UNWIND_INFO.call_once(|| {
6161
use crate::unwind::UnwindInfo;
@@ -75,7 +75,7 @@ extern "C" fn arch_aero_main() -> ! {
7575

7676
// Now that we have unwind info, we can initialize the COM ports. This
7777
// will be used to print panic messages/logs before the debug renderer is
78-
// initialized to the serial output (if avaliable).
78+
// initialized to the serial output (if available).
7979
drivers::uart::init();
8080
logger::init();
8181

src/aero_kernel/src/arch/x86_64/apic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ pub struct LocalApic {
118118
impl LocalApic {
119119
/// Creates a new local APIC instance.
120120
///
121-
/// ## Saftey
121+
/// ## Safety
122122
/// The provided `address` points to a valid local APIC memory region and
123123
/// the `apic_type` is valid.
124124
fn new(address: VirtAddr, apic_type: ApicType) -> Self {

src/aero_kernel/src/arch/x86_64/controlregs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ bitflags::bitflags! {
7373
const FSGSBASE = 1 << 16;
7474
/// Enables process-context identifiers (PCIDs).
7575
const PCID = 1 << 17;
76-
/// Enables extendet processor state management instructions, including XGETBV and XSAVE.
76+
/// Enables extended processor state management instructions, including XGETBV and XSAVE.
7777
const OSXSAVE = 1 << 18;
7878
/// Prevents the execution of instructions that reside in pages accessible by user-mode
7979
/// software when the processor is in supervisor-mode.
@@ -149,7 +149,7 @@ bitflags::bitflags! {
149149
const ALIGNMENT_CHECK = 1 << 18;
150150
/// Enable the virtual-8086 mode.
151151
const VIRTUAL_8086_MODE = 1 << 17;
152-
/// Allows to restart an instruction following an instrucion breakpoint.
152+
/// Allows to restart an instruction following an instruction breakpoint.
153153
const RESUME_FLAG = 1 << 16;
154154
/// Used by `iret` in hardware task switch mode to determine if current task is nested.
155155
const NESTED_TASK = 1 << 14;

src/aero_kernel/src/arch/x86_64/gdt.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ pub fn init_boot() {
316316
}
317317
}
318318

319-
pub fn get_task_state_segement() -> &'static mut Tss {
319+
pub fn get_task_state_segment() -> &'static mut Tss {
320320
&mut get_kpcr().tss
321321
}
322322

@@ -328,7 +328,7 @@ static STK: [u8; 4096 * 16] = [0; 4096 * 16];
328328

329329
/// Initialize the *actual* GDT stored in TLS.
330330
///
331-
/// ## Saftey
331+
/// ## Safety
332332
/// The heap must be initialized before this function is called.
333333
pub fn init() {
334334
let gdt = unsafe {
@@ -346,7 +346,7 @@ pub fn init() {
346346
gdt.copy_from_slice(&GDT);
347347

348348
unsafe {
349-
let tss_ref = get_task_state_segement();
349+
let tss_ref = get_task_state_segment();
350350
let tss_ptr = tss_ref as *mut Tss;
351351

352352
gdt[GdtEntryType::TSS as usize].set_offset(tss_ptr as u32);

src/aero_kernel/src/arch/x86_64/interrupts/exceptions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ interrupt_exception!(fn debug() => "Debug");
4949
interrupt_exception!(fn non_maskable() => "Non Maskable");
5050
interrupt_exception!(fn overflow() => "Stack Overflow");
5151
interrupt_exception!(fn bound_range() => "Out of Bounds");
52-
interrupt_exception!(fn device_not_available() => "Device not Avaliable");
52+
interrupt_exception!(fn device_not_available() => "Device not Available");
5353
interrupt_exception!(fn double_fault() => "Double Fault");
5454
interrupt_exception!(fn invalid_tss() => "Invalid TSS");
5555
interrupt_exception!(fn segment_not_present() => "Segment not Present");

src/aero_kernel/src/arch/x86_64/interrupts/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl ApicController {
110110

111111
/// PIC (Programmable Interrupt Controller) manages hardware interrupts and sends
112112
/// them to the appropriate system interrupt for the x86 architecture. Since APIC
113-
/// has replaced PIC on modern systems, Aero disables PIC when APIC is avaliable.
113+
/// has replaced PIC on modern systems, Aero disables PIC when APIC is available.
114114
///
115115
/// ## Notes
116116
/// * <https://wiki.osdev.org/8259_PIC>

src/aero_kernel/src/arch/x86_64/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ extern "C" fn arch_aero_main() -> ! {
9090
.expect("limine: invalid kernel file pointer");
9191

9292
// Before we start the initialization process, we need to make sure
93-
// the unwind info is avaliable; just in case if there is a kernel
93+
// the unwind info is available; just in case if there is a kernel
9494
// panic, it will be able to unwind the stack.
9595
crate::unwind::UNWIND_INFO.call_once(|| {
9696
use crate::unwind::UnwindInfo;
@@ -110,7 +110,7 @@ extern "C" fn arch_aero_main() -> ! {
110110

111111
// Now that we have unwind info, we can initialize the COM ports. This
112112
// will be used to print panic messages/logs before the debug renderer is
113-
// initialized to the serial output (if avaliable).
113+
// initialized to the serial output (if available).
114114
drivers::uart::init();
115115
logger::init();
116116

src/aero_kernel/src/arch/x86_64/signals.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl SignalFrame {
6565
}
6666

6767
pub fn interrupt_check_signals(stack: &mut InterruptStack) {
68-
// SAFTEY: If this interrupt did not originate from userland then we cannot
68+
// SAFETY: If this interrupt did not originate from userland then we cannot
6969
// check for signals since the scheduler might not be initialized.
7070
if !stack.iret.is_user() {
7171
return;

src/aero_kernel/src/arch/x86_64/syscall_handler.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ global x86_64_syscall_handler
4747
;
4848
; (note: R12..R15, RBP, RBX are callee-preserved in C ABI)
4949
;
50-
; The instruction saves the RIP to RCX, cleares RFLAGS.RF then saves
50+
; The instruction saves the RIP to RCX, clears RFLAGS.RF then saves
5151
; RFLAGS to R11. Followed by, it loads the new SS, CS, and RIP from
5252
; previously programmed MSRs.
5353
;

src/aero_kernel/src/arch/x86_64/task.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl ArchTask {
130130
context_switch_rsp: VirtAddr::zero(),
131131

132132
// Since the IDLE task is a special kernel task, we use the kernel's
133-
// address space here and we also use the kernel privilage level here.
133+
// address space here and we also use the kernel privilege level here.
134134
address_space: AddressSpace::this(),
135135
user: false,
136136

@@ -484,7 +484,7 @@ pub fn arch_task_spinup(from: &mut ArchTask, to: &ArchTask) {
484484
unsafe {
485485
// Load the new thread's kernel stack pointer everywhere it's needed.
486486
let kstackp = to.context_switch_rsp.as_u64();
487-
super::gdt::get_task_state_segement().rsp[0] = kstackp;
487+
super::gdt::get_task_state_segment().rsp[0] = kstackp;
488488
io::wrmsr(io::IA32_SYSENTER_ESP, kstackp);
489489

490490
// switch to the new FS base.

src/aero_kernel/src/drivers/block/ahci.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,13 @@ impl DmaRequest {
253253
self.sector
254254
}
255255

256-
/// Copys the data from the DMA buffer into the given buffer.
256+
/// Copies the data from the DMA buffer into the given buffer.
257257
pub fn copy_into(&self, into: &mut [u8]) {
258258
let mut offset = 0x00; // Keep track of the offset
259-
let mut remaning = into.len(); // Keep track of the remaining data
259+
let mut remaining = into.len(); // Keep track of the remaining data
260260

261261
for buffer in self.buffer.iter() {
262-
let count = core::cmp::min(remaning, 0x2000);
262+
let count = core::cmp::min(remaining, 0x2000);
263263

264264
let buffer_pointer = buffer.start.as_hhdm_virt().as_ptr();
265265
let buffer = unsafe { core::slice::from_raw_parts::<u8>(buffer_pointer, count) };
@@ -268,7 +268,7 @@ impl DmaRequest {
268268
// calculated offset.
269269
into[offset..offset + count].copy_from_slice(buffer);
270270

271-
remaning -= count; // Subtract the size from the remaining size.
271+
remaining -= count; // Subtract the size from the remaining size.
272272
offset += count; // Add the size to the offset.
273273
}
274274
}
@@ -634,7 +634,7 @@ impl HbaPort {
634634
let ipm = status.interface_power_management();
635635
let dd = status.device_detection();
636636

637-
// Check if the port is active and is present. If thats the case
637+
// Check if the port is active and is present. If that's the case
638638
// we can start the AHCI port.
639639
if let (HbaPortDd::PresentAndE, HbaPortIpm::Active) = (dd, ipm) {
640640
log::trace!("ahci: enabling port {}", port);
@@ -881,7 +881,7 @@ impl AhciProtected {
881881
// Add the port to the ports array.
882882
self.ports[i] = Some(port);
883883

884-
// Workaround to get access to the HBA and still satify the
884+
// Workaround to get access to the HBA and still satisfy the
885885
// borrow checker.
886886
hba = self.hba_mem();
887887
}

src/aero_kernel/src/drivers/block/ide/registers.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl BaseDriveSelReg {
7979

8080
bitflags::bitflags! {
8181
pub struct BaseStatusReg: u8 {
82-
const ERR = 0b00000001; // Error occured
82+
const ERR = 0b00000001; // Error occurred
8383
const IDX = 0b00000010; // Index. Always set to zero
8484
const CORR = 0b00000100; // Corrected data. Always set to zero
8585
const DRQ = 0b00001000; // Set when the drive has PIO data to transfer, or is ready to accept PIO data
@@ -118,8 +118,8 @@ bitflags::bitflags! {
118118
const DMA_ACTIVE = 0b0000_0001;
119119
const DMA_FAILED = 0b0000_0010;
120120
const DISK_IRQ = 0b0000_0100;
121-
const MASTER_DMA_CAPPABLE = 0b0010_0000;
122-
const SLAVE_DMA_CAPPABLE = 0b0100_0000;
121+
const MASTER_DMA_CAPABLE = 0b0010_0000;
122+
const SLAVE_DMA_CAPABLE = 0b0100_0000;
123123
const NO_DMA_SHARING = 0b1000_0000;
124124
}
125125
}

src/aero_kernel/src/drivers/block/nvme/queue.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const fn calculate_doorbell_offset(queue_id: u16, multiplier: usize, dstrd: usiz
1212
}
1313

1414
pub struct Completion;
15-
pub struct Submisson;
15+
pub struct Submission;
1616

1717
pub trait QueueType {
1818
type Type;
@@ -24,7 +24,7 @@ impl QueueType for Completion {
2424
type Type = CompletionEntry;
2525
}
2626

27-
impl QueueType for Submisson {
27+
impl QueueType for Submission {
2828
const DOORBELL_OFFSET: usize = 0;
2929
type Type = Command;
3030
}
@@ -94,7 +94,7 @@ impl Queue<'_, Completion> {
9494
}
9595
}
9696

97-
impl Queue<'_, Submisson> {
97+
impl Queue<'_, Submission> {
9898
pub fn submit_command(&mut self, command: Command) {
9999
self.queue[self.index] = UnsafeCell::new(command);
100100

@@ -111,7 +111,7 @@ pub(super) struct QueuePair<'a> {
111111

112112
cid: u16,
113113

114-
submission: Queue<'a, Submisson>,
114+
submission: Queue<'a, Submission>,
115115
completion: Queue<'a, Completion>,
116116
}
117117

0 commit comments

Comments
 (0)