By means of ab-initio calculations, we perform an analysis of the configurational thermodynamics, effects of disorder, and structural energy differences in Fe-Ni alloys at the pressure and temperature conditions of the Earth's core. We show from ab-initio calculations that the ordering energies of fccand hcp-structured Fe-Ni solid solutions at these conditions depend sensitively on the alloy configuration, i.e., on the degree of chemical disorder, and are on a scale comparable with the structural energy differences. From configurational thermodynamics simulations we find that a distribution of Fe and Ni atoms in the solutions should be very close to completely disordered at these conditions. Using this model of the Fe-Ni system, we have calculated the fcc-hcp structural free energy difference in a wide pressure-temperature range of 120-360 GPa and 1000-6600 K. Our calculations show that alloying of Fe with Ni below 3000 K favours stabilisation of the fcc phase over the