对于博客内容加密这件事,在有后端服务器的情况下,是一件比较简单的事情,但是对于静态博客来说,就比较麻烦了。Hexo 博客里面有个非常著名的加密插件 hexo-blog-encrypt,它的大概原理是在 hexo g 的时候对 HTML 的内容进行加密,然后在输入正确的密码后解密出正确的 HTML 内容。

在插件的 issue 列表里面一个 Won’t fix 的 issue 里面提到一个问题是这个插件解密后导致 Dplayer 播放器显示不出来。

https://github.com/D0n9X1n/hexo-blog-encrypt/issues/190

最后的结论是受限于 Hexo 静态博客的特性,这个问题不会被修复。

Encrypting blog content is a fairly simple task when you have a backend server, but for static blogs it’s much more troublesome. There’s a very famous encryption plugin for Hexo blogs, hexo-blog-encrypt. Its rough principle: it encrypts the HTML content during hexo g, then decrypts it to reveal the correct HTML after the correct password is entered.

In the plugin’s issue tracker, a Won’t fix issue mentions that after decryption, the Dplayer player fails to display.

https://github.com/D0n9X1n/hexo-blog-encrypt/issues/190

The final conclusion was that, due to the nature of Hexo static blogs, this issue will not be fixed.

阅读更多
Wiki教程GitHubJS

本文编写一个简单的 Linux 内核模块,然后在 QEMU 中使用 insmod 加载模块, lsmod 查看模块信息, rmmod 卸载模块来进行测试工作。

实验环境在前文Linux Kernel 从编译到运行为 Linux Kernel 添加系统调用 中已经准备好了,这里不再赘述。

编译模块的工作流程如下:

  1. 环境准备

  2. 编写模块代码

  3. 编写 Makefile

  4. 编译模块

  5. 加载、卸载测试

This article writes a simple Linux kernel module, then tests it in QEMU by loading it with insmod, checking its info with lsmod, and unloading it with rmmod.

The experimental environment was already prepared in Linux Kernel: From Compilation to Running and Adding a System Call to the Linux Kernel, so I won’t repeat it here.

The module compilation workflow is as follows:

  1. Environment preparation

  2. Writing the module code

  3. Writing the Makefile

  4. Compiling the module

  5. Load/unload testing

WikiLinux教程Kernel

系统调用是用户空间和内核空间之间的接口,是用户程序与操作系统之间的桥梁。

Linux 内核提供了一系列的系统调用,用户程序可以通过这些系统调用来请求内核执行某些操作。

比如,open 系统调用用于打开一个文件,read 系统调用用于读取文件内容,write 系统调用用于写入文件内容等。

本文将介绍如何为 Linux Kernel 添加一个新的系统调用。

System calls are the interface between user space and kernel space, serving as the bridge between user programs and the operating system.

The Linux kernel provides a series of system calls that user programs can use to request the kernel to perform certain operations.

For example, the open system call opens a file, the read system call reads file content, and the write system call writes file content.

This article explains how to add a new system call to the Linux kernel.

WikiLinux教程Kernel

本文记录如何在 Ubuntu 24.04 系统上编译和运行 Linux kernel.

主机配置如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
                         ./+o+-       wgxls@server
