07/24: JuluOSDev 讀書會 : Lab 3 review & stm32 Ethernet overview
Discussion 1 = because JOS is single kernel thread so that don't need to add $4.%%esp after call trap.
add $4, %%esp
== end discussion 1
Fast system call
you cannot use
lea IamBack, %ebp
use bellow instead (because compiler implement)
lea 0f, %ebp
%ebp cannot use as
reduce stack push number - syscall_trap
* 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.