Home‎ > ‎2012讀書會‎ > ‎

2012-07-24

07/24: JuluOSDev 讀書會 : Lab 3 review & stm32 Ethernet overview
 
 
 
 
簽到 (用以將人名和編輯顏色作關連)
ben6
kclin
 
 
Lab3 Sharing:
 
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
 
 
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.
 
 
其他討論
 
 
Comments