yyyyy- -yyyyyy+ OS: Ubuntu 24.04 noble
://+//////-yyyyyyo Kernel: x86_64 Linux 6.8.0-49-generic
.++ .:/++++++/-.+sss/` Uptime: 22h 2m
.:++o: /++++++++/:--:/- Packages: 1924
o:+o+:++.`..```.-/oo+++++/ Shell: bash
.:+o:+o/. `+sssoo+/ Resolution: 2560x1440
.++/+:+oo+o:` /sssooo. DE: GNOME 46.0.1
/+++//+:`oo+o /::--:. WM: Mutter
\+/+o+++`o++o ++////. WM Theme: Adwaita
.++.o+++oo+:` /dddhhh. GTK Theme: Yaru-purple-dark [GTK2/3]
.+.o+oo:. `oddhhhh+ Icon Theme: Yaru-purple
\+.++o+o``-````.:ohdhhhhh+ Font: Ubuntu Sans 11
`:o+++ `ohhhhhhhhyo++os: Disk: 701G / 2.3T (31%)
.o:`.syhhhhhhh/.oo++o` CPU: AMD Ryzen 7 4800U with Radeon Graphics @ 16x 1.8GHz
/osyyyyyyo++ooo+++/ GPU: AMD/ATI Renoir [Radeon RX Vega 6 (Ryzen 4000/5000 Mobile Series)]
````` +oo+++o\: RAM: 10147MiB / 15489MiB
`oo++.

This article documents how to compile and run the Linux kernel on Ubuntu 24.04.

Host configuration:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
                         ./+o+-       wgxls@server
yyyyy- -yyyyyy+ OS: Ubuntu 24.04 noble
://+//////-yyyyyyo Kernel: x86_64 Linux 6.8.0-49-generic
.++ .:/++++++/-.+sss/` Uptime: 22h 2m
.:++o: /++++++++/:--:/- Packages: 1924
o:+o+:++.`..```.-/oo+++++/ Shell: bash
.:+o:+o/. `+sssoo+/ Resolution: 2560x1440
.++/+:+oo+o:` /sssooo. DE: GNOME 46.0.1
/+++//+:`oo+o /::--:. WM: Mutter
\+/+o+++`o++o ++////. WM Theme: Adwaita
.++.o+++oo+:` /dddhhh. GTK Theme: Yaru-purple-dark [GTK2/3]
.+.o+oo:. `oddhhhh+ Icon Theme: Yaru-purple
\+.++o+o``-````.:ohdhhhhh+ Font: Ubuntu Sans 11
`:o+++ `ohhhhhhhhyo++os: Disk: 701G / 2.3T (31%)
.o:`.syhhhhhhh/.oo++o` CPU: AMD Ryzen 7 4800U with Radeon Graphics @ 16x 1.8GHz
/osyyyyyyo++ooo+++/ GPU: AMD/ATI Renoir [Radeon RX Vega 6 (Ryzen 4000/5000 Mobile Series)]
````` +oo+++o\: RAM: 10147MiB / 15489MiB
`oo++.
WikiLinux教程Kernel

hexo-img-onerror 是一个为 Hexo 网站添加备用图片源的插件。License

故名思义,它的实现原理是为每一个 img 标签添加一个 onerror 事件,当图片加载失败时,会自动替换为备用图片。

如图所示:

hexo-img-onerror is a plugin that adds a fallback image source to Hexo websites. License

As its name suggests, it works by attaching an onerror event to every img tag: when an image fails to load, it is automatically replaced with the fallback image.

As shown below:

阅读更多
WikiGitHubJS

Scheduler 翻译成中文叫做调度器

调度器这个词对于学计算机的同学来说应该并不陌生,因为在大学操作系统的课堂上我们学过很多关于进程调度的知识。

  • 先来先服务(FCFS)
  • 短作业优先(SJF)
  • 优先级调度
  • 时间片轮转
  • 多级反馈队列

等等。

在这篇文章中,我们将会讨论高通 WLAN Host Driver 中调度器的实现。

为什么先学习调度器呢?

因为调度器是 WLAN Host Driver 中相对简单的部分,仅有 4 个源代码文件,而且调度器是 WLAN Host Driver 的核心部分,是各个模块之间沟通的桥梁。

源代码我转存到了我的 GitHub 仓库中,今天要看的部分在这里:

https://github.com/WANG-Guangxin/wlan-driver/tree/5113495b16420b49004c444715d2daae2066e7dc/qca-wifi-host-cmn/scheduler

也可以使用我的 opengrok 服务器来查看源代码,如果它还在线的话。

https://opengrok.dijk.eu.org/xref/wlan-driver/qca-wifi-host-cmn/scheduler/

Scheduler translates to 调度器 (dispatcher) in Chinese.

The word scheduler should be familiar to anyone in computer science — in university OS classes we learned a lot about process scheduling.

  • First Come First Served (FCFS)
  • Shortest Job First (SJF)
  • Priority scheduling
  • Round-robin
  • Multi-level feedback queue

and so on.

In this article, we’ll discuss the scheduler implementation in Qualcomm’s WLAN Host Driver.

Why study the scheduler first?

Because the scheduler is one of the simpler parts of the WLAN Host Driver — only 4 source files — and it’s also the core of the driver, acting as the bridge between all modules.

I’ve mirrored the source code to my GitHub repo; the part we’re looking at today is here:

https://github.com/WANG-Guangxin/wlan-driver/tree/5113495b16420b49004c444715d2daae2066e7dc/qca-wifi-host-cmn/scheduler

You can also browse the source on my opengrok server, if it’s still online.

https://opengrok.dijk.eu.org/xref/wlan-driver/qca-wifi-host-cmn/scheduler/

阅读更多
C/C++WikiWLANDriver