You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need a new user-level library design for embedded MCUs. We probably need a custom header as well, for the following reasons:
Most MCU applications are statically compiled and statically linked.
Most MCU applications require a small size and thus prohibits complex abstraction levels. This may require a new cos_kernel_api without serious abstractions, preferably only inline functions.
Most MCU applications do not share the same library with PC-based applications, or require their own versions.
Some MCUs have their own libraries that are possibly not compatible with our current system setup.
A suggested header for the MCU applications(especially RTOS VM images):
The structure to pass hypercall parameters to/from the VMM if we use shared memory to pass parameters. We can use synchronous invocation to pass parameters as well.
The page table layout is statically decided, the first one being the top-level. This is architecture-specific.
structpgtbl_hdr
{
/* Its parent's position in the page table array */unsigned longparent;
/* The start address of the mapping <also contains where to cons it into> */unsigned longaddr;
/* The size order and number order, combined into one word */unsigned longorder;
/* The initially mapped pages' data. The only thing stored here is the Composite standard flags */unsigned charflags[8];
};
The VM image header structure
structvm_image
{
/* The magic number;always equal to VIRT(0x56495254) */constunsigned longmagic;
/* Name of the VM */charname[16];
/* The entry, stack and stack size of the virtual machines */void*user_entry;
/* The stack of this VM */void*user_stack;
/* The size of the user stack */unsigned longuser_size;
/* The entry of the interrupt processing thread */void*int_entry;
/* The stack of the interrupt processing thread */void*int_stack;
unsigned longint_size;
/* SHARED:The parameter space <if we use shared memory to pass parameters> */structvm_param*param;
/* The priority and timeslices of the VM - used in prioity RR scheduling */unsigned longprio;
unsigned longslices;
/* SHARED:The console space and size - if you wish to print something */unsigned longconsole_size;
void*console_buf;
/* SHARED:The interrupt flag space - To mark an interrupt so that the VM can process it */unsigned longint_num;
unsigned long*int_flags;
/* The number of page tables in this image, and where are they stored */unsigned longpgtbl_num;
conststructpgtbl_hdr*pgtbl;
/* The number of kernel capabilities in this image, and their list, which depicts what hardware this VM have access to */unsigned longhwcap_num;
constunsigned long*hwcap;
/* Is there any other images? If there is, here is a pointer to the start * of the next one. This is a constant pointer to a constant pointer to a * constant structure. The VMM will load the next image from here, if it wants to. */conststructvm_image*const*constnext_image;
};
We need a new user-level library design for embedded MCUs. We probably need a custom header as well, for the following reasons:
A suggested header for the MCU applications(especially RTOS VM images):
The structure to pass hypercall parameters to/from the VMM if we use shared memory to pass parameters. We can use synchronous invocation to pass parameters as well.
The page table layout is statically decided, the first one being the top-level. This is architecture-specific.
The VM image header structure
@gparmer
The text was updated successfully, but these errors were encountered: