Rewrote interrupt mechanism