Staging some code of FAT port to AnsiC