Skip to content

Commit 6e7f062

Browse files
committed
feat: Add Rust for Linux kernel features research module
✨ New Features: - Add kernel-features research module with educational examples - Implement Field Projections demonstration - Implement In-place Initialization examples - Implement Arbitrary Self Types demonstrations - Add comprehensive limitations analysis 📚 Documentation: - Add detailed Korean documentation for all three features - Include LWN.net article translations - Add practical kernel development examples - Update main README with kernel-features section 🔧 Project Structure: - Add research/kernel-features/ module to workspace - Add research/rust-kernel-features-study/ exploratory code - Update Cargo.toml workspace configuration - Enhance .gitignore for kernel research artifacts 🎯 Educational Value: - Demonstrates memory safety in kernel development - Shows why Rust needs these features for Linux kernel - Provides hands-on examples of unsafe elimination - Complements linux-kernel-exploits research Related: Rust for Linux project, LWN article series
1 parent 246fb79 commit 6e7f062

30 files changed

+5308
-11
lines changed

.gitignore

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,31 @@
2121

2222
# temp
2323
*.tmp
24+
*.swp
25+
*.swo
26+
*~
27+
*.bak
2428

2529
# Environment files
2630
.env
2731
*.env
28-
.env
29-
*.env
30-
.env
3132
tools/discord_audit_bot/.env
33+
3234
# Python venv
3335
.venv/
36+
3437
# Rust/C build artifacts
35-
/target/
36-
/**/target/
37-
/poCs/cache/flush_reload_attacker
38-
/poCs/cache/flush_reload_attacker_csv
39-
/poCs/cache/victim_sim
40-
# local env files
41-
.env
42-
tools/discord_audit_bot/.env
38+
/PoCs/cache/flush_reload_attacker
39+
/PoCs/cache/flush_reload_attacker_csv
40+
/PoCs/cache/victim_sim
41+
42+
# Rust kernel features research
43+
research/rust-kernel-features-study/target/
44+
research/kernel-features/target/
45+
46+
# IDE specific
47+
.idea/
48+
*.iml
49+
50+
# Linux
51+
.directory

Cargo.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ members = [
55
"tools/discord_audit_bot",
66
"research/crypto",
77
"research/merkle", "tools/wifi_audit",
8+
"research/kernel-features",
89
]
910
resolver = "2"
1011

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Rust
2+
target/
3+
Cargo.lock
4+
**/*.rs.bk
5+
*.pdb
6+
7+
# IDE
8+
.vscode/
9+
.idea/
10+
*.swp
11+
*.swo
12+
*~
13+
14+
# OS
15+
.DS_Store
16+
Thumbs.db
17+
18+
# 빌드 결과물
19+
*.o
20+
*.so
21+
*.a
22+
*.lib
23+
24+
# 테스트 결과
25+
*.profraw
26+
*.profdata
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[package]
2+
name = "rust-kernel-features"
3+
version = "0.1.0"
4+
edition = "2021"
5+
authors = ["sumin-world <[email protected]>"]
6+
description = "Learning Rust features for Linux kernel development"
7+
repository = "https://github.com/sumin-world/rust-kernel-features-study"
8+
license = "MIT"
9+
10+
[dependencies]
11+
# 기본적인 의존성만 포함
12+
pin-project = "1.1"
13+
14+
[dev-dependencies]
15+
16+
[[example]]
17+
name = "field_projection"
18+
path = "src/examples/field_projection.rs"
19+
20+
[[example]]
21+
name = "inplace_init"
22+
path = "src/examples/inplace_init.rs"
23+
24+
[[example]]
25+
name = "smart_pointers"
26+
path = "src/examples/smart_pointers.rs"
27+
28+
[[example]]
29+
name = "limitations"
30+
path = "src/examples/limitations.rs"

research/kernel-features/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 sumin-world
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# 빠른 시작 가이드 🚀
2+
3+
## 5분 만에 시작하기
4+
5+
### 1단계: 저장소 클론
6+
7+
```bash
8+
git clone https://github.com/sumin-world/rust-kernel-features-study.git
9+
cd rust-kernel-features-study
10+
```
11+
12+
### 2단계: Rust 설치 확인
13+
14+
```bash
15+
rustc --version
16+
cargo --version
17+
```
18+
19+
Rust가 없다면:
20+
```bash
21+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
22+
```
23+
24+
### 3단계: 예제 실행
25+
26+
```bash
27+
# 전체 한계 종합 (추천!)
28+
cargo run --example limitations
29+
30+
# 개별 예제
31+
cargo run --example field_projection
32+
cargo run --example inplace_init
33+
cargo run --example smart_pointers
34+
```
35+
36+
### 4단계: 문서 읽기
37+
38+
```bash
39+
# 브라우저로 docs/ 폴더의 마크다운 파일 열기
40+
```
41+
42+
## 학습 순서
43+
44+
1. **기초 개념** (30분)
45+
- `docs/01_field_projection.md`
46+
- `docs/02_inplace_init.md`
47+
- `docs/03_smart_pointers.md`
48+
49+
2. **종합 데모** (15분)
50+
```bash
51+
cargo run --example limitations
52+
```
53+
54+
3. **개별 예제** (각 10분)
55+
```bash
56+
cargo run --example field_projection
57+
cargo run --example inplace_init
58+
cargo run --example smart_pointers
59+
```
60+
61+
4. **코드 분석** (30분)
62+
- `src/examples/` 폴더의 코드 읽기
63+
- 주석 따라가기
64+
65+
## 다음 단계
66+
67+
- [ ] 티스토리 블로그 글 읽기
68+
- [ ] 예제 코드 수정해보기
69+
- [ ] LWN.net 원문 읽기
70+
- [ ] Rust for Linux 프로젝트 탐색
71+
72+
## 문제 해결
73+
74+
### Rust 설치 문제
75+
```bash
76+
# Rust 재설치
77+
rustup update
78+
```
79+
80+
### 빌드 오류
81+
```bash
82+
# 캐시 정리
83+
cargo clean
84+
cargo build
85+
```
86+
87+
### 실행 오류
88+
```bash
89+
# 자세한 로그
90+
RUST_LOG=debug cargo run --example limitations
91+
```
92+
93+
## 도움 받기
94+
95+
- GitHub Issues: [이슈 생성](https://github.com/sumin-world/rust-kernel-features-study/issues)
96+
- 티스토리 블로그 댓글
97+
- Rust Korea 커뮤니티
98+
99+
즐거운 학습 되세요! 🦀

0 commit comments

Comments
 (0)