Skip to content

Commit

Permalink
update 2024年 03月 23日 星期六 12:40:01 CST
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrysisa committed Mar 23, 2024
1 parent 9e09690 commit 88d1c47
Show file tree
Hide file tree
Showing 247 changed files with 5,210 additions and 4,335 deletions.
4 changes: 4 additions & 0 deletions content/posts/operating-systems/deepin20.9.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ repost:
- **Vim**
- **VSCode Great Icons** 文件图标主题

{{< admonition question >}}
rust5-analyzer 插件可能会因为新版本要求 glibc 2.29 而导致启动失败,请参考这个 [issue](https://github.com/rust-lang/rust-analyzer/issues/11558) 来解决。
{{< /admonition >}}

## 终端和 Vim

新手教学文档:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "openEuler RISC-V 系统: QEMU 仿真和 Mugen 测试框架"
title: "openEuler RISC-V 系统: QEMU 仿真"
subtitle:
date: 2024-03-07T14:48:21+08:00
# draft: true
Expand All @@ -19,6 +19,7 @@ tags:
- openEuler
- QEMU
- Mugen
- Neofetch
categories:
- RISC-V
- Operating Systems
Expand Down Expand Up @@ -292,6 +293,19 @@ $ echo $?

我个人比较期待 RISC-V 配合 nommu 在嵌入式这类低功耗领域的发展,同时也对 [RISC-V Hypervisor Extension](https://riscv.org/wp-content/uploads/2017/12/Tue0942-riscv-hypervisor-waterman.pdf) 在虚拟化方面的发展感兴趣。

## Neofetch

根据 [neofetch wiki](https://github.com/dylanaraps/neofetch/wiki/Installation#latest-git-master-bleeding-edge) 从 git 拉取最新数据进行构建:

```bash
$ git clone https://github.com/dylanaraps/neofetch
$ cd neofetch
$ make install
$ neofetch
```

{{< image src="/images/oerv/openEuler-RISC-V-neofetch.png" >}}

## References

- openEuler RISC-V: [通过 QEMU 仿真 RISC-V 环境并启动 OpenEuler RISC-V 系统](https://github.com/openeuler-mirror/RISC-V/blob/master/doc/tutorials/vm-qemu-oErv.md)
Expand Down
32 changes: 32 additions & 0 deletions content/posts/rust/subtying-and-variance.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,38 @@ repost:
- cplusplus: [strtok](https://cplusplus.com/reference/cstring/strtok/)
- cppreference: [strtok](https://en.cppreference.com/w/cpp/string/byte/strtok)

### shortening lifetimes

影片大概 19 分时给出了为何 cargo test 失败的推导,个人觉得非常巧妙

```rs
pub fn strtok<'a>(s: &'a mut &'a str, delimiter: char) { ... }

let mut x = "hello world";
strtok(&mut x, ' ');
```

为了更直观地表示和函数 `strtok` 的返回值 lifetime 无关,这里将返回值先去掉了。在调用 `strtok` 时,编译器对于参数 `s` 的 lifetime 推导如下:

```
&'a mut &'a str
& mut x
&'a mut &'a str
& mut &'static str
&'a mut &'static str
& mut &'static str
&'static mut &'static str
& mut &'static str
&'static mut &'static str
&'static mut &'static str
```

所以 `strtok` 在接收参数 `s` 后 (通过传入 `&mut x`),会推导其 lifetime 为 static,这就会导致后面使用 `x` 的不可变引用 (`&x`) 时发生冲突。

## Documentations

这里列举视频中一些概念相关的 documentation
Expand Down
10 changes: 5 additions & 5 deletions docs/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<body data-header-desktop="sticky" data-header-mobile="auto"><script>(window.localStorage?.getItem('theme') ? localStorage.getItem('theme') === 'dark' : ('auto' === 'auto' ? window.matchMedia('(prefers-color-scheme: dark)').matches : 'auto' === 'dark')) && document.body.setAttribute('data-theme', 'dark');</script><div class="wrapper" data-page-style="normal"><header class="desktop animate__faster" id="header-desktop">
<div class="header-wrapper">
<div class="header-title">
<a href="/" title="KZnight&#39;s Blog"><img loading="lazy" src="/fixit.min.svg" alt="KZnight&#39;s Blog" data-title="KZnight&#39;s Blog" class="logo" style="background: url(/images/loading.min.svg) no-repeat center;" onload="this.title=this.dataset.title;for(const i of ['style', 'data-title','onerror','onload']){this.removeAttribute(i);}this.dataset.lazyloaded='';" onerror="this.title=this.dataset.title;for(const i of ['style', 'data-title','onerror','onload']){this.removeAttribute(i);}"/><span class="header-title-text">KZnight&#39;s Blog</span></a><span class="header-subtitle"></span></div>
<a href="/" title="KZnight&#39;s Blog"><img loading="lazy" src="/fixit.min.svg" data-title="KZnight&#39;s Blog" data-alt="KZnight&#39;s Blog" class="logo" style="background: url(/svg/loading.min.svg) no-repeat center;" onload="this.title=this.dataset.title;this.alt=this.dataset.alt;for(const i of ['style', 'data-title','data-alt','onerror','onload']){this.removeAttribute(i);}this.dataset.lazyloaded='';" onerror="this.title=this.dataset.title;this.alt=this.dataset.alt;for(const i of ['style', 'data-title','data-alt','onerror','onload']){this.removeAttribute(i);}"/><span class="header-title-text">KZnight&#39;s Blog</span></a><span class="header-subtitle"></span></div>
<nav>
<ul class="menu"><li class="menu-item">
<a
Expand Down Expand Up @@ -65,7 +65,7 @@
<div class="header-container">
<div class="header-wrapper">
<div class="header-title">
<a href="/" title="KZnight&#39;s Blog"><img loading="lazy" src="/fixit.min.svg" alt="/fixit.min.svg" data-title="/fixit.min.svg" class="logo" style="background: url(/images/loading.min.svg) no-repeat center;" onload="this.title=this.dataset.title;for(const i of ['style', 'data-title','onerror','onload']){this.removeAttribute(i);}this.dataset.lazyloaded='';" onerror="this.title=this.dataset.title;for(const i of ['style', 'data-title','onerror','onload']){this.removeAttribute(i);}"/><span class="header-title-text">KZnight&#39;s Blog</span></a><span class="header-subtitle"></span></div>
<a href="/" title="KZnight&#39;s Blog"><img loading="lazy" src="/fixit.min.svg" data-title="/fixit.min.svg" data-alt="/fixit.min.svg" class="logo" style="background: url(/svg/loading.min.svg) no-repeat center;" onload="this.title=this.dataset.title;this.alt=this.dataset.alt;for(const i of ['style', 'data-title','data-alt','onerror','onload']){this.removeAttribute(i);}this.dataset.lazyloaded='';" onerror="this.title=this.dataset.title;this.alt=this.dataset.alt;for(const i of ['style', 'data-title','data-alt','onerror','onload']){this.removeAttribute(i);}"/><span class="header-title-text">KZnight&#39;s Blog</span></a><span class="header-subtitle"></span></div>
<div class="menu-toggle" id="menu-toggle-mobile">
<span></span><span></span><span></span>
</div>
Expand Down Expand Up @@ -130,16 +130,16 @@ <h1 id="error-emoji"></h1>
document.getElementById('error-emoji').appendChild(document.createTextNode(emojiArray[Math.floor(Math.random() * emojiArray.length)]));
})();
</script></main><footer class="footer">
<div class="footer-container"><div class="footer-line powered"><a href="https://gohugo.io/" target="_blank" rel="external nofollow noopener noreferrer" title="Hugo 0.121.1"><img class="hugo-icon" src="/images/hugo.min.svg" alt="Hugo logo" /> Hugo</a> 强力驱动 | 主题 - <a href="https://github.com/hugo-fixit/FixIt" target="_blank" rel="external" title="FixIt v0.3.2-RC"><img class="fixit-icon" src="/images/fixit.min.svg" alt="FixIt logo" /> FixIt</a>
<div class="footer-container"><div class="footer-line powered"><a href="https://gohugo.io/" target="_blank" rel="external nofollow noopener noreferrer" title="Hugo 0.121.2">Hugo</a> 强力驱动 | 主题 - <a href="https://github.com/hugo-fixit/FixIt" target="_blank" rel="external" title="FixIt v0.2.18-lts.5"><img class="fixit-icon" src="/fixit.min.svg" alt="FixIt logo" />&nbsp;FixIt</a>
</div><div class="footer-line copyright" itemscope itemtype="http://schema.org/CreativeWork"><i class="fa-regular fa-copyright fa-fw" aria-hidden="true"></i>
<span itemprop="copyrightYear">2021 - 2024</span><span class="author" itemprop="copyrightHolder">
<a href="https://github.com/ccrysisa"target="_blank" rel="external nofollow noopener noreferrer">ccrysisa</a></span><span class="license footer-divider"><a rel="license external nofollow noopener noreferrer" href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a></span></div><div class="footer-line visitor">
<a href="https://github.com/ccrysisa"target="_blank" rel="external nofollow noopener noreferrer">ccrysisa</a></span><span class="license footer-divider"><a rel="license external nofollow noopener noreferrer" href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a></span></div><div class="footer-line statistics"></div><div class="footer-line visitor">
<span id="busuanzi_container_site_uv" title='总访客数'><i class="fa-regular fa-user fa-fw" aria-hidden="true"></i>&nbsp;<span id="busuanzi_value_site_uv"><i class="fa-solid fa-spinner fa-spin fa-fw" aria-hidden="true"></i></span></span><span id="busuanzi_container_site_pv" class="footer-divider" title='总访问量'><i class="fa-regular fa-eye fa-fw" aria-hidden="true"></i>&nbsp;<span id="busuanzi_value_site_pv"><i class="fa-solid fa-spinner fa-spin fa-fw" aria-hidden="true"></i></span></span>
</div></div>
</footer></div><div class="widgets"><div class="fixed-buttons animate__faster d-none"><div class="fixed-button back-to-top" role="button" aria-label="回到顶部"><i class="fa-solid fa-arrow-up fa-fw" aria-hidden="true"></i><span class="variant-numeric d-none">0%</span>
</div></div><div id="mask"></div><noscript>
<div class="noscript-warning">FixIt 主题在启用 JavaScript 的情况下效果最佳。</div>
</noscript>
</div><link rel="preload" href="/lib/katex/katex.min.css" as="style" onload="this.removeAttribute('onload');this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="/lib/katex/katex.min.css"></noscript><link rel="stylesheet" href="/lib/cookieconsent/cookieconsent.min.css"><script src="/lib/autocomplete/autocomplete.min.js" defer></script><script src="/lib/sharer/sharer.min.js" async defer></script><script src="/lib/katex/katex.min.js" defer></script><script src="/lib/katex/auto-render.min.js" defer></script><script src="/lib/katex/copy-tex.min.js" defer></script><script src="/lib/katex/mhchem.min.js" defer></script><script src="/lib/cookieconsent/cookieconsent.min.js" defer></script><script src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" async defer></script><script>window.config={"code":{"copyTitle":"复制到剪贴板","editLockTitle":"锁定可编辑代码块","editUnLockTitle":"解锁可编辑代码块","editable":true,"maxShownLines":20},"cookieconsent":{"content":{"dismiss":"同意","link":"了解更多","message":"本网站使用 Cookies 来改善您的浏览体验。"},"enable":true,"palette":{"button":{"background":"#f0f0f0"},"popup":{"background":"#1aa3ff"}},"theme":"edgeless"},"enablePWA":true,"math":{"delimiters":[{"display":true,"left":"$$","right":"$$"},{"display":true,"left":"\\[","right":"\\]"},{"display":true,"left":"\\begin{equation}","right":"\\end{equation}"},{"display":true,"left":"\\begin{equation*}","right":"\\end{equation*}"},{"display":true,"left":"\\begin{align}","right":"\\end{align}"},{"display":true,"left":"\\begin{align*}","right":"\\end{align*}"},{"display":true,"left":"\\begin{alignat}","right":"\\end{alignat}"},{"display":true,"left":"\\begin{alignat*}","right":"\\end{alignat*}"},{"display":true,"left":"\\begin{gather}","right":"\\end{gather}"},{"display":true,"left":"\\begin{CD}","right":"\\end{CD}"},{"display":false,"left":"$","right":"$"},{"display":false,"left":"\\(","right":"\\)"}],"strict":false},"search":{"highlightTag":"em","maxResultLength":10,"noResultsFound":"没有找到结果","snippetLength":50}};</script><script src="/js/theme.min.js" defer></script></body>
<noscript><link rel="stylesheet" href="/lib/katex/katex.min.css"></noscript><link rel="stylesheet" href="/lib/cookieconsent/cookieconsent.min.css"><script src="/lib/autocomplete/autocomplete.min.js" defer></script><script src="/lib/lunr/lunr.min.js" defer></script><script src="/lib/lunr/lunr.stemmer.support.min.js" defer></script><script src="/lib/lunr/lunr.zh.min.js" defer></script><script src="/lib/sharer/sharer.min.js" async defer></script><script src="/lib/katex/katex.min.js" defer></script><script src="/lib/katex/auto-render.min.js" defer></script><script src="/lib/katex/copy-tex.min.js" defer></script><script src="/lib/katex/mhchem.min.js" defer></script><script src="/lib/cookieconsent/cookieconsent.min.js" defer></script><script src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" async defer></script><script>window.config={"code":{"copyTitle":"复制到剪贴板","editLockTitle":"锁定可编辑代码块","editUnLockTitle":"解锁可编辑代码块","editable":true,"maxShownLines":20},"cookieconsent":{"content":{"dismiss":"同意","link":"了解更多","message":"本网站使用 Cookies 来改善您的浏览体验。"},"enable":true,"palette":{"button":{"background":"#f0f0f0"},"popup":{"background":"#1aa3ff"}},"theme":"edgeless"},"enablePWA":true,"math":{"delimiters":[{"display":true,"left":"$$","right":"$$"},{"display":true,"left":"\\[","right":"\\]"},{"display":true,"left":"\\begin{equation}","right":"\\end{equation}"},{"display":true,"left":"\\begin{equation*}","right":"\\end{equation*}"},{"display":true,"left":"\\begin{align}","right":"\\end{align}"},{"display":true,"left":"\\begin{align*}","right":"\\end{align*}"},{"display":true,"left":"\\begin{alignat}","right":"\\end{alignat}"},{"display":true,"left":"\\begin{alignat*}","right":"\\end{alignat*}"},{"display":true,"left":"\\begin{gather}","right":"\\end{gather}"},{"display":true,"left":"\\begin{CD}","right":"\\end{CD}"},{"display":false,"left":"$","right":"$"},{"display":false,"left":"\\(","right":"\\)"}],"strict":false},"search":{"highlightTag":"em","lunrIndexURL":"/index.json","lunrLanguageCode":"zh","lunrSegmentitURL":"/lib/lunr/lunr.segmentit.js","maxResultLength":10,"noResultsFound":"没有找到结果","snippetLength":50,"type":"lunr"}};</script><script src="/js/theme.min.js" defer></script></body>
</html>
44 changes: 44 additions & 0 deletions docs/baidu_urls.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
https://ccrysisa.github.io/posts/linux2023/
https://ccrysisa.github.io/posts/subtying-and-variance/
https://ccrysisa.github.io/posts/c-recursion/
https://ccrysisa.github.io/posts/linux-hashtable/
https://ccrysisa.github.io/posts/c-function/
https://ccrysisa.github.io/posts/concurrency-ordering/
https://ccrysisa.github.io/posts/concurrency-concepts/
https://ccrysisa.github.io/posts/openeuler-riscv-qemu/
https://ccrysisa.github.io/posts/c-std-security/
https://ccrysisa.github.io/posts/orst/
https://ccrysisa.github.io/posts/linux-dev-review/
https://ccrysisa.github.io/posts/riscv-optimization-guide/
https://ccrysisa.github.io/posts/channels/
https://ccrysisa.github.io/posts/c-standards/
https://ccrysisa.github.io/posts/c-memory/
https://ccrysisa.github.io/posts/c-bitwise/
https://ccrysisa.github.io/posts/smart-pointers-and-interior-mutability/
https://ccrysisa.github.io/posts/c-numerics/
https://ccrysisa.github.io/posts/linux2023-lab0/
https://ccrysisa.github.io/posts/rust-tcp/
https://ccrysisa.github.io/posts/linux-quiz1/
https://ccrysisa.github.io/posts/linux-concepts/
https://ccrysisa.github.io/posts/iterators/
https://ccrysisa.github.io/posts/c-linked-list/
https://ccrysisa.github.io/posts/declarative-macros/
https://ccrysisa.github.io/posts/lifetime-annotations/
https://ccrysisa.github.io/posts/deepin20.9/
https://ccrysisa.github.io/posts/deepin-dragonos/
https://ccrysisa.github.io/posts/nycu-statistics/
https://ccrysisa.github.io/posts/debug-gdb/
https://ccrysisa.github.io/posts/c-pointer/
https://ccrysisa.github.io/posts/nthu-computer-network/
https://ccrysisa.github.io/posts/c-spec-ch6/
https://ccrysisa.github.io/posts/c-spec-ch7/
https://ccrysisa.github.io/posts/c-specification/
https://ccrysisa.github.io/posts/git/
https://ccrysisa.github.io/posts/network/
https://ccrysisa.github.io/posts/binary-representation/
https://ccrysisa.github.io/posts/why-rust-/
https://ccrysisa.github.io/posts/git-learn/
https://ccrysisa.github.io/posts/ubuntu22.04lts/
https://ccrysisa.github.io/posts/gnu-linux-dev/
https://ccrysisa.github.io/posts/math/
https://ccrysisa.github.io/posts/hello_world/
Loading

0 comments on commit 88d1c47

Please sign in to comment.