Expand description
Loading user applications into memory
For chapter 3, user applications are simply part of the data included in the
kernel binary, so we only need to copy them to the space allocated for each
app to load them. We also allocate fixed spaces for each taskβs
KernelStack
and UserStack
.
StructsΒ§
- Kernel
Stack π - User
Stack π
StaticsΒ§
- KERNEL_
STACK π - USER_
STACK π
FunctionsΒ§
- get_
base_ πi - Get base address of app i.
- get_
num_ app - Get the total number of applications.
- init_
app_ cx - get app info with entry and sp and save
TrapContext
in kernel stack - load_
apps - Load nth user app at [APP_BASE_ADDRESS + n * APP_SIZE_LIMIT, APP_BASE_ADDRESS + (n+1) * APP_SIZE_LIMIT).