Nios V/m software development
-- 39 ----
8. Jumps to alt_main()—The processor jumps to the alt_main() function, which
begins initializing the HAL BSP run-time library.
Note: If you use a third-party RTOS or environment for your BSP library file, the
alt_main() function can be different than the one provided by Intel.
---- 40 ----
The HAL alt_main() function performs the following steps:
1. Initializes interrupts—Sets up interrupt support for the Nios V processor with
the alt_irq_init() function.
2. Starts MicroC/OS-II—Starts the MicroC/OS-II, if this OS is configured to run
(with the ALT_OS_INIT and ALT_SEM_CREATE functions). For additional
information about MicroC/OS-II use and initialization, refer to Selecting the
Operating System.
----
3.4.3.1. Timer Devices
The HAL provides two types of timer services, a system clock timer, and a timestamp
timer.
• The system clock timer is used to control, monitor, and schedule system events.
• The timestamp variant is used to make high performance timing measurements.
You can assign each of these timer services to the Nios V processor internal timer or
an Intel Avalon Timer peripheral.
Note: Nios V processor core includes a timer that provides both the system clock timer and
timestamp services.
----
The HAL system initialization process calls the MicroC/OS-II function OSInit() before
alt_sys_init(), which instantiates and initializes each device in the system.
Therefore, the complete MicroC/OS-II API is available to device drivers, although the
system is still running in single-threaded mode until the program calls OSStart()
from within main().
----
C:\intelFPGA_pro\23.2\nios2eds\components\micrium_uc_osii\UCOSII\inc\os
9.3.5. Interrupt Service Routines for MicroC/OS-II
Implementing ISRs for MicroC/OS-II normally involves some housekeeping details, as
described in MicroC/OS-II: The Real-Time Kernel. However, because the Nios V
implementation of MicroC/OS-II is based on the HAL, several of these details are
taken care of for you. The HAL performs the following housekeeping tasks for your
interrupt service routine (ISR):
• Saves and restores processor registers
• Calls OSIntEnter() and OSIntExit()
The HAL also allows you to write your ISR in C, rather than assembly language.