2012-07-24
07/24: JuluOSDev 讀書會 : Lab 3 review & stm32 Ethernet overview
報名網址:http://registrano.com/events/9dc72b
共筆網址:http://sync.in/ep/pad/view/juluosdev/ndIaMSCZc3
簽到 (用以將人名和編輯的顏色作關連)
ben6
kclin
Lab3 Sharing:
http://hawxchen.blogspot.tw/2012/07/lab3-user-environment.html
Discussion 1 = because JOS is single kernel thread so that don't need to add $4.%%esp after call trap.
JOS
env_pop_tf
movl %0,%%esp
xv6
_alltraps:
add $4, %%esp
== end discussion 1
Fast system call
==
inline assembly
you cannot use
lea IamBack, %ebp
...
IamBack:
use bellow instead (because compiler implement)
lea 0f, %ebp
....
0:
%ebp cannot use as
reduce stack push number - syscall_trap
http://stackoverflow.com/questions/10810203/what-is-the-fs-gs-register-intended-for
arch/x86/include/asm/stackprotector.h
* On x86_64, %gs is shared by percpu area and stack canary. All
* percpu symbols are zero based and %gs points to the base of percpu
* area. The first occupant of the percpu area is always
* irq_stack_union which contains stack_canary at offset 40. Userland
* %gs is always saved and restored on kernel entry and exit using
* swapgs, so stack protector doesn't add any complexity there.
*
* On x86_32, it's slightly more complicated. As in x86_64, %gs is
* used for userland TLS. Unfortunately, some processors are much
* slower at loading segment registers with different value when
* entering and leaving the kernel, so the kernel uses %fs for percpu
* area and manages %gs lazily so that %gs is switched only when
* necessary, usually during task switch.
其他討論
https://github.com/guilleiguaran/xv6
https://groups.google.com/d/topic/juluosdev/dx6izpodQEo/discussion