Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b836655

Browse files
More link.ld -> kernel.ld renaming
1 parent 6e3051e commit b836655

File tree

6 files changed

+26
-25
lines changed

6 files changed

+26
-25
lines changed

‎01_wait_forever/README.CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
- `nm`: 检查符号。
1515
- 代码按照 `kernel`, `arch``BSP` (板级支持包)的形式组织。
1616
- 条件编译会根据用户提供的参数编译各自的 `arch``BSP` 的内容。
17-
- 自定义 `link.ld` 链接脚本.
17+
- 自定义 `kernel.ld` 链接脚本.
1818
- 载入地址为 `0x80_000`
1919
- 目前仅有 `.text` 小节(section)。
2020
- `main.rs`: 重要的 [inner attributes]:

‎01_wait_forever/README.ES.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,37 @@
99
## Compilar
1010

1111
* El archivo `Makefile` permite ejecutar:
12-
12+
1313
* `doc`: Genera la documentación.
14-
14+
1515
* `qemu`: Ejecutar el kernel en QEMU.
16-
16+
1717
* `clippy`: Analiza el código y sugiere mejoras.
18-
18+
1919
* `clean`: Elimina todos los archivos generados durante la compilación, etc.
20-
20+
2121
* `readelf`: Inspecciona el archivo `ELF` de salida.
22-
23-
* `objdump`: Inspecciona el ensamblador.
24-
22+
23+
* `objdump`: Inspecciona el ensamblador.
24+
2525
* `nm`: Inspecciona los símbolos.
2626

2727
## Código a revisar
2828

29-
* El script para enlazado específico para la `BSP` llamado `link.ld`.
30-
29+
* El script para enlazado específico para la `BSP` llamado `kernel.ld`.
30+
3131
* Carga la dirección en `0x8_0000`.
32-
32+
3333
* Solo la sección `.text`.
3434

3535
* `main.rs`: [Atributos internos](https://doc.rust-lang.org/reference/attributes.html) importantes:
36-
36+
3737
* `#![no_std]`, `#![no_main]`.
3838

39-
* `boot.s`: La función de ensamblador `_start()` que inicia `wfe` (Wait For Event / Esperar Hasta Un Evento), detiene todos los núcleos del procesador que están ejecutando `_start()`.
39+
* `boot.s`: La función de ensamblador `_start()` que inicia `wfe` (Wait For Event / Esperar Hasta Un Evento), detiene todos los núcleos del procesador que están ejecutando `_start()`.
4040

4141
* Tenemos que definir una función que funcione como `#[panic_handler]` (manejador de pánico) para que el compilador no nos cause problemas.
42-
42+
4343
* Hazla `unimplemented!()` porque se eliminará ya que no está siendo usada.
4444

4545
## Pruébalo

‎02_runtime_init/README.ES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
## Adiciones importantes
1010

11-
* Adiciones importantes al script `link.ld`:
11+
* Adiciones importantes al script `kernel.ld`:
1212

1313
* Nuevas secciones: `.rodata`, `.got`, `.data`, `.bss`.
1414

‎06_uart_chainloader/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ at the source code changes.
1717

1818
The gist of it is that in `boot.s`, we are writing a piece of [position independent code] which
1919
automatically determines where the firmware has loaded the binary (`0x8_0000`), and where it was
20-
linked to (`0x200_0000`, see `link.ld`). The binary then copies itself from loaded to linked address
21-
(aka "relocating" itself), and then jumps to the relocated version of `_start_rust()`.
20+
linked to (`0x200_0000`, see `kernel.ld`). The binary then copies itself from loaded to linked
21+
address (aka "relocating" itself), and then jumps to the relocated version of `_start_rust()`.
2222

2323
Since the chainloader has put itself "out of the way" now, it can now receive another kernel binary
2424
from the `UART` and copy it to the standard load address of the RPi firmware at `0x8_0000`. Finally,
@@ -27,8 +27,9 @@ from SD card all along.
2727

2828
Please bear with me until I find the time to write it all down here elaborately. For the time being,
2929
please see this tutorial as an enabler for a convenience feature that allows booting the following
30-
tutorials in a quick manner. _For those keen to get a deeper understanding, it could make sense to skip forward to [Chapter 15](../15_virtual_mem_part3_precomputed_tables) and read the first half of the README,
31-
where `Load Address != Link Address` is discussed_.
30+
tutorials in a quick manner. _For those keen to get a deeper understanding, it could make sense to
31+
skip forward to [Chapter 15](../15_virtual_mem_part3_precomputed_tables) and read the first half of
32+
the README, where `Load Address != Link Address` is discussed_.
3233

3334
[position independent code]: https://en.wikipedia.org/wiki/Position-independent_code
3435

‎10_virtual_mem_part1_identity_mapping/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* [Generic Kernel code: `memory/mmu.rs`](#generic-kernel-code-memorymmurs)
1515
* [BSP: `bsp/raspberrypi/memory/mmu.rs`](#bsp-bspraspberrypimemorymmurs)
1616
* [AArch64: `_arch/aarch64/memory/*`](#aarch64-_archaarch64memory)
17-
* [`link.ld`](#linkld)
17+
* [`kernel.ld`](#kernelld)
1818
- [Address translation examples](#address-translation-examples)
1919
* [Address translation using a 64 KiB page descriptor](#address-translation-using-a-64-kib-page-descriptor)
2020
- [Zero-cost abstraction](#zero-cost-abstraction)
@@ -222,7 +222,7 @@ enables caching for data and instructions.
222222
[Translation Control Register - EL1]: https://docs.rs/crate/cortex-a/5.1.2/source/src/regs/tcr_el1.rs
223223
[System Control Register - EL1]: https://docs.rs/crate/cortex-a/5.1.2/source/src/regs/sctlr_el1.rs
224224
225-
### `link.ld`
225+
### `kernel.ld`
226226
227227
We need to align the `code` segment to `64 KiB` so that it doesn't overlap with the next section
228228
that needs read/write attributes instead of read/execute attributes:

‎15_virtual_mem_part3_precomputed_tables/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Here are the compilation steps and the corresponding `objdump` for `AArch64`:
118118

119119
```console
120120
$ clang --target=aarch64-none-elf -Iinclude -Wall -c start.c -o start.o
121-
$ ld.lld start.o -T link.ld -o example.elf
121+
$ ld.lld start.o -T kernel.ld -o example.elf
122122
```
123123

124124
```c-objdump
@@ -326,7 +326,7 @@ space:
326326

327327
```console
328328
$ clang --target=aarch64-none-elf -Iinclude -Wall -fpic -c start.c -o start.o
329-
$ ld.lld start.o -T link.ld -o example.elf
329+
$ ld.lld start.o -T kernel.ld -o example.elf
330330
```
331331

332332
```c-objdump
@@ -473,7 +473,7 @@ the precompute use-case. The additional `#[no_mangle]` is added because we will
473473
symbol from the `translation table tool`, and this is easier with unmangled names.
474474

475475
In the `BSP` code, there is also a new file called `kernel_virt_addr_space_size.ld`, which contains
476-
the kernel's virtual address space size. This file gets included in both, the `link.ld` linker
476+
the kernel's virtual address space size. This file gets included in both, the `kernel.ld` linker
477477
script and `mmu.rs`. We need this value both as a symbol in the kernel's ELF (for the `translation
478478
table tool` to parse it later) and as a constant in the `Rust` code. This inclusion approach is just
479479
a convenience hack that turned out working well.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /