cprintf
in JOS)-O1
(or -O2
) to -O0
in makefilea / b
(both of int
)?
int
)%idtr
: point to the base address of IDT
struct gatedesc
(defined in mmu.h
)%tr
: we only use ss0
& esp0
vm.c
: switchuvm()
- ss0
and esp0
iret
do
div 1 0
: user → kernel w/o error code
idivl
againb vector0
x/6x $esp
when entering kernelstruct trapframe
man signal
div.c
: memset
somethingb vector14
x/6x $esp
kern/trap.c
int z = 0; ticks = ticks / z;
to idtinit()
b vector0
x/6x $esp
eip
/cs
/eflags
; no ss
/esp
for kernel → kernelT_IRQ0 + IRQ_TIMER
in xv6
lapicinit()
in lapic.c
trap()
in trap.c
int $0x40
(64)usys.S
(user) and syscall.c
(kernel)gcc -nostdlib -m32
strace
int $0
to confuse the kernel with division by zero?