fix bugs related to ramfs read and write; add test_ramfs command