Extending the xv6 teaching kernel with runtime cycle detection in an active Resource Allocation Graph to prevent circular waits.