From siewerts@thinker.colorado.edu Wed Oct 17 17:26:41 2001 Received: (from siewerts@localhost) by thinker.colorado.edu (8.10.1/8.10.1/UnixOps+Hesiod) id f9HNOrQ17976; Wed, 17 Oct 2001 17:24:53 -0600 (MDT) Message-Id: <200110172324.f9HNOrQ17976@thinker.colorado.edu> Subject: Meet in Simlab Tonight!! To: bf2man@earthlink.net (Hidekazu Miyoshi), chris_newman@maxtor.com, dan.vigil@seagate.com, darrin_laverenz@stortek.com, deanwschulze@home.com, dgardner@interfacecontrol.com, ehoskins@qwest.net, emiliod@linuxcrew.com, f.vang@gli-co.com, fsbh1@uaf.edu, gpayne@ball.com, gyounger@hwimfg.com, jeff_andre@stortek.com, jing_li@jdedwards.com, kansari@ball.com, ken.ordes@seagate.com, modhafarhussain@aol.com, noratheps@hotmail.com, sam.siewert@networkphotonics.com, siewerts@thinker.colorado.edu, shubharamani@yahoo.com, sombutsi@colorado.edu, sscranford@yahoo.com, sshekhar@qualcomm.com, sziesman@ball.com, tewahade@vlecom.com, vikram.shah@colorado.edu, wxie@qualcomm.com Date: Wed, 17 Oct 2001 17:24:53 -0600 (MDT) From: "Sam Siewert" X-Mailer: ELM [version 2.5 PL3] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Content-Length: 384 Status: RO Meet in Simlab tonight!! Sam ________________________________________________________________________ Sam Siewert, Ph.D. -- Adjunct Faculty, Embedded Systems Cert. Program University of Colorado Boulder, Electrical and Computer Engineering siewerts@thinker.colorado.edu, www-sgc.colorado.edu/~siewerts/ ________________________________________________________________________ From siewerts@thinker.colorado.edu Wed Oct 17 11:57:52 2001 Received: (from siewerts@localhost) by thinker.colorado.edu (8.10.1/8.10.1/UnixOps+Hesiod) id f9HHn0L00453; Wed, 17 Oct 2001 11:49:00 -0600 (MDT) Message-Id: <200110171749.f9HHn0L00453@thinker.colorado.edu> Subject: Example code helpful for HW To: bf2man@earthlink.net (Hidekazu Miyoshi), chris_newman@maxtor.com, dan.vigil@seagate.com, darrin_laverenz@stortek.com, deanwschulze@home.com, dgardner@interfacecontrol.com, ehoskins@qwest.net, emiliod@linuxcrew.com, f.vang@gli-co.com, fsbh1@uaf.edu, gpayne@ball.com, gyounger@hwimfg.com, jeff_andre@stortek.com, jing_li@jdedwards.com, kansari@ball.com, ken.ordes@seagate.com, modhafarhussain@aol.com, noratheps@hotmail.com, sam.siewert@networkphotonics.com, siewerts@thinker.colorado.edu, shubharamani@yahoo.com, sombutsi@colorado.edu, sscranford@yahoo.com, sshekhar@qualcomm.com, sziesman@ball.com, tewahade@vlecom.com, vikram.shah@colorado.edu, wxie@qualcomm.com Date: Wed, 17 Oct 2001 11:49:00 -0600 (MDT) From: "Sam Siewert" X-Mailer: ELM [version 2.5 PL3] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Content-Length: 2266 Status: RO Hi, In case you haven't already looked at testtsh.c and time_stamp.c on the class WWW page under the Solutions/Examples, please look at these to get ideas on how to implement the taskSwitchHook call-back and how to time-stamp events. taskSwitchHookAdd, etc. are documented in the VxWorks manuals - please read up on them! You may time stamp events with ticks, but be aware that this is only accurate to +/- 1 millisecond. As an alternative, although not required, you may use code such as that found in time_stamp.c to read the x86 timing oscillator base counter directly which is typically good to +/- 1 microsecond given a period of about 0.4 microsecs. Microsecond time-stamping is not a *requirement* for the HW, but does make the HW much more interesting - so give it a try, but don't worry if you can't get it to work as far as the grading of the HW. The microsecond time-stamping calls are directly into /usr/local/wind/target/config/pcPentium BSP code and therefore are not documented in the generic VxWorks docs. Be very careful with your taskSwitchHook call-back code - you can only have code in this function which is valid in kernel/interrupt context - i.e. most C code is ok, but be careful about making API calls in this code - you should note whether the VxWorks Ref. Man states that the API call is valid in interrupt context - if it is valid in interrupt context (e.g. semGive), then you can call such a function in the taskSwitchHook call-back - if not, it will likely crash the kernel. Likewise, if you write any "bad code" (e.g. bad pointer dereference) and it is executed in the taskSwitchHook call-back, this will crash the kernel, so you may want to test this code carefully before installing it. Welcome to firmware/kernel code development! It's not always easy - try and write very well-formed code, be cognizant that you are executing as the kernel, and you'll be ok. Sam ________________________________________________________________________ Sam Siewert, Ph.D. -- Adjunct Faculty, Embedded Systems Cert. Program University of Colorado Boulder, Electrical and Computer Engineering siewerts@thinker.colorado.edu, www-sgc.colorado.edu/~siewerts/ ________________________________________________________________________