本文主要介绍了sel4进程基本概念和进程调度。
进程
sel4进程的概念同一般的操作系统一致,除了多了一个cap概念。下面是tcb(thread control block)结构体:
struct tcb {
/* arch specific tcb state (including context)*/
arch_tcb_t tcbArch;
/* Thread state, 3 words */
thread_state_t tcbState;
/* Notification that this TCB is bound to. If this is set, when this TCB waits on
* any sync endpoint, it may receive a signal from a Notification object.
* 1 word*/
notification_t *tcbBoundNotification;
/* Current fault, 2 words */
seL4_Fault_t tcbFault;
/* Current lookup failure, 2 words */
lookup_fault_t tcbLookupFailure;
/* Domain, 1 byte (padded to 1 word) */
dom_t tcbDomain;
/* maximum controlled priority, 1 byte (padded to 1 word) */
prio_t tcbMCP;
/* Priority, 1 byte (padded to 1 word) */
prio_t tcbPriority;
/* Timeslice remaining, 1 word */
word_t tcbTimeSlice;
/* Capability pointer to thread fault handler, 1 word */
cptr_t tcbFaultHandler;
/* userland virtual address of thread IPC buffer, 1 word */
word_t tcbIPCBuffer;
/* cpu ID this thread is running on, 1 word */
word_t tcbAffinity;
/* Previous and next pointers for scheduler queues , 2 words */
struct tcb *tcbSchedNext;