Linux Process Memory Management

We’ve all learned that a process’s memory consists of the heap and the stack. But this model is still too abstract — it conceals many operating system details. So here’s a brief rundown of process memory management. Heap Growth libc provides the malloc function for heap memory allocation. Under the hood, it relies on the brk system call. From the kernel’s perspective, the heap is a simple structure. It consists of a fixed heap base (the end symbol) and a movable heap top (called the program break)....

May 17, 2025 · 12 min · 2543 words · Wokron

A Brief Discussion on Fonts

A while back, I found that Matplotlib couldn’t display Chinese characters properly. While solving the problem, I learned a fair bit about how font rendering works. Here are my notes. 1. Encoding and Fonts We know that to store characters in a computer, we assign a numeric code to each character. This artificial convention is called character encoding. Common encodings include ASCII, GBK, Unicode, and so on. Character encoding is the data representation of characters....

May 5, 2024 · 7 min · 1340 words · Wokron

Introduction to the QEMU Emulator

This article is part of the BUAA Operating Systems course preparatory tutorial. This version was written by me. In 2024, the course lab environment was changed from GXemul to QEMU. To help students adapt to the new environment, two new articles were added to the preparatory tutorial: “GDB: Dissecting Programs” and “Introduction to the QEMU Emulator.” An operating system is a program that runs directly on computer hardware, managing hardware resources below while providing unified services to software above....

January 21, 2024 · 8 min · 1654 words · Wokron

GDB: Dissecting Programs

This article is part of the BUAA Operating Systems course preparatory tutorial. This version was written by me. In 2024, the course lab environment was changed from GXemul to QEMU. To help students adapt to the new environment, two new articles were added to the preparatory tutorial: “GDB: Dissecting Programs” and “Introduction to the QEMU Emulator.” Think back to when you first entered the world of programming. Everyone has had this experience: a carefully written program just won’t produce the correct result, and even after reviewing the code from top to bottom several times, the hidden bug remains elusive....

January 18, 2024 · 16 min · 3402 words · Wokron