How does Racism come about from a Marxist perspective?

class is rigid.
alot of blacks great grandparents were slaves. all their ancestors were slaves. so they are still poor majority wise. white people think "oh blacks do crime cause they are black". porky eggs on this concept because it diverts blame from them.

True only if we consider ancient slavery .
Comparing american chatel slavery with muslim one is wrong
In ottoman empire most slaves were like servents and (mostly women) in harems
No racist theory behinde slavery there and many slaves were more powerful than nobles(But still it sucks being a slave)