SATA hard drive with windows XP- pentium 4

I know XP will not handle the 3TB and 4TB drives (Not 100% certain about 2TB drives). Considering you are now asking about upgrading a 40GB, A 500GB to 1TB will easily give you way more room, and will easily work with your system. Another thing you could do is just keep the 40GB as the OS drive, and use the new drive as storage.