Here is my 1984 xl600r, bought it about 5 months ago w/18k miles. Has fresh oil and i loosened up the banjo bolt to be sure about oil getting to the head. Got it running and heard this coming from the engine. I may be wrong but the rattling does not sound normal. I took the engine apart to fix some stripped bolt holes and did not find any major wear or damage. It made this noise before and after I had the engine apart.
Read that it could be a worn out cam chain or cam chain tensioner.