Compare commits

...

6 Commits

Author SHA1 Message Date
27Onion Nebell
bd3f5892d8 Merge b760d2914b into 4b023bb432 2024-01-05 10:05:36 -08:00
Philipp Oppermann
4b023bb432 Merge pull request #1262 from acyanbird/main
fix testing and paging introduction chapter errors in zh-CN translation
2024-01-05 18:00:30 +01:00
acyanbird
b1b35833d6 fix zh-CN paging introduction 2024-01-05 16:27:14 +00:00
acyanbird
34120a0409 fix zh-CN testing code err 2024-01-05 16:16:08 +00:00
27Onion Nebell
b760d2914b starting translation for esperanto 2022-10-08 16:09:34 +08:00
27Onion Nebell
4641b51239 starting translation for esperanto 2022-10-08 16:05:28 +08:00
5 changed files with 35 additions and 4 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -175,3 +175,21 @@ translated_content_notice = "이것은 커뮤니티 멤버가 <strong><a href=\"
translated_by = "번역한 사람 : "
translation_contributors = "With contributions from"
word_separator = "와"
# Esperanto
[languages.eo]
title = "Writing an OS in Rust"
description = "This blog series creates a small operating system in the Rust programming language. Each post is a small tutorial and includes all needed code."
[languages.eo.translations]
lang_name = "Esperanto"
toc = "Enhavtabelo"
all_posts = "« Ĉiuj Afiŝoj"
comments = "Komentoj"
comments_notice = "Bonvolu lasi viajn komentojn en la Angla se eble."
readmore = "legu&nbsp;pli&nbsp;»"
not_translated = "(Ĉi tiu afiŝo ankoraŭ ne estas tradukita. )"
translated_content = "Tradukita Enhavo:"
translated_content_notice = "Ĉi tiu estas komunuma traduko de la <strong><a href=\"_original.permalink_\">_original.title_</a></strong> enhavo. Ĝi eble estas nekompleta, malmoderna aŭ enhavas erarojn. Bonvolu raporti ajnajn problemojn!!"
translated_by = "Traduko de"
translation_contributors = "Kun kontribuoj de"
word_separator = "kaj"

13
blog/content/_index.eo.md Normal file
View File

@@ -0,0 +1,13 @@
+++
template = "edition-2/index.html"
+++
<h1 style="visibility: hidden; height: 0px; margin: 0px; padding: 0px;">Skribas OS en Rust</h1>
<div class="front-page-introduction">
Ĉi tiu blogserio kreas malgrandan operaciumon (OS) en la [Rust programlingvo](https://www.rust-lang.org/). Ĉiu afiŝo estas malgranda lernilo kaj inkluzivas la tutan bezonatan kodon, do vi povas sekvi se vi volas. La fontkodo ankaŭ haveblas en la responda [Github-deponejo](https://github.com/phil-opp/blog_os).
Plej Lasta Afiŝo: <!-- latest-post -->
</div>

View File

@@ -989,7 +989,7 @@ harness = false
#![no_main]
use core::panic::PanicInfo;
use blog_os::{QemuExitCode, exit_qemu, serial_println};
use blog_os::{QemuExitCode, exit_qemu, serial_println, serial_print};
#[no_mangle]
pub extern "C" fn _start() -> ! {

View File

@@ -149,7 +149,7 @@ x86_64 平台使用4级页表页大小为4KiB无论层级每个页表
![Bits 012 are the page offset, bits 1221 the level 1 index, bits 2130 the level 2 index, bits 3039 the level 3 index, and bits 3948 the level 4 index](x86_64-table-indices-from-address.svg)
我们可以看到,每个表索引号占据9个字节,这当然是有道理的,每个表都有 2^9 = 512 个条目低12位用来表示内存页的偏移量2^12 bytes = 4KiB而上文提到页大小为4KiB。第48-64位毫无用处这也就意味着 x86_64 并非真正的64位因为它实际上支持48位地址。
我们可以看到,每个表索引号占据 9 个比特,这当然是有道理的,每个表都有 2^9 = 512 个条目低12位用来表示内存页的偏移量2^12 bytes = 4KiB而上文提到页大小为4KiB。第 48-64 位毫无用处,这也就意味着 x86_64 并非真正的 64 位,因为它实际上支持 48 位地址。
[5-level page table]: https://en.wikipedia.org/wiki/Intel_5-level_paging
@@ -191,7 +191,7 @@ x86_64 平台使用4级页表页大小为4KiB无论层级每个页表
- 1个4级页表
- 512个3级页表因为4级页表可以有512个条目
- 512*512个2级页表因为每个3级页表可以有512个条目
- 512*512*512个1级页表因为每个2级页表可以有512个条目
- 512\*512\*512个1级页表因为每个2级页表可以有512个条目
### 页表格式
@@ -225,7 +225,7 @@ pub struct PageTable {
| 63 | no execute | 禁止在该页中运行代码EFER寄存器中的NXE比特位必须一同被设置 |
我们可以看到仅1251位会用于存储页帧地址或页表地址其余比特都用于存储标志位或由操作系统自由使用。
其原因就是该地址总是指向一个4096比特对齐的地址、页表或者页帧的起始地址。
其原因就是该地址总是指向一个4096字节对齐的地址、页表或者页帧的起始地址。
这也就意味着0-11位始终为0没有必要存储这些东西硬件层面在使用该地址之前也会将这12位比特设置为052-63位同理因为x86_64平台仅支持52位物理地址类似于上文中提到的仅支持48位虚拟地址的原因
进一步说明一下可用的标志位: