unix - What is context in xv6? -


what usage of context in xv6 os ? job of each register in context ?

struct context {   uint edi;   uint esi;   uint ebx;   uint ebp;   uint eip; }; 

context set of information allows resume execution of task exact same point stopped due context switch (i.e. scheduler selects task run , suspends current one, hence has save execution information of current task , restore of next task run).

the purpose of each of registers is:

  • edi: destination index, string operations
  • esi: source index, string operations
  • ebx: base index, use arrays
  • ebp: stack base pointer, holding address of current stack frame
  • eip: instruction pointer, points instruction executed

Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

Decoding a Python 2 `tempfile` with python-future -