Quote:
Now if I get an OS built on the Mach kernel to work how can I compile a compiler for it, because to me this is an impossible task to achieve.
The first thing you need when you get a new platform executive (kernel) running for a general purpose OS (assuming that is what you want) such as Solaris or HP-UX is a simple shell. Without a shell, there is not much you can do on the new platform. Once you have a simple shell running that can load and execute other binaries then you can port your compiler tool chain and core libraries onto the new platform in iterative steps. When your compiler tool chain is working and you have a reliable build environment, you port the remaining commands, utilities and libraries to the new platform.
You generally build such a shell on another platform using a cross-platform compiler and an instruction set simulator. For example, early porting work for IA64 platforms was done on 64-bit Windows NT workstations. Usually the chip vendor supplies the cross-compiler and instruction set simulator under NDA. In your case, the cross-platform compiler and instruction set simulator is unnecessary since you are not on a new hardware platform.
Unless you are going to completely reinvent the world, you should use one of the common programming models, i.e LP16, IPL32, LP64 etc. and execution formats, i.e. COFF, ELF, DWARF, etc. Makes porting much easier.