McFadden, 29, was available on a free transfer and will have to prove his fitness if he is to earn a longer contract at the Stadium of Light.
The forward spent last season at Everton but made only two Premier League starts due to injury.
Martin O'Neill said: “James is happy to stay in the short-term because if he doesn’t breakthrough, he won’t feel as though he’s earning what he shouldn’t.
“I think he is enjoying it here, and he’s the one who said he’s happy with the length of the contract.
“I was aware that he had been freed, obviously, but as time goes on, and he hadn’t been picked up, I thought about him.
“There had been contact originally but I didn’t know him at all to speak to and I was just thinking to myself that if we did have any problems with injuries – particularly at a time when Adam Johnson’s move was in the balance – I thought if we could get him properly fit, he might be a valuable addition to the squad.
“Certainly, he’s trained most days and he’s a lot fitter than before, so touch wood he’ll be okay – we’ll just see how it goes.”
McFadden started his career with Motherwell before an initial move to Everton in 2003. He signed for Birmingham for £4.75 million in January 2008.
- Sports & Recreation
- Premier League