Thursday, January 6, 2011

good c programming

1.http://geeksforgeeks.org/?p=2405

tap and tun in linux

1.http://backreference.org/2010/03/26/tuntap-interface-tutorial/

Wednesday, January 5, 2011

windows dma

1.http://blogs.msdn.com/b/peterwie/archive/2006/03/02/542517.aspx
2.http://blogs.msdn.com/b/peterwie/archive/2006/03/21/556624.aspx
3.http://www.osronline.com/article.cfm?article=539

windows self modifying code

1.http://support.microsoft.com/kb/127904
2.wbinvd - http://f.osdev.org/viewtopic.php?f=1&p=185436
3.cache prefetch - http://msdn.microsoft.com/en-us/library/ms684826(v=vs.85).aspx
4.Intel prefetch - http://lkml.indiana.edu/hypermail/linux/kernel/0109.3/0972.html
5.cache instructions pentium - http://flylib.com/books/en/2.630.1.134/1/
6.How cachegrind works
7.what cache instructios mean w.r.t code execution
we can insert a cache instruction anywhere between a piece of code.If the argument to cache instruction actually loads the next probable code or data beforehand its useful.
8.After a dma is completed to a buffer,it is only gurenteed that the data is present in the RAM.It might need to be brought to cache for processing.Its a good idea to bring its first cacheline to L2/L1 if we anticipate its processing.Assigning the pointer of that buffer to any local variable doesnt gurentee the above.
9.to understand the use of cache prefetches, imagine a while loop that uses a variable.whenever any member of that variable is used there are three possiblilities.the value is in ram,l2 or l1.so each access of the variable can have variable time of execution.if we are absolutely sure of the access pattern we can prefetch that variable into l1 cache if those values will be used immediately and into l2 cache if there can be a deferred use for eg: when a dpc is executed only that variables values are used(confirm this)

Tuesday, January 4, 2011

wince dma

0.http://blog.csdn.net/hugohong/archive/2009/05/28/4222880.aspx
1.http://support.microsoft.com/kb/299355
2.http://groups.google.com/group/microsoft.public.windowsce.platbuilder/browse_frm/thread/90975e5dd0887119/1e5539324ae5ad71?lnk=st&q&rnum=40&pli=1
3.cache routines in ce
http://msdn.microsoft.com/en-us/library/ms901761.aspx
4.http://us.generation-nt.com/arm-cache-flush-cache-invalidate-help-65004682.html
5.http://www.tech-archive.net/Archive/WindowsCE/microsoft.public.windowsce.embedded/2004-05/0175.html

Saturday, January 1, 2011

software development - what can go wrong

1.redundencies - essential data structures are repeated at many places.But sometimes it becomes necessary to keep redundency for eg in protocol development an upper layer will need to maintain the states of the lower layer.The idea here is not optimization but necessity to physically isolate a layer that can even go into hardware from software space.
2.Incomplete understanding of system environment in which the software runs.for eg
multithreaded nature of entry points,semantics of the return values of entry points,presumption of a concept to be same as a similar one.eg tdi interface works only in synchronous mode,trying to use it as async.
3.function redundencies
4.trying to create monolithic design,need to create binaries that work together,clearly separated interfaces and datastructures
5.not caring about the dont do's of sw development
6.non focussed approach
7.not having roadmap
8.not packaging
9.not having test cases

top down and bottom up development

1.Top down - within a period of time, minimal demoable product is made.After each successive period more and more features is added.So at each interval demoable
product is present.Progress is measurable at each interval.Design changes doesnt waste effort too much.

2.Bottom up - First demoable product takes time.multiple units work parallelly to
develop all the features.Integration and testing takes time.After the first stage things will be fast.The design has to be perfect from start otherwise the work done
will be void.

3.For TD approach, first interval will have the framework ready with few features.
Rest of the system development will fall into placeholders of the framework.

4.For time estimation - When deciding to add a feature or modify a feature,find how many .c files .h files will be affected,how many functions will be affected, if it
spans across 5 files and 5 functions it will defenitely take 1 day cycle of modification,review,testing.If its a new feature addition again idea has to be gathered for its imapact on the number of .c and .h files and code addition,review,testing cycle,again for (5,5) it will take around 2 days(because of white space filling code addition).

5.types of modification - no data structure addition/deletion with code changes,data structure addition/deletion with code changes