Files
aios/docs/README.md
2025-07-05 13:19:08 +09:00

147 lines
4.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# AIOS - A Rust-based Operating System
AIOSは、Rustで一から作られたUnix系オペレーティングシステムです。最終的にClaude Codeを実行可能にすることを目標としています。
## 特徴
- **Pure Rust**: カーネルからユーザーランドまで、全てRustで実装
- **ベアメタル**: 標準ライブラリを使用せず、ハードウェアを直接制御
- **VGAテキストモード**: コンソール出力をサポート
- **シリアル通信**: デバッグとQEMU連携用
- **モジュラー設計**: 拡張可能なアーキテクチャ
## 必要な環境
### Mac (開発環境)
```bash
# Rust nightlyツールチェイン
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup toolchain install nightly
rustup default nightly
rustup component add rust-src llvm-tools-preview
rustup target add x86_64-unknown-none
# QEMUエミュレーター
brew install qemu
# bootimageツール
cargo install bootimage
```
### Arch Linux (本格運用環境)
```bash
# 基本パッケージ
pacman -Syuu --noconfirm base-devel archiso docker git nodejs bc
# Rustツールチェイン
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup toolchain install nightly
rustup component add rust-src llvm-tools-preview
rustup target add x86_64-unknown-none
# QEMUとbootimageツール
pacman -S qemu-full
cargo install bootimage
```
## ビルドと実行
### 1. プロジェクトのクローン
```bash
git clone <repository-url>
cd aios
```
### 2. ビルド
```bash
cargo build
```
### 3. ブートイメージの作成
```bash
cargo bootimage
```
### 4. QEMUでの実行
```bash
qemu-system-x86_64 -drive format=raw,file=target/x86_64-unknown-none/debug/bootimage-kernel.bin -serial stdio
```
## プロジェクト構造
```
aios/
├── src/
│ ├── main.rs # カーネルエントリーポイント
│ ├── vga_buffer.rs # VGAテキストモードドライバー
│ └── serial.rs # シリアルポート通信
├── .cargo/
│ └── config.toml # Cargo設定
├── Cargo.toml # プロジェクト設定
├── rust-toolchain.toml # Rustツールチェイン設定
└── docs/
└── README.md # このドキュメント
```
## 開発状況
### 完了済み
- [x] プロジェクト構造の設計と初期化
- [x] ベアメタル環境でのRustセットアップ
- [x] ブートローダーの実装
- [x] VGAテキストモードドライバーの実装
- [x] Hello World出力の実装
- [x] QEMUでの動作確認
### 進行中
- [ ] メモリ管理システムの実装
- [ ] ファイルシステムの実装
- [ ] プロセス管理システムの実装
- [ ] Claude Code実行環境の構築
## 目標
1. **Claude Codeを実行できるようにすること**
- Node.js/Rustランタイムの統合
- ファイルシステムとプロセス管理
- ネットワーク通信機能
2. **Package managerにpacmanを採用すること**
- Arch Linuxとの互換性
- パッケージビルドとサーバーの運用負荷軽減
## 参考資料
- [o8vm/octox](https://github.com/o8vm/octox) - xv6-riscvにインスパイアされたRust OS
- [The Rust Programming Language](https://doc.rust-lang.org/book/)
- [Writing an OS in Rust](https://os.phil-opp.com/)
## トラブルシューティング
### ビルドエラー
```bash
# 依存関係の更新
cargo update
# クリーンビルド
cargo clean
cargo build
```
### QEMUでの問題
```bash
# シリアル出力の確認
qemu-system-x86_64 -drive format=raw,file=target/x86_64-unknown-none/debug/bootimage-kernel.bin -serial stdio -nographic
```
## 貢献
このプロジェクトは教育目的で作成されていますが、貢献は歓迎します。Pull Requestを送る前に、以下を確認してください
1. コードがRustのベストプラクティスに従っている
2. 適切なテストが含まれている
3. ドキュメントが更新されている
## ライセンス
このプロジェクトは MIT License の下で公開されています。