Tham khảo tài liệu 'formal models of operating system kernels phần 8', công nghệ thông tin, hệ điều hành phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 236 5 Using Messages in the Swapping Kernel __UserCreateChildProcess__ code PCODE datasize stacksize N newpid APREF 3 m SYSCALLMSG I m CRTCHLD code stacksize datasize mypid src kernintfid dest m m 9 3 rpmsg SYSRpY newid APREF kernintfid src mypid dest rpmsg m A rpmsg NEWCHLDPROCl newid A newpid newid The termination message is sent by the following operation __TerminateProcess__ mypid APREF 3 m SYSCALLMSG I m TERMPROC mypid mypid src kernintfid dest m m The caller does not wait for a reply. When this message is sent it is all over as far as the caller is concerned The kernel supports a single process that receives the requests sent by SysCallLib s operations. In the version presented here it is just a loop that receives messages and performs the appropriate operations. This is very simple of course and no checking is performed the process could do other things and engage in message exchange with processes inside the kernel in a more sophisticated version. Again the point here is to demonstrate the principles. The process is called KernIntf. It is defined by the following class __KernIntf_ f INIT RunProcess mypid APREF msgman UserMessages procmgr ProcessCreation INIT me APREF mm UserMessages pcr ProcessCreation mypid me msgman mm procmgr pcr Kernel Interface 237 RunProcess V i 1 . x 3 m SYSCALLMSG mypid caller src src m m A 3 src APREF stcksz datasz N code MEM newpid APREF m CRTPROC src code stcksz datasz A procmgr. CreateUserProcess code code stcksz stacksize datasz datasize newpid newpid A 3 crmsg SYSRPY I crmsg NEWPROC newpid mypid src src dest crmsg m V 3 src APREF stcksz datasz N code MEM newpid APREF m CRTCHLD src code stcksz datasz A code code stcksz stacksize datasz datasize