Given that you are a beginner, it would be useful to read about an RTOS and be able to use the code. I would recommend downloading the Micrium books about uCOS-III.
http://micrium.com/ You may need to register to download the PDFs, but its definitely worth it.
The NIOS II examples already have uCOS-II examples.
If you want to understand how to port the OS, then read through this document (its for an ARM microcontroller);
https://www.ovro.caltech.edu/~dwh/ucos/project_ar1803.pdf https://www.ovro.caltech.edu/~dwh/ucos/gcc_and_ucosii.zip uCOS-II and uCOS-III are not open-source, but their source code is available to read. You can use the OS for university and non-commercial purposes.
Once you understand uCOS-II/III you can take a look at other OSes, eg., FreeRTOS.
http://www.freertos.org/ Cheers,
Dave