[ECOS] scheduler/printf questions
Andrew Lunn
andrew.lunn@ascom.ch
Wed Nov 14 17:59:00 GMT 2001
> I am currently trying to understand the basic architecture of the eCos
> HAL (and yes, I read the docs which are excellent btw :).
These questions deal with more than the HAL....
>
> I have two questions:
> - so that the scheduler can interrupt a task which reached the end of
> its timeslice, there must be a timer somewhere to trigger an interrupt
> which asks for a reschedule. So, where is this setup ? And where can I
> find this interrupt handler's code ? I have tried to find it in the
> ARM/Integrator example but failed miserably.
Im not familiar with that target. I know the EBSA well....
hal_hardware_init() starts the hardware timer by calling
hal_clock_initialize with the correct timer period.
Then in the kernel clock.cxx
Cyg_RealTimeClock::Cyg_RealTimeClock()
: Cyg_Clock(rtc_resolution),
interrupt(CYGNUM_HAL_INTERRUPT_RTC, 1, (CYG_ADDRWORD)this, isr, dsr)
Installs the isr/dsr which are just bellow in the source code. The dsr
calls the scheduler to do a timeslice.
> - what are the semantics of a printf call ? I have tried to trace in
> the package/langage libc source what happens but I still cannot figure
> out where the data will be printed. I would expect there is a way to
> configure this on different targets. For example, if the target has an
> output serial port, I would expect the bytes to be written there. Is
> this a safe assumption ? If so, where can such configuration options be
> found ?
Its all configurable via CDL and the ecos.ecc file. There are a number
of virtual devices which map onto the physical drivers. eg /dev/tty0
is a virtual device which is normally mapped onto the physical device
/dev/ser0. Similarly /dev/termios0 is mapped to /dev/ser0. I think
normal printf is mapped to the console, which defaults to
/dev/ttydiag.
Andrew
More information about the Ecos-discuss
mailing list