Printer-Friendly
Version
|
Next: Bibliography
Up: 06-l4impl
Previous: 06-l4impl
Subsections
- Overview of main features of L4 implementation:
- data structures,
- algorithms.
- Based on MIPS implementation (assembler kernel by Elphinstone)
- These notes are very brief, they are complemented by:
- L4/MIPS source code[L4M99],
- ``Inside L4/MIPS''[Hei00]
- Fast TCB location (macros.h:tid2tcb).
- per-thread kernel stack
- kernel stack in TCB
| | |
|
0: |
struct tcb *sndq_end, *wakeup_link, *busy_link, |
|
|
|
*int_link; |
|
|
1: |
unsigned long wfor; struct tcb *sndq_start; |
|
|
|
unsigned long stack_pointer; udw_t asid; |
|
|
2: |
void *gpt_pointer; unsigned long myself; |
|
|
|
unsigned int fine_state, timeout; long recv_desc; |
|
|
3: |
struct tcb *present_next, *child_task; |
|
|
|
uhw_t rem_timeslice, timeslice; |
|
|
|
ub_t mcp, bpad1, ctsp, tsp; |
|
|
4: |
long wakeup; |
|
|
|
struct tcb *soon_wakeup_link, |
|
|
|
*late_wakeup_link, *sndq_next; |
|
|
... |
|
|
| | |
| |
|
0: |
dw_t stack_bottom; |
|
|
udw_t s0_save, *free_asid_list; |
|
|
tcb_t *wakeup_list; |
|
|
... |
| | |
Exception stack as set up by general exception handler (prior to
k_ipc ).
Sender's kernel stack when switching to receiver (end of
deliver ).
- All IPC processing is done in sender's context.
- Sender's address space accessible (but may get TLB misses).
- To access receiver's data (for receive descriptor,
strings):
- shift all receiver addresses into
temporary mapping area
- TMA located in kernel-reserved address range (),
- TLB miss handler recognises TMA address range
- faults handled by translating receiver page table entries,
- if not mapped, invoke receiver's pager.
- Implies handling user page faults in kernel mode.
- TLB misses in user mode invoke fast TLB miss hander
- Misses in kernel mode, or on unmapped user memory:
- invoke the slow TLB miss handler,
exc_tlbs ,
exc_tlbl .
- Deals with three kinds of misses:
|
user page fault ==> invoke pager |
|
|
window fault ==> look up
receiver's PT & remap |
|
|
kernel TLB miss on TCB array
==> allocate TCB |
|
- first can happen any time, last two only in kernel mode
- Need to be able to invoke user's pager during IPC.
- Kernel ``fakes'' exception stack to invoke pager
- as per IPC syscall (using
k_ipc code)
- ``EPC'' is restart routine.
Next: Bibliography
Up: 06-l4impl
Previous: 06-l4impl
Gernot Heiser
2002-09-05
|