<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>linux on Anonymous&#39; Blog</title>
    <link>https://huweicai.com/tags/linux/</link>
    <description>Recent content in linux on Anonymous&#39; Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>zn-Hans</language>
    <lastBuildDate>Sat, 07 Oct 2023 13:58:00 +0800</lastBuildDate>
    
	<atom:link href="https://huweicai.com/tags/linux/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Executable and Linkable Format</title>
      <link>https://huweicai.com/elf/</link>
      <pubDate>Sat, 07 Oct 2023 13:58:00 +0800</pubDate>
      
      <guid>https://huweicai.com/elf/</guid>
      <description>ELF Executable and Linkable Format，可执行与可链接格式，其一个很熟悉的身份就是 Linux 操作系统的标准可执行文件格式，在 Linux 上运行我们编写的代码时，就需要将其编译成 ELF 格式。 另外它还定义了共享库和核心转储文件的结构和布局。 ELF 文件格式在操作系统中起着重要的作用，它使得我们编写的代码能够被正确地编译、链接和执行。 此外，部分 Unix 系统，如: Solaris、FreeBSD 等也采用 ELF 作为其可执行文件格式。 ELF 文件格式被设计为可扩展和灵活的</description>
    </item>
    
    <item>
      <title>很快的共享内存</title>
      <link>https://huweicai.com/shared-memory/</link>
      <pubDate>Tue, 08 Aug 2023 13:42:00 +0800</pubDate>
      
      <guid>https://huweicai.com/shared-memory/</guid>
      <description>WHY 共享内存 进程间通信有许多种方式，不同的场景有不同的选择。 当通信内容非常简单的时候，可以考虑信号、信号量甚至 flock() 这种最基础的通信方式。 当需要传递不仅仅是信号这种规模的数据时，可以考虑 FIFO、MQ 等内核 API，也非常的简单易用 。 当我们的传输内容再进一步复杂，需要用“协议”去抽象这种复杂度的时候，Unix Domain Socket 会是一个不错的选择，比如常见的 gRPC over UDS；或者牺牲一点网络栈开销，直接使用基于 TCP / UDP 的 Socket 也非常</description>
    </item>
    
    <item>
      <title>Linux Kernel Debug Tips</title>
      <link>https://huweicai.com/kernel-debug-tips_en/</link>
      <pubDate>Tue, 17 Jan 2023 00:00:00 +0800</pubDate>
      
      <guid>https://huweicai.com/kernel-debug-tips_en/</guid>
      <description>Kernel Kernel undertakes the core Operating System job, which is the foundation of the current software ecosystem.
