diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 703445a5..58816d1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -107,3 +107,9 @@ jobs: run: cargo semver-checks check-release -p bootloader_api - name: Check semver run: cargo semver-checks check-release + + typos: + name: Check spelling + runs-on: ubuntu-latest + steps: + - uses: crate-ci/typos@v1.0.4 diff --git a/Changelog.md b/Changelog.md index aafe509e..848af96b 100644 --- a/Changelog.md +++ b/Changelog.md @@ -202,7 +202,7 @@ See our [migration guides](docs/migration/README.md) for details. # 0.8.2 -- Change the way the kernel entry point is called to honor alignement ABI ([#81](https://github.com/rust-osdev/bootloader/pull/81)) +- Change the way the kernel entry point is called to honor alignment ABI ([#81](https://github.com/rust-osdev/bootloader/pull/81)) # 0.8.1 @@ -276,7 +276,7 @@ See our [migration guides](docs/migration/README.md) for details. - The level 4 page table is only recursively mapped if the `recursive_page_table` feature is enabled. - Rename `BootInfo::p4_table_addr` to `BootInfo::recursive_page_table_addr` (only present if the cargo feature is enabled) -- Remove `From` implemenations for x86_64 `FrameRange` +- Remove `From` implementations for x86_64 `FrameRange` - This only works when the versions align, so it is not a good general solution. - Remove unimplemented `BootInfo::package` field. - Make `BootInfo` non-exhaustive so that we can add additional fields later. diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 00000000..9cc193e5 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,4 @@ +[default.extend-words] +inout = "inout" +rela = "rela" +hda = "hda" diff --git a/common/src/entropy.rs b/common/src/entropy.rs index c38f22ef..93bf2b65 100644 --- a/common/src/entropy.rs +++ b/common/src/entropy.rs @@ -54,7 +54,7 @@ fn get_random_64(rd_rand: RdRand) -> Option { /// Gather entropy by reading the current time with the `RDTSC` instruction if it's available. /// -/// This function doesn't provide particulary good entropy, but it's better than nothing. +/// This function doesn't provide particularly good entropy, but it's better than nothing. fn tsc_entropy() -> [u8; 32] { let mut entropy = [0; 32]; @@ -77,7 +77,7 @@ fn tsc_entropy() -> [u8; 32] { /// Gather entropy by reading the current count of PIT channel 1-3. /// -/// This function doesn't provide particulary good entropy, but it's always available. +/// This function doesn't provide particularly good entropy, but it's always available. fn pit_entropy() -> [u8; 32] { let mut entropy = [0; 32]; diff --git a/common/src/legacy_memory_region.rs b/common/src/legacy_memory_region.rs index 10abe133..bf804e9c 100644 --- a/common/src/legacy_memory_region.rs +++ b/common/src/legacy_memory_region.rs @@ -104,7 +104,7 @@ where /// Converts this type to a boot info memory map. /// /// The memory map is placed in the given `regions` slice. The length of the given slice - /// must be at least the value returned by [`len`] pluse 1. + /// must be at least the value returned by [`len`] plus 1. /// /// The return slice is a subslice of `regions`, shortened to the actual number of regions. pub fn construct_memory_map( diff --git a/common/src/load_kernel.rs b/common/src/load_kernel.rs index 26798207..fd977f2b 100644 --- a/common/src/load_kernel.rs +++ b/common/src/load_kernel.rs @@ -213,7 +213,7 @@ where let mem_size = segment.mem_size(); let file_size = segment.file_size(); - // calculate virual memory region that must be zeroed + // calculate virtual memory region that must be zeroed let zero_start = virt_start_addr + file_size; let zero_end = virt_start_addr + mem_size; @@ -297,7 +297,7 @@ where /// /// Panics if a page is not mapped in `self.page_table`. fn copy_from(&self, addr: VirtAddr, buf: &mut [u8]) { - // We can't know for sure that contigous virtual address are contigous + // We can't know for sure that contiguous virtual address are contiguous // in physical memory, so we iterate of the pages spanning the // addresses, translate them to frames and copy the data. @@ -334,7 +334,7 @@ where let start_phys_addr = phys_addr.start_address() + start_offset_in_frame; // These are the offsets from the start address. These correspond - // to the destionation indices in `buf`. + // to the destination indices in `buf`. let start_offset_in_buf = Step::steps_between(&addr, &start_copy_address).unwrap(); // Calculate the source slice. @@ -364,7 +364,7 @@ where /// /// Panics if a page is not mapped in `self.page_table`. unsafe fn copy_to(&mut self, addr: VirtAddr, buf: &[u8]) { - // We can't know for sure that contigous virtual address are contigous + // We can't know for sure that contiguous virtual address are contiguous // in physical memory, so we iterate of the pages spanning the // addresses, translate them to frames and copy the data. @@ -401,7 +401,7 @@ where let start_phys_addr = phys_addr.start_address() + start_offset_in_frame; // These are the offsets from the start address. These correspond - // to the destionation indices in `buf`. + // to the destination indices in `buf`. let start_offset_in_buf = Step::steps_between(&addr, &start_copy_address).unwrap(); // Calculate the source slice. @@ -639,7 +639,7 @@ where // by a Load segment. check_is_in_load(elf_file, rela.get_offset())?; - // Calculate the destionation of the relocation. + // Calculate the destination of the relocation. let addr = self.virtual_address_offset + rela.get_offset(); let addr = VirtAddr::new(addr); diff --git a/src/disk_image.rs b/src/disk_image.rs index 6fb32598..0a2d6823 100644 --- a/src/disk_image.rs +++ b/src/disk_image.rs @@ -166,9 +166,9 @@ pub enum DiskImageError { /// An unexpected I/O error occurred #[error("I/O error: {message}:\n{error}")] Io { - /// Desciption of the failed I/O operation + /// Description of the failed I/O operation message: &'static str, - /// The I/O error that occured + /// The I/O error that occurred error: io::Error, }, }