A bootloader like you describe would be very tricky (read: more trouble than it is worth) to make work. Why? Because you can't use the memory that you're trying to load your real program into for your bootloader at the same time; one will overwrite the other. Also, there's not any way to change the Nios2 Exception Address when you want to switch from the bootloader to the main program.
For this reason, bootloaders generally get written in assembly. The source for the Altera boot-copier bootloader should be in your Nios install; I'd recommend reading it and understanding it first before proceeeding, just so you're aware of everything a bootloader has to do. There are some restrictions on your bootloader:[list][*]You can't handle exceptions; the exception address is pointing at uninitialized memory. This means no interrupts; you'll need to manage I/O via polling, and make sure to never enable interrupts in your bootloader. The good news is that the bootloader doesn't really have much else to do.
[*]You should try to use only the Nios CPU's register file for runtime variables. Anything you put in system RAM runs the risk of getting overwritten.
[/list]Good luck!