6.828: Operating System Engineering (89)

ええと 88 なエントリでほぼできてる、って書いたのですがさくっと完了。
以下です。

    //////////////////////////////////////////////////////////////////////
    // Make 'envs' point to an array of size 'NENV' of 'struct Env'.
    // LAB 3: Your code here.
    envs = boot_alloc(NENV*sizeof(struct Env), PGSIZE);

もうひとつ。

    //////////////////////////////////////////////////////////////////////
    // Map the 'envs' array read-only by the user at linear address UENVS
    // (ie. perm = PTE_U | PTE_P).
    // Permissions:
    //    - the new image at UENVS  -- kernel R, user R
    //    - envs itself -- kernel RW, user NONE
    // LAB 3: Your code here.
    boot_pgdir[PDX(UENVS)] |= PTE_U;
    boot_map_segment(boot_pgdir, UENVS, ROUNDUP(NENV*sizeof(struct Env), PGSIZE), PADDR(envs), PTE_W | PTE_P);

直上の似たナニをパクッただけなんですが、一応なんとかなってる模様。

$ make qemu
/opt/bin/qemu -hda obj/kern/kernel.img -serial mon:stdio
6828 decimal is 15254 octal!
Physical memory: 66556K available, base = 640K, extended = 65532K
check_page_alloc() succeeded!
page_check() succeeded!
check_boot_pgdir() succeeded!

以降を読みます。

Creating and Running Environments とのこと。environment ってか struct Env って Linux で言う task_struct (だったっけ) と思ってて良いのかな。
あと GNUmakefile に手が入ってるとか書いてあります。
あ、プロセス動かすために実行ファイルが必要なんだけどファイルシステムを持っていないのでカーネルイメージに直接埋めこんじゃってるみたいですね。これはこれは。
ええと結構色々な意味で lab3 は大変らしい。
Creating and Running Environments の後ですが

  • Handling Interrupts and Exceptions
  • Basics of Protected Control Transfer
  • Types of Exceptions and Interrupts
  • Nested Exceptions and Interrupts
  • Setting Up the IDT
  • User-mode startup
  • Page faults and memory protection

ということでなんとなくここで全部済ませちゃえ (何を?) てき匂いがナニ。今日はなんとなくへろへろ気味なのでこれで終わり。Exercise 10. まであるのだなぁ。早めにスイッチ入れてがつっとヤッツケたいです。