|
1 | 1 | # Kernel Proc Lab |
2 | 2 |
|
3 | | -리눅스 커널 모듈을 빌드하고 `/proc/kernel_proc_lab`, `/dev/kernel_proc_lab`로 커널 공간 상태를 읽고 쓰는 학습용 프로젝트입니다. |
| 3 | + |
4 | 4 |
|
5 | | -## 프로젝트 요약 |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
6 | 9 |
|
7 | | -Kernel Proc Lab은 커널 모듈, character device, ioctl ABI, ring buffer, poll 기반 이벤트 스트림을 한 프로젝트 안에서 실습할 수 있도록 만든 Linux kernel driver lab입니다. 커널 쪽 상태는 `/proc`, sysfs, debugfs, tracepoint로 노출하고, 사용자 공간에서는 CLI, TUI 모니터, JSONL collector로 확인합니다. |
| 10 | +리눅스 커널 모듈을 직접 빌드하고 `/proc`, character device, `ioctl`, `poll`, sysfs, debugfs, tracepoint까지 연결한 커널 드라이버 포트폴리오 프로젝트입니다. 커널 공간의 상태와 이벤트를 사용자 공간 CLI, btop 스타일 TUI, JSONL collector로 관찰할 수 있게 만들었습니다. |
8 | 11 |
|
9 | | -현재 릴리스 기준: |
| 12 | +Repository: <https://github.com/jiyoon99/kernel-proc-lab> |
| 13 | +Release: <https://github.com/jiyoon99/kernel-proc-lab/releases/tag/v0.8.0> |
10 | 14 |
|
11 | | -- 모듈 버전: `0.8.0` |
12 | | -- ioctl ABI: `4` |
13 | | -- 장치 인터페이스: `/dev/kernel_proc_lab` |
14 | | -- 상태 인터페이스: `/proc/kernel_proc_lab`, `/sys/class/kernel_proc_lab/kernel_proc_lab` |
15 | | -- 사용자 도구: `usercli`, `labtop`, `kernel-lab-collector` |
16 | | -- 배포 보조: udev rule, systemd service, logrotate template, DKMS scripts |
| 15 | +## What I Built |
17 | 16 |
|
18 | | -## 검증 상태 |
| 17 | +이 프로젝트는 단순한 "hello kernel module"이 아니라, 커널 모듈을 실제 도구처럼 다룰 수 있게 만든 end-to-end lab입니다. |
19 | 18 |
|
20 | | -마무리 전 기본 검증은 아래 명령으로 확인합니다. |
| 19 | +| Area | Implementation | |
| 20 | +| --- | --- | |
| 21 | +| Kernel module | `module_init`, `module_exit`, module parameters, retained in-kernel event ring | |
| 22 | +| Device interface | `/dev/kernel_proc_lab` character device, read/write path, `poll` wakeups | |
| 23 | +| Control ABI | versioned ioctl ABI v4, stats/config/log/filter/heartbeat commands | |
| 24 | +| Observability | `/proc`, sysfs, debugfs, tracepoints, `dmesg` diagnostics | |
| 25 | +| User tooling | `usercli`, self-starting `labtop`, `kernel-lab-collector` | |
| 26 | +| Packaging | DKMS install flow, Debian package, udev rule, systemd service, logrotate | |
| 27 | +| Verification | host tests, ABI layout tests, ShellCheck, runtime smoke, stress, release checks | |
| 28 | + |
| 29 | +## Screenshots |
| 30 | + |
| 31 | +### labtop TUI |
| 32 | + |
| 33 | +`labtop`은 모듈이 꺼져 있으면 필요한 바이너리를 빌드하고, 모듈 로드와 `/dev/kernel_proc_lab` 복구를 처리한 뒤 TUI를 실행합니다. |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | +### Architecture |
| 38 | + |
| 39 | +사용자 공간 도구는 `/proc`, `/dev`, ioctl, sysfs/debugfs, tracepoint를 통해 커널 모듈 상태와 이벤트를 관찰합니다. |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | +## Key Features |
| 44 | + |
| 45 | +- `kernel_proc_lab.ko` external kernel module |
| 46 | +- `/proc/kernel_proc_lab` status page |
| 47 | +- `/dev/kernel_proc_lab` character device |
| 48 | +- ABI-stable ioctl commands with `KERNEL_PROC_LAB_ABI_VERSION=4` |
| 49 | +- retained ring buffer for recent typed events |
| 50 | +- `poll`/stream support for new message events |
| 51 | +- heartbeat worker with configurable interval |
| 52 | +- filter commands for retained event views |
| 53 | +- JSON output for automation and collector integration |
| 54 | +- self-starting `labtop` terminal dashboard |
| 55 | +- DKMS and Debian packaging support |
| 56 | + |
| 57 | +## Verification |
| 58 | + |
| 59 | +기본 검증은 아래 명령으로 확인합니다. |
21 | 60 |
|
22 | 61 | ```bash |
23 | 62 | make ci-check |
@@ -109,7 +148,7 @@ make uninstall-command |
109 | 148 | 소스에서 설치하는 흐름을 권장합니다. 커널 모듈은 실행 중인 커널 버전에 맞춰 빌드되어야 하므로, 릴리스에 포함된 `.ko` 파일을 그대로 사용하는 방식은 권장하지 않습니다. |
110 | 149 |
|
111 | 150 | ```bash |
112 | | -git clone https://github.com/<owner>/kernel-proc-lab.git |
| 151 | +git clone https://github.com/jiyoon99/kernel-proc-lab.git |
113 | 152 | cd kernel-proc-lab |
114 | 153 | make doctor |
115 | 154 | make install-command |
|
0 commit comments