[Stormdos-develop] SD-32 Multitasking and modules
Status: Planning
Brought to you by:
exhu
From: Juras <yb...@tu...> - 2004-10-27 19:41:20
|
Hello stormdos-develop, == execs.txt === SD-32 Multitasking and modules ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The main item used for multi-tasking is called a CONTEXT. The context belongs to a PROCESS. A process can countain a lot of contexts. A process also makes so that the contexts of the same project have the same address space. A process maintains a list of used DLLs. CONTEXTs->PROCESS->MAIN_MODULE_IMAGE_ID USED_DLLs_IDs Executables and DLLs are managed alike by the same module manager. It registers unique DLLs and EXEs. Then returns IDs to that modules incrementing the reference counter of each. The module manager allocates memory, makes fix-up and automatically loads needed dependent modules and also makes all the necessary clean-up. Algorithm: function load_module() 1) check whether that module has not been loaded - check if it is already used by the process, a) if so - exit. b) no - allocate structure 2) increase ref. counter, allocate memory, fix-up 3) enumerate dependencies, launch load_module for each store dependencies IDs in the stucture 4) use loaded dependencies to make imports and exports meet -- Best regards, Juras mailto:yb...@tu... |