From 5f7ecca6258cfbe1fd839746ca484cf5aa7324b1 Mon Sep 17 00:00:00 2001 From: Berkus Decker Date: Mon, 21 Dec 2020 11:54:18 +0200 Subject: [PATCH] wip code review --- nucleus/src/arch/aarch64/boot.rs | 15 +++++++++++++++ nucleus/src/caps/captable.rs | 17 +++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/nucleus/src/arch/aarch64/boot.rs b/nucleus/src/arch/aarch64/boot.rs index c9d85ef..dd014e8 100644 --- a/nucleus/src/arch/aarch64/boot.rs +++ b/nucleus/src/arch/aarch64/boot.rs @@ -393,3 +393,18 @@ fn create_root_capnode() -> Capability // Attr(BOOT_CODE) cap // reference to pptr is here } */ + +// create initial thread +// - vspace +// - cpace +// - tcb +// +// requires: +// - alloc_region +// - copy_global_mappings +// - create pt/pd caps -- this is arch-specific? +// - root capnode with write_slot() +// +// init thread domain = 0 +// init thread asid = 1 (asidInvalid = 0) +// diff --git a/nucleus/src/caps/captable.rs b/nucleus/src/caps/captable.rs index 06037c4..6846d07 100644 --- a/nucleus/src/caps/captable.rs +++ b/nucleus/src/caps/captable.rs @@ -186,3 +186,20 @@ mod tests { // seL4_CapTableObject, // 6. Retype to TCB and implement Thread capability to run threads (in priv mode first?) } + +/* caps with fixed slot positions in the root (boot) CNode */ +// enum { +// seL4_CapNull = 0, /* null cap */ +// seL4_CapInitThreadTCB = 1, /* initial thread's TCB cap */ +// seL4_CapInitThreadCNode = 2, /* initial thread's root CNode cap */ +// seL4_CapInitThreadVSpace = 3, /* initial thread's VSpace cap */ +// seL4_CapIRQControl = 4, /* global IRQ controller cap */ +// seL4_CapASIDControl = 5, /* global ASID controller cap */ +// seL4_CapInitThreadASIDPool = 6, /* initial thread's ASID pool cap */ +// seL4_CapIOPort = 7, /* global IO port cap (null cap if not supported) */ +// seL4_CapIOSpace = 8, /* global IO space cap (null cap if no IOMMU support) */ +// seL4_CapBootInfoFrame = 9, /* bootinfo frame cap */ +// seL4_CapInitThreadIPCBuffer = 10, /* initial thread's IPC buffer frame cap */ +// seL4_CapDomain = 11, /* global domain controller cap */ +// seL4_NumInitialCaps = 12 +// };