start: detect memory layout