getmemsize(), 1419行. 找出并計算所有可用之記憶體, 并保留 msgbuf
(保留在 avail_end 後面, MSGBUF_SIZE 大小).
init386(), 1802行. 參數 first 為未使用的 free mem addr (physfree).
1824-1825行, PReload_bootstrap_relocate(), kern/subr_module.c, 234行,
relocate 預先載入(preload)的 kernel module. 執行 loader 的動作,
修改 module 的 address depend 資料.
1839-1860行, 設定 gdt (global descriptor table). 由於 gdt 的格式較為
雜, 因此有所謂的 soft_segment_descriptor (ssd),
i386/include/segments.h, 165行, gdt_segs 就是
ssd list, 讓 gdt 較容易操作. 因此在 1853-1860行, 必需進行
轉換動作, 由 ssdtosd(), i386/i386/support.s, 157行, 從 ssd 轉換
成 CPU 所能接受的 segment descriptor 格式.
1862-1864行, load gdt, 使剛設好的 gdt 發生作用. lgdt(), i386/i386/support.s,
1521行.
1885-1894行, 設定 ldt.
1897-1923行, 設定 idt.
所有的 idt entry 都指向 vector routines, i386/i386/exception.s,
122行. 每一個 trap or fault 都會有對應的 entry point, 作為實
際 isr 和 cpu 之間介面. 關於上述介面, 另見專文.
1928行, cninit(), console 初始化.
1932行, isa_defaultirq(), i386/isa/intr_machdep.c, 219行. 設定 isa device
所使用的 irq (設定 icu;8259), 并設定對應的 isr.
1948-1955行, 設定并安裝 tss.
1971行, getmemsize(), i386/i386/machdep.c, 1419行, 找出并計算所有可用之
memory, 并保留 msgbuf. getmemsize 會設立幾個 global 變數.
physmem 實際可用的 page 數目.
Maxmem physcial memory address 的最大值.
phys_avail list of 可用的 mem block.
avail_start 由 pmap_bootstrap().
avail_end 最大可用之 physcial memory address.
所有的分配都必需小於這個位址.
1976-1979行, msgbuf initialization.
1982-1995行, install a call gate for system call.
1999-2008行, setup process 0.