If you ran a memory test and it came up with errors, you do have bad RAM. If you have two sticks in it, run the test with only one installed to determine which one is bad. The memory test has nothing to do with your hard drive or the OS, so something corrupt with your OS would not cause errors to show up in a memory test.
Are you using Memtest86 to test your memory? If not, download it and test it with that. It seems to be the standard for testing memory.