Dhanshree Nimje Smita Khartad

Slides:



Advertisements
Similar presentations
A System Architecture for Networked Sensors Jason Hill, Robert Szewczyk, Alec Woo, Seth Hollar, David Culler, Kris Pister
Advertisements

How to use TinyOS Jason Hill Rob Szewczyk Alec Woo David Culler An event based execution environment for Networked Sensors.
A System Architecture for Tiny Networked Devices
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Process management Information maintained by OS for process management  process context  process control block OS virtualization of CPU for each process.
Sensor Network Platforms and Tools
Computer Systems/Operating Systems - Class 8
System Architecture Directions for Networked Sensors Qiuhua Cao Computer Science Department University of Virginia.
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
How to Code on TinyOS Xufei Mao Advisor: Dr. Xiang-yang Li CS Dept. IIT.
Jason Hill, Robert Szewczyk, Alec Woo Spring 2000 TinyOS Operating System for Networked Sensors Networked SensorsSystem Structure Composing Components.
1 Soft Timers: Efficient Microsecond Software Timer Support For Network Processing Mohit Aron and Peter Druschel Rice University Presented By Jonathan.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
A System Architecture for Tiny Networked Devices Jason Hill U.C. Berkeley 9/22/2000.
1 TinyOS Mohammad Rahimi CSCI599-Spring Motivation  The new class of distributed tiny devices  The new generation of software.
2008EECS Embedded Network Programming nesC, TinyOS, Networking, Microcontrollers Jonathan Hui University of California, Berkeley.
Real-Time Kernels and Operating Systems. Operating System: Software that coordinates multiple tasks in processor, including peripheral interfacing Types.
Introduction to TinyOS. Networking Open Experimental Platform Small microcontroller 8 kB code 512 B data Simple, low-power radio 10 kbps ASK EEPROM (32.
Using Two Queues. Using Multiple Queues Suspended Processes Processor is faster than I/O so all processes could be waiting for I/O Processor is faster.
1 Software Development Infrastructure for Sensor Networks  Operating systems ( TinyOS )  Resource (device) management  Basic primitives  Protocols.
TinyOS Tutorial Jianping Wang (merge several tutorials found online)
A System Architecture for Networked Sensors Jason Hill, Robert Szewczyk, Alec Woo, Seth Hollar, David Culler, Kris Pister
By: R Jayampathi Sampath
April 15, 2005TinyOS: A Component Based OSPage 1 of 27 TinyOS A Component-Based Operating System for Networked Embedded Systems Tom Bush Graduate College.
Hardware Definitions –Port: Point of connection –Bus: Interface Daisy Chain (A=>B=>…=>X) Shared Direct Device Access –Controller: Device Electronics –Registers:
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
OPERATING SYSTEMS Goals of the course Definitions of operating systems Operating system goals What is not an operating system Computer architecture O/S.
Vishal Jain, TinyOS Design Viewpoint “TinyOS” Design Viewpoint.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Overview of: System Architecture Directions for Networked Sensors John Kerwin CSE 291 Sensor Networks Paper by: Jason Hill, Robert Szewczyk, Alec Woo,
System Architecture Directions for Networked Sensors Jason Hill, Robert Szewczyk, Alec Woo, Seth Hollar, David Culler, Kris Pister Presented by Yang Zhao.
Simulation of Distributed Application and Protocols using TOSSIM Valliappan Annamalai.
Part 2 TinyOS and nesC Programming Selected slides from:
System Architecture of Sensor Network Processors Alan Pilecki.
Scheduling Lecture 6. What is Scheduling? An O/S often has many pending tasks. –Threads, async callbacks, device input. The order may matter. –Policy,
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
System Architecture Directions for Networked Sensors Jason Hill, Robert Szewczyk, Alec Woo, Seth Hollar, David Culler, Kris Pister Presenter: James.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
MicroC/OS-II S O T R.  MicroC/OS-II (commonly termed as µC/OS- II or uC/OS-II), is the acronym for Micro-Controller Operating Systems Version 2.  It.
WSN Software Platforms - concepts Vinod Kulathumani Lecture uses some slides from tutorials prepared by authors of these platforms.
Concurrency, Processes, and System calls Benefits and issues of concurrency The basic concept of process System calls.
1 VxWorks 5.4 Group A3: Wafa’ Jaffal Kathryn Bean.
Lab 3, Part 2 Selected slides from: Wireless Sensor Networks Hardware/Software Tiny OS & NesC Programming borrowed from Turgay Korkmaz.
TinyOS Sandeep Gupta. Operating System (OS) What is an OS? Main functions  Process management  Memory management  Resource management Traditional OSs.
System Architecture Directions for Networked Sensors.
TinyOS By Valliappan Annamalai. Hardware Mica motes (Mica2 and Mica2Dot) Hardware –Radio –Microcontroller –Flash memory –ADC –Sensor Board (MTA310)
Slides created by: Professor Ian G. Harris Operating Systems  Allow the processor to perform several tasks at virtually the same time Ex. Web Controlled.
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Why does it need? [USN] ( 주 ) 한백전자 Background Wireless Sensor Network (WSN)  Relationship between Sensor and WSN Individual sensors are very limited.
Software Architecture of Sensors. Hardware - Sensor Nodes Sensing: sensor --a transducer that converts a physical, chemical, or biological parameter into.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
TinyOS Sandeep Gupta. TinyOS basics TinyOS is  Single tasking OS  Interrupt driven Written using a Component based language A set of components put.
Implementing Context Aware Applications Class 5. Agenda Review of TinyOS execution model Tutorial on TinyOS Code walk through Code quiz Assignment 2.
Introduction to Operating Systems Concepts
Processes and threads.
Simulation of Distributed Application and Protocols using TOSSIM
Process Management Process Concept Why only the global variables?
Topics Covered What is Real Time Operating System (RTOS)
OPERATING SYSTEMS CS3502 Fall 2017
Real-time Software Design
Process management Information maintained by OS for process management
Computer System Overview
PROCESS MANAGEMENT Information maintained by OS for process management
TinyOS CSE466 Final Project Presentation
Modeling Event-Based Systems in Ptolemy II EE249 Project Status Report
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Dhanshree Nimje Smita Khartad TinyOS Dhanshree Nimje Smita Khartad

TinyOS - Design Design

What is TinyOS? TinyOS is a highly modular software environment tailored to the requirements of Network Sensors, stressing efficiency, modularity and concurrency. Capable of fine grained concurrency (event-driven architecture) 􀀹Small physical size Fewer context switches: (FIFO/non-preemptable scheduling) 􀀹Efficient Resource Utilization (Get done quickly and sleep) 􀀹Highly Modular

TinyOS - Features Event-driven architecture Lower layer sends events to higher layer Low overhead– No busy -wait cycles Interrupt driven.Two kinds of interrupt 􀂄􀂄 Clock 􀂄􀂄 Radio Component driven programming model 􀂄􀂄 Size - 400 bytes 􀂄􀂄 Extremely flexible component graph Single Single-shared stack shared stack

Features Contd. Network management - Active Messaging No kernel, process management, virtual memory File management - Matchbox 2-level FIFO scheduler– events and tasks Complete integration with hardware

Hardware Kits Two Board Sandwich Main CPU board with Radio Communication 􀂄 Secondary Sensor Board 􀂄 Allows for expansion and customization 􀂄 Current sensors include: Acceleration, Magnetic Field, Temperature, Pressure, Humidity, Light, and RF Signal Strength 􀂄 Can control RF transmission strength & Sense Reception Strength

Hardware Abstraction: LED (pin numbering/HW wiring) CLOCK (counter interrupt) UART (baud rate control, transfer) ADC (ADC interrupt handling) RFM (abstracts bit level timing, RFM specific control logic)

Communication stack building up from the RFM bit level bit level abstracts away radio specifics byte level radio component collects individual bits into bytes packet level constructs packets from bytes messaging layer interprets packets as messages

Sensor stack photo, and temperature sensing components sits on top of ADC component typical request data, wait for data event

TinyOS component model Component interface: commands accepts (implemented) commands uses events accepts (implemented) events uses Component implementation functions that implement interface frame: internal state tasks: concurrency control

Programming Model Components .comp: specification .C: behaviour .desc: select and wire specification: accepts commands uses commands signals events handles events comp1: C code comp3 comp4 comp2: .desc application: .desc

Scheduler : Tasks: Events – 2-level scheduling (events and tasks) single shared stack, used by events and function calls Tasks: are preemptable by events may call commands may signal events not preempted by tasks Events – Time critical Shorter duration (hand off to task if need be) Interrupts task Last-in first-out semantics (no priority among events) lowest level events support by hardware interrupt

TinyOS Two-level Scheduling Tasks do intensive computations Unpreemptable FIFO scheduling Bounded number of pending tasks Events handle interrupts Interrupts trigger lowest level events Events can signal events, call commands, or post tasks Two priorities Event/command Tasks

How to handle multiple data flows? Data/interrupt are handled by interrupt/event Respond to it quickly: A sequence of non-blocking event/command (function calls) through the component graph e.g., get bit out of radio hw before it gets lost Post tasks for long computations e.g., encoding • Assumption: long computation are not urgent New events preempt tasks to handle new data

Receiving a message

What are tasks Requirement of realtime OS: bounded delays between events. Event handler should run to completion within a short duration. If a lot of computation is involved in an event handler we defer execution. How? Implementing it as a task and scheduling it for later execution. TinyOS has simple FIFO scheduler using which tasks are scheduled. On occurrence of an event a task that is executing is preempted.

Data Memory Model STATIC memory allocation! Global variables No heap (malloc) No function pointers Global variables Available on a per-frame basis Local variables Saved on the stack Declared within a method

Application Is the OS with some specific functionality. Application is interrupt driven. List of interrupts handled depend on list of hardware components included in the application (e.g. clock and receiver). Waits for interrupts. On occurrence of interrupt, calls interrupt handler. invokes Calls Hardware Interrupts ISR Interrupt Handler

A Complete Application

Example : Inter-Node Communication Sender: Receiver :

Message Buffer Ownership Transmission: AM gains ownership of the buffer until sendDone(…) is signaled Reception: Application’s event handler gains ownership of the buffer, but it must return a free buffer for the next message

Potentially Nasty Bug 1 What’s wrong with the code? Symptom: data saved in globalData is lost Reason: Race condition between two tasks Solution: Use a queue, or never rely on inter-task communication uint8_t globalData; task void processData() { call SendData.send(globalData); } command result_t Foo.bar(uint8_t data) { globalData = data; post processData();

Potentially Nasty Bug 2 What’s wrong with the code? Symptom: message is corrupt Reason: TOS_Msg is allocated in the stack, lost when function returns Solution: Declare TOS_Msg msg in component’s frame. command result_t Foo.bar(uint8_t data) { TOS_Msg msg; FooData* foo = (FooData*)msg.data; foo.data = data; call SendMsg.send(0x01, sizeof(FooData), &msg); }

Potentially Nasty Bug 3 What’s wrong with the code? Symptom: some command result_t Foo.bar(uint8_t data) { FooData* foo = (FooData*)msg.data; foo.data = data; call SendMsg.send(0x01, sizeof(FooData), &msg); } Component What’s wrong with the code? Symptom: some messages are lost Reason: Race condition between two components trying to share network stack (which is split-phase) Solution: Use a queue to store pending messages Component 2: * command result_t Goo.bar(uint8_t data) { GooData* goo = (GooData*)msg.data; goo.data = data; call SendMsg.send(0x02, sizeof(GooData), &msg); }

THANK YOU