So, knowing more about how the kernel works will contribute to the construction of our user mode system.
The best method to learn software code is debugging while watching, software = code + data, know more about the runtime data while learning code can help us understand it better.
However the Kernel is not a normal software system, we can&amp;rsquo;t add breakpoint and debug it through IDE debug button like other normal software, though we can implement it by kgdb + QEMU, it&amp;rsquo; still too heavy, and not available for online systems.
This article shares two lightweight kernel debugging tips, helps us observing it runtime status rapidly.
Kernel Module Usally, our codes are runing in user mode. In Linux operating systems, the instruction of user mode program will run in level Ring 3 , they do not have the permission to acces the data in level Ring 0 high memory address space, which means that they can&amp;rsquo;t snoop the data inside Kernel.
In that case, why not try to run our code inside the Kernel?
It&amp;rsquo;s possible to edit the source code of kernel, adding log to print the information we concerned, but it&amp;rsquo;s a long tedious step.</description>
    </item>
    
    <item>
      <title>聊一聊磁盘</title>
      <link>https://huweicai.com/something-about-disk/</link>
      <pubDate>Mon, 13 Jun 2022 18:20:55 +0800</pubDate>
      
      <guid>https://huweicai.com/something-about-disk/</guid>
      <description>磁盘 在计算机发展的历程中，存储设备的演进一直是一个引人入胜的故事。 从最早的打孔纸带，到磁性存储，再到今天的固态硬盘，人们一直在追求更快、更大、更可靠的数据存储方案。 在这个演进过程中，磁盘凭借着断电数据不丢失、容量大、价格实惠等优势，成为了最重要的存储设备之一。 虽然最初 &amp;lsquo;磁盘&amp;rsquo; 狭义上的概念专指使用磁性材料的存储设备，但在今天，这个词已经泛指所有的持久化存储设备。让我们一起来探</description>
    </item>
    
    <item>
      <title>Linux 内核轻量级调试小技巧</title>
      <link>https://huweicai.com/kernel-debug-tips/</link>
      <pubDate>Sun, 13 Mar 2022 00:00:00 +0800</pubDate>
      
      <guid>https://huweicai.com/kernel-debug-tips/</guid>
      <description>Kernel 内核承担了核心的操作系统工作，是当今软件生态的基石，因此了解内核是如何工作的能极大的帮助我们更好地构建用户态系统。 学习软件源代码最好的方式就是边看边 DEBUG，软件 = 代码 + 数据，看代码的同时了解其运行时数据能让我们更好的理解整体逻辑。 但内核毕竟不是普通的软件系统，并不是简单的在 IDE 里面一点就能断点调试的，虽然也可以通过 kgdb + qemu 实现在 IDE 中的断点调式，不过这样实在是太重了，而且也不能分析正在运行中的线上</description>
    </item>
    
    <item>
      <title>手动实现一个Linux容器</title>
      <link>https://huweicai.com/run-linux-container-manual/</link>
      <pubDate>Wed, 14 Apr 2021 16:20:00 +0800</pubDate>
      
      <guid>https://huweicai.com/run-linux-container-manual/</guid>
      <description>容器 容器技术的出现，彻底颠覆了传统的应用交付部署方式，交付的边界不再仅限于代码，而是一整套能 run everywhere 的基础设施，正如容器化领域的集大成者 Docker 的标语所言，这是一个新的时代了： Accelerate how you build, share and run modern applications. 容器本质上就是一个软件包，包含了业务服务及其依赖组件，比如我有一个Java服务，依赖了jdk 14.0.1以及几个外部 jar包，同时我们还依赖发行版的一些特性，需要运行在 debian buster发行版上，那么我们可以把这些通通打</description>
    </item>
    
    <item>
      <title>如何准确的获取CPU占用率[Linux][Go]</title>
      <link>https://huweicai.com/go-linux-get-cpu-usage/</link>
      <pubDate>Fri, 01 Jan 2021 01:20:00 +0800</pubDate>
      
      <guid>https://huweicai.com/go-linux-get-cpu-usage/</guid>
      <description>如果我们想要获取系统的 CPU 占用率，首先，Go 语言本身是没有帮我们封装这样的 API 的，所以我们只能自己通过其他方式直接向操作系统要，而不同的操作系统“要”的方式都不太一样，我们这里主要基于 Linux 场景来分析。 虽然有现成的 ps 和 top 等工具我们可以读到现成的值，但是这些工具也是基于 proc 文件解析的，对于人眼可读性较友好，但是代码解析时就不那么方便了。 PROCESS 文件系统 在许多 Unix 类系统中，都存在一个 procfs (Process File System) 进程文件系统的概念，用于将内</description>
    </item>
    
    <item>
      <title>小米路由器4A百兆版刷OpenWRT</title>
      <link>https://huweicai.com/run-openwrt-on-xiaomi4a100m/</link>
      <pubDate>Tue, 08 Dec 2020 23:47:00 +0800</pubDate>
      
      <guid>https://huweicai.com/run-openwrt-on-xiaomi4a100m/</guid>
      <description>我其实不怎么喜欢写这种教程类的博客，不过苦于刷机过程中资料过少，踩坑过多，特此系统性的捋一下，分享给有缘人，我手上的型号是百兆版的，4A千兆版刷OpenWRT的流程也基本一样，不过需要注意镜像地址什么的自行替换一下。 前提：需要安装 git、python3 以及熟悉基本的终端操作。 OpenWRT 首先我们要对 OpenWRT 有一些最基本的概念，OpenWRT 是一种 Linux 发行版，本质上是一个操作系统，和我们的常见的 Windows、And</description>
    </item>
    
    <item>
      <title>找出使用最频繁的Shell命令</title>
      <link>https://huweicai.com/most-frequently-command/</link>
      <pubDate>Fri, 20 Mar 2020 19:58:00 +0800</pubDate>
      
      <guid>https://huweicai.com/most-frequently-command/</guid>
      <description>使用最频繁 TOP 10命令： history | awk &#39;{map[$2]++} END { for (a in map )print map[ a ]&amp;quot; &amp;quot; map[ a ]/NR*100 &amp;quot;% &amp;quot; a }&#39;| sort -rn | nl | head 先上成品，然后，我们一步一步分析这行语句都涉及到了命令，它们又是如何拼凑到一块儿完成我们的目的的。 Shell 首先我们需要明确一下 shell 的定义，大家可能经常听到 shell ，shell 脚本这些词，那么 shell 到底是什么呢？ Shell 翻译成中文的意思就是壳，和操作系统内核的核相对应，就是一个基于内核的可操作界面。可操作性界面又分为两种： 图形界面类：Graphi</description>
    </item>
    
    <item>
      <title>进程线程协程的本质区别</title>
      <link>https://huweicai.com/process-thread-goroutine/</link>
      <pubDate>Tue, 17 Mar 2020 01:20:00 +0800</pubDate>
      
      <guid>https://huweicai.com/process-thread-goroutine/</guid>
      <description>现代多任务操作系统通常都会有进程的概念来对任务进行隔离，而为了充分利用多核处理器性能同时又减少进程创建的开销，通常又都会引入更细粒度的调度单元：线程。 我们经常能在教科书上看到对于进程和线程的定义： 进程是操作系统分配资源的最小单位，线程是进行调度的最小单元。 这句话没错，但是只是从职责上给出的定义，而不是基于底层实现出发的。 广义上的线程分为内核态线程和用户态线程两种，内核态线程受操作系统直接调度可以充</description>
    </item>
    
  </channel>
</rss>