Require: driver_call_time, driver_state, , , pSC,
(1)    produce  WRITE_CAPTURE_PREPARE()
(2)   if  driver_call_time == 0 then
(3)    for   from 0 to   do
(4)     Set to read-only;
(5)   end for
(6)  else
(7)    for   from 0 to   do
(8)     Set to read-only;
(9)    end for
(10) end if
(11)
(12) produce  WRITE_CAPTURE_RESET(addr)
(13) ;
(14) pSC = (++pSC) % C;
(15) old_addr = ; ;
(16) if  old_addr != NULL  then
(17)  if  driver_state == DRIVER_RUN  then
(18)   set old_addr to read-only;
(19)  else
(20)   ;
(21)  end if
(22) end if
Algorithm 2: The algorithm of shadow page cache for the driver’s write operation capture (SCDWC).