frame allocation and copy frm from bs to memory