kernel.py: implemented _open and _close