tailieunhanh - Formal Models of Operating System Kernels phần 2
Tham khảo tài liệu 'formal models of operating system kernels phần 2', 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ả | 28 2 Standard and Generic Components The hardware process is defined as HW start .HW1 HW1 ff saveregs HW1 setregs .HW1 getregs .HW1 restoreregs .HW1 saveregs The following pair of processes are intended to model the behaviour of hardware when an interrupt occurs. The process Int. represents the ith interrupt. When it receives its internal interrupt signal i. it signals that the Interrupt Service Routine ISR corresponding to this interrupt should be executed this is done by sending the runisr. message. The interrupt process then recurs ready to accept another interrupt signal. The second process ISRi is intended roughly to model the actions of the ISR corresponding to interrupt i. When the ISR receives the signal to execute runisrị it performs the service action and then instructs the hardware to restore the register set to the way it was before the interrupt occurred. The ISR process then recurs so that it can accept another interrupt. Inti i ISRi runisr .service .restoreregs .ISRi The hardware and interrupt subsystem can be thought of as the following parallel composition of processes H HW I II Inti I ISR. The next process models the interrupt mask. The interrupt mask determines whether interrupts are signalled or not it is modelled in this book by the Lock Object-Z class . IntMask on .IntMask 1 IntMask v off .IntMask 0 on. IntMask 1 stat .istat n . IntMask n The interrupt mask enables the hardware model to be extended so that interrupts can be enabled and disabled under programmer control. Integration of the interrupt mask and the process P is left as an exercise for the interested reader. The model works as follows. Initially the IntMask accepts an on event to initialise the mask. Initialisation enables interrupts and takes the state of the mask as its parameter the value in parentheses . After this the mask offers three possible actions off to disable interrupts on to enable them and stat to enquire about the state of the mask. When IntMask .
đang nạp các trang xem trước