Forkシステムコールを作りたいが子プロセスでページフォルトが起きており原因がわからない。 #22
Replies: 2 comments 30 replies
-
👋 パットコードを見た感じ確かに良さそうですね。例外発生時にQEMUモニタで |
Beta Was this translation helpful? Give feedback.
3 replies
-
「??」だとうまく特定できていない場合なので、アドレス最下位の数字を1ずらしてみてもらえますか?例えば 80fd3934 の場合は、80fd3933や80fd3935と行った感じです!On May 4, 2024, at 15:28, Nebashi Keisuke ***@***.***> wrote:
以下のように表示されました!
ページフォルトのメッセージ
[kernel] PANIC: page fault in kernel: vaddr=80fd3934, sepc=80fd3934, reason=14
上記コマンドの実行結果
***@***.*** microkernel-book % llvm-addr2line -e build/hinaos.elf.debug 80fd3934
??:0
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
27 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
概要
こちらを参考にforkシステムコールの実装を進めているのですが、レジスタ・メモリのコピー終了後に子プロセスを動作させようとすると以下のようにページフォルトが起きます。
ページフォルト元の
vaddr
は親プロセス構造体のスタック内のアドレス値ということは確認済みです。(task->arch.sp
~task->arch.sp_top
の間の値)親レジスタの状態をうまくコピーできていないのかな。とも思ったのですが親プロセスのカーネルスタックはコピーしているので他に思い当たることがない。という状態です。
カーネルスタック以外にもコピーする必要があるのでしょうか?
ご確認宜しくお願い致します。
開発環境
No response
ソースコードのURL
https://github.com/keisuke713/microkernel-book/blob/feat/fork/kernel/syscall.c#L328-L358
Beta Was this translation helpful? Give feedback.
All reactions