Skip to content

Commit 7699320

Browse files
authored
Merge pull request #909 from 0xAX/link-checker
ci: add link-checker to check links for now in Boot
2 parents 6b88d77 + 5716f71 commit 7699320

File tree

8 files changed

+76
-12
lines changed

8 files changed

+76
-12
lines changed

.github/workflows/check-links.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: check links
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- master
9+
pull_request:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
check-links:
17+
name: check-links
18+
runs-on:
19+
- ubuntu-22.04
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v6
23+
24+
- name: Check links with lychee
25+
uses: lycheeverse/lychee-action@v2
26+
with:
27+
# Check README.md and all files in Booting directory
28+
args: |
29+
--verbose
30+
--no-progress
31+
--max-retries 3
32+
--timeout 20
33+
README.md
34+
'Booting/*.md'
35+
fail: true
36+
env:
37+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/generate-e-books.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
name: Generate e-books
22

33
on:
4-
pull_request:
5-
branches:
6-
- master
7-
workflow_dispatch: {} # For manual runs.
4+
workflow_dispatch: {}
85

96
jobs:
107
build-for-pr:

Booting/linux-bootstrap-1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ In real mode, the base address is normally formed by shifting the 16-bit segment
7676
'0xfffffff0'
7777
```
7878

79-
We got `0xFFFFFFF0`, which is 16 bytes below 4GB. This is the very first address where the CPU starts the execution after reset. This address has special name - [reset vector](https://en.wikipedia.org/wiki/Reset_vector). It is the memory location at which the CPU expects to find the first instruction to execute after reset. Usually it contains a [jump](https://en.wikipedia.org/wiki/JMP_%28x86_instruction%29) (`jmp`) instruction which points to the [BIOS](https://en.wikipedia.org/wiki/BIOS) or [UEFI](https://en.wikipedia.org/wiki/UEFI) entry point. For example, if we take a look at the [source code](https://github.com/coreboot/coreboot/blob/main/src/cpu/x86/reset16.S) of the [coreboot](https://www.coreboot.org/), we will see it there:
79+
We got `0xFFFFFFF0`, which is 16 bytes below 4GB. This is the very first address where the CPU starts the execution after reset. This address has special name - [reset vector](https://en.wikipedia.org/wiki/Reset_vector). It is the memory location at which the CPU expects to find the first instruction to execute after reset. Usually it contains a [jump](https://en.wikipedia.org/wiki/JMP_%28x86_instruction%29) (`jmp`) instruction which points to the [BIOS](https://en.wikipedia.org/wiki/BIOS) or [UEFI](https://en.wikipedia.org/wiki/UEFI) entry point. For example, if we take a look at the [source code](https://github.com/coreboot/coreboot/blob/main/src/cpu/x86/entry16.S) of the [coreboot](https://www.coreboot.org/), we will see it there:
8080

8181
<!-- https://raw.githubusercontent.com/coreboot/coreboot/refs/heads/main/src/cpu/x86/entry16.S#L155-L159 -->
8282
```assembly
@@ -180,7 +180,7 @@ From this point onwards, the BIOS hands control over to the bootloader.
180180

181181
## The Bootloader Stage
182182

183-
There are a number of different bootloaders that can boot Linux kernel, such as [GRUB 2](https://www.gnu.org/software/grub/), [syslinux](http://www.syslinux.org/wiki/index.php/The_Syslinux_Project), [systemd-boot](https://www.freedesktop.org/wiki/Software/systemd/systemd-boot/), and others. The Linux kernel has a [Boot protocol](https://github.com/torvalds/linux/blob/master/Documentation/arch/x86/boot.rst) which specifies the requirements for a bootloader to implement Linux support. In this chapter, we will take a short look how GRUB 2 does loading.
183+
There are a number of different bootloaders that can boot Linux kernel, such as [GRUB 2](https://www.gnu.org/software/grub/), [syslinux](http://www.syslinux.org/wiki/index.php/The_Syslinux_Project), [systemd-boot](https://github.com/ivandavidov/systemd-boot), and others. The Linux kernel has a [Boot protocol](https://github.com/torvalds/linux/blob/master/Documentation/arch/x86/boot.rst) which specifies the requirements for a bootloader to implement Linux support. In this chapter, we will take a short look how GRUB 2 does loading.
184184

185185
Continuing from where we left off - the BIOS has now selected a boot device, found its boot sector, loaded it into memory and passed control to the code located there. GRUB 2 bootloader consists of multiple [stages](https://www.gnu.org/software/grub/manual/grub/grub.html#Images). The first stage of the boot code is in the [boot.S](https://github.com/rhboot/grub2/blob/master/grub-core/boot/i386/pc/boot.S) source code file. Due to limited amount of space for the first boot sector, this code has only single goal - to load [core image](https://www.gnu.org/software/grub/manual/grub/html_node/Images.html) into memory and jump to it.
186186

Booting/linux-bootstrap-2.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,4 +497,5 @@ Here is the list of the links that you may find useful during reading of this ch
497497
- [BIOS interrupt](https://en.wikipedia.org/wiki/BIOS_interrupt_call)
498498
- [Intel SpeedStep](http://en.wikipedia.org/wiki/SpeedStep)
499499
- [APM](https://en.wikipedia.org/wiki/Advanced_Power_Management)
500-
- [EDD specification](http://www.t13.org/documents/UploadedDocuments/docs2004/d1572r3-EDD3.pdf)
500+
- [EDD](https://en.wikipedia.org/wiki/Enhanced_Disk_Drive)
501+
- [Previous part](linux-bootstrap-1.md)

Booting/linux-bootstrap-4.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ SYM_FUNC_START(startup_32)
185185
cli
186186
```
187187

188-
When the direction flag is clear, all string or copy-like operations used for copying data, like for example [stos](http://x86.renejeschke.de/html/file_module_x86_id_306.html) or [scas](http://x86.renejeschke.de/html/file_module_x86_id_287.html), will increment the index registers `esi` or `edi`. We need to clear the direction flag because later we will use string operations for tasks such as clearing space for page tables or copying data.
188+
When the direction flag is clear, all string or copy-like operations used for copying data, like for example [stos](https://www.felixcloutier.com/x86/stos:stosb:stosw:stosd:stosq) or [scas](https://www.felixcloutier.com/x86/scas:scasb:scasw:scasd), will increment the index registers `esi` or `edi`. We need to clear the direction flag because later we will use string operations for tasks such as clearing space for page tables or copying data.
189189

190190
The next instruction is to disable interrupts - `cli`. We have already seen it in the previous chapter. The interrupts are disabled "twice" because modern bootloaders can load the kernel starting from this point, but not only one that we have seen in the [first chapter](./linux-bootstrap-1.md).
191191

@@ -676,4 +676,4 @@ Here is the list of the links that you may find useful during reading of this ch
676676
- [Physical addresses](https://en.wikipedia.org/wiki/Physical_address)
677677
- [Model specific registers](http://en.wikipedia.org/wiki/Model-specific_register)
678678
- [Control registers](https://en.wikipedia.org/wiki/Control_register)
679-
- [Previous part](https://github.com/0xAX/linux-insides/blob/v4.16/Booting/linux-bootstrap-3.md)
679+
- [Previous part](linux-bootstrap-3.md)

Booting/linux-bootstrap-5.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,4 +499,4 @@ Here is the list of the links that you can find useful when reading this chapter
499499
- [Flat memory model](https://en.wikipedia.org/wiki/Flat_memory_model)
500500
- [Address space layout randomization](https://en.wikipedia.org/wiki/Address_space_layout_randomization)
501501
- [ELF](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format)
502-
- [Previous part](https://github.com/0xAX/linux-insides/blob/v4.16/Booting/linux-bootstrap-4.md)
502+
- [Previous part](linux-bootstrap-4.md)

Booting/linux-bootstrap-6.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ After these sanity checks, the decompressor code begins scanning the system's av
295295

296296
The scanning consists of three potential stages:
297297

298-
1. Scan the memory regions that are not preserved by the [KHO](https://docs.kernel.org/core-api/kho/concepts.html#kho-concepts).
298+
1. Scan the memory regions that are not preserved by the [KHO](https://docs.kernel.org/next/kho/concepts.html).
299299
2. Scan the memory regions presented by the [EFI](https://en.wikipedia.org/wiki/Uefi) memory map.
300300
3. Fallback to scanning the memory regions reported by the [e820](https://en.wikipedia.org/wiki/E820) BIOS service.
301301

@@ -418,4 +418,4 @@ The next chapter will be about kernel initialization and we will study the first
418418
- [e820](https://en.wikipedia.org/wiki/E820)
419419
- [Time Stamp Counter](https://en.wikipedia.org/wiki/Time_Stamp_Counter)
420420
- [rdrand instruction](https://en.wikipedia.org/wiki/RdRand)
421-
- [Previous part](./linux-bootstrap-5.md)
421+
- [Previous part](linux-bootstrap-5.md)

lychee.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Lychee link checker configuration
2+
# See https://github.com/lycheeverse/lychee for all options
3+
4+
# Maximum number of retries per link
5+
max_retries = 3
6+
7+
# Timeout per request in seconds
8+
timeout = 20
9+
10+
# Exclude these URLs from checking (regex patterns)
11+
exclude = [
12+
"twitter\\.com",
13+
"x\\.com",
14+
"osdev\\.org",
15+
"intel.com/*"
16+
]
17+
18+
# Accept status codes as valid
19+
accept = [
20+
200, # OK
21+
204, # No Content
22+
206, # Partial Content (for range requests)
23+
]
24+
25+
# User agent string
26+
user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
27+
28+
# Check external links
29+
scheme = ["https", "http"]

0 commit comments

Comments
 (0)