Hi Geoffrey,<br><br>thanks for your detailed description. <br>i will try it out to make timer and interrupt controller work correctly!<br><br>& Happy New Year to all~<br><br><br>best,<br><br>kashin lin<br><br><div><span class="gmail_quote">
2007/12/26, Geoffrey Lee <<a href="mailto:glee@ok-labs.com">glee@ok-labs.com</a>>:</span><blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex">
On Wed, Dec 26, 2007 at 12:10:09AM +0800, kashin Lin wrote:<br>> Hi,<br><br>hi<br><br>><br>> After trying to modify some codes in<br>> "src/platform" to adapt okl4 to my target, i found i'm<br>> confused about the driver's relationship.( my target is Davinci from TI
<br>> which has arm926ej-s and DSP inside)<br>> the naming example works correctly on my target now. and the following are<br>> my questions:<br>><br>> 1. in pxa's machine.py for example:<br>> drivers = [timer_driver] +
pxa.drivers &<br>> v2_drivers = [ ("pxa250_timer", "vtimer"), ("uart_8250", "vserial"),]<br>> does "v2_driver" replace "driver" (so "driver" is no use) ?
<br><br><br>The drivers line, from inspection, I suspect is a leftover wart from<br>the driverv1 days. In the latest release of OKL4 pxa should use<br>driverv2 not driverv1.<br><br><br>><br>> 2. "Timer driver" :
<br>> what's the difference between "src/drivers/pxa250_timer" &<br>> "src/platform/pxa/pistachio/src/timer.cc"?<br>> as<br>> i comprehend, the timer in platform/ is OS timer and responds to
<br>> generate a period interrupt to<br>> trigger scheduling in kernel. if it's right, this seems to be a<br>> indispensable component.<br>> but why okl4 still works even i<br>> don't set the memory map address to OS timer correctly?
<br><br><br>Yes, one is in the kernel the other is in userland. The one in the<br>kernel has to work if you the timer tick and scheduling to work<br>properly.<br><br>The one in userland typically links into the timer server of Iguana
<br>to provide timer-related functions (e.g. sleep, timeout, seconds since<br>boot, etc).<br><br>Not having a timer interrupt (i.e. kernel timer disabled or does not<br>work) means that there will be no timeslice expiry,
i.e. current thread<br>will run forever until explicit yield. Note that not having a timer<br>interrupt is not supported. The above, however, explains why<br>things may appear to work when the kernel timer driver is<br>
disabled or broken.<br><br>Because L4 currently requires a periodic timer tick, it is very easy<br>to verify whether the presence of a timer by putting in a print or a debug<br>breakin in the interrupt routine. I suspect that if your timer is not
<br>present you won't see anything.<br><br>> ( i try naming example )<br>> what is the function of<br>> the timer in drivers/ ? does l4 kernel use this driver? for what?<br><br><br>The drivers in the drivers/ directory are user-level drivers.
<br>They provide support for the various peripherials on a particular<br>platform (e.g. UART, LCD, touchscreen, etc)<br><br>><br>> 3. "UART driver" :<br>> what's the difference between "src/drivers/uart_8250" &
<br>> "src/platform/pxa/pistachio/kdb/console.cc"<br>> it seems the printf function call is based on console.cc, so the<br>> output msgs from target through rs232<br>> are visible only when i set the correct memory map address to it.
<br>> but what is the function of the uart driver in drivers/ ?<br>><br><br><br>One is the kernel driver. The kernel driver is src/platform/pxa/pis...<br>console.cc and that handles prints that come from the kernel, including
<br>kdb and the KDB print routines in l4/kdebug.h.<br><br>The one in drivers/ is the user-level UART driver. This links against<br>the vserial program to provide a user-level UART device.<br><br>Sometimes, because some boards only have one console output UART, the
<br>kernel driver and the user-level driver may drive the same physical<br>device which I think is the source of some of your confusion.<br><br>To summarize, printf() and kdb output from the kernel always go out<br>via the kernel driver. When you are in userland, the things get
<br>a bit complicated. YOu have the option of using the L4_KDB* in<br>l4/kdebug.h in which case they go out via the kernel driver, or you<br>have the option of using the user-level UART device, in which case,<br>you go out to the user-level serial driver via vserial.
<br><br><br>> 4. in src/platform/pxa/, there are some codes like irq.cc and intctrl.h<br>> related to interrupt controller.<br>> but why okl4 still works even i don't set the memory map to INT<br>> controller's registers correctly?
<br>> i add printf in OS timer's INT handler further, but no output shown.<br>> so does OKL4 not use any interrupt?<br><br>The only drivers in the kernel are the console device and timer<br>driver and interrupt controller. The timer interrupt is handled in-
<br>kernel if it is a timeslice expiry. The console device typically runs<br>on polling I/O and does not use interrupts. There is nothing to stop<br>you from implementing an interrupt-driven device in the kernel at<br>least for the console there is probably little reason for doing so.
<br><br>If your interrupt controller driver is non-functional things will still<br>work, but you probably won't get very far, as soon as you try receiving<br>interrupts things will break.<br><br>As for your timer interrupt you probably have to get the interrupt
<br>controller going first before looking into the timer interrupt.<br><br> -gl<br><br>><br>> thanks for answering my questions.<br>><br>><br>> best regards,<br>><br>> kashin lin<br><br>> _______________________________________________
<br>> Developer mailing list<br>> <a href="mailto:Developer@okl4.org">Developer@okl4.org</a><br>> <a href="https://lists.okl4.org/mailman/listinfo/developer">https://lists.okl4.org/mailman/listinfo/developer</a><br>
<br><br>--<br>Lalalalalalalalala...<br><br></blockquote></div><br>