Realtime Systems Fundamnetals

Slides:



Advertisements
Similar presentations
What is an Operating System?
Advertisements

Device Drivers. Linux Device Drivers Linux supports three types of hardware device: character, block and network –character devices: R/W without buffering.
© Copyright 2004 Dr. Phillip A. Laplante 1 Kernel Architectures  Polled Loop  Synchronized Polled Loop  State-Based Model  Cyclic Executives  Foreground/Background.
CENG 324 Embedded Computer Systems Lecture 3 General Concepts of RTOS (Real-Time Operating System) Asst. Prof. Tolga Ayav, Ph.D. Department of Computer.
RTOS Concepts and Defn From Pseudokernels to Operating Systems
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
Embedded Systems : WRT54GL Wireless Router B. Ramamurthy.
Embedded XINU SW & HW preparation 09/5/2008 David You.
Chapter 13 Embedded Systems
Figure 1.1 Interaction between applications and the operating system.
Chapter 11 Operating Systems
1 Operating Systems Ch An Overview. Architecture of Computer Hardware and Systems Software Irv Englander, John Wiley, Bare Bones Computer.
Chapter 1: Introduction
1 Chapter 13 Embedded Systems Embedded Systems Characteristics of Embedded Operating Systems.
Copyright Arshi Khan1 System Programming Instructor Arshi Khan.
What do operating systems do? manage processes manage memory and computer resources provide security features execute user programs make solving user.
8/12/ Embedded XINU and WRT54GL. Purpose 8/12/ Xinu is a embedded kernel It runs on “torn-down” wireless router used as a host for this embedded.
LOGO OPERATING SYSTEM Dalia AL-Dabbagh
Four Components of a Computer System. Computer System Components Users (people, machines, other computers) Applications programs – define the ways in.
Operating Systems CS3502 Fall 2014 Dr. Jose M. Garrido
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS6: Device Management 6.1. Principles of I/O.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3: Operating Systems Computer Science: An Overview Tenth Edition.
Composition and Evolution of Operating Systems Introduction to Operating Systems: Module 2.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
10/12/ Embedded XINU and WRT54GL. 10/12/ Topics Logic and shift operators Data-driven vs function-driven Embedded XINU and WRT54GL.
Operating Systems. Definition An operating system is a collection of programs that manage the resources of the system, and provides a interface between.
CHAPTER 4 10/29/ RTS: Kernel Design and Cyclic Executives CE321-fall2013.
OPERATING SYSTEMS Lecture 3: we will explore the role of the operating system in a computer Networks and Communication Department 1.
I/O Computer Organization II 1 Interconnecting Components Need interconnections between – CPU, memory, I/O controllers Bus: shared communication channel.
SAPC Hardware Pentium CPU (or 486) 4M usable memory no hard disk; boot from floppy no keyboard or monitor or mouse COM2 serial port: used for console i/o.
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
Processes Introduction to Operating Systems: Module 3.
Operating System Principles And Multitasking
12/8/ Embedded XINU and WRT54GL. 12/8/ Topics WRT54GL architecture and internals Embedded XINU Logic and shift operators.
CCNA2 Chapter 2 Cisco IOS Software. Cisco’s operating system is called Cisco Internetwork Operating System (IOS) IOS provides the following network services:
1/8/ Embedded XINU and WRT54GL. 1/8/ Topics WRT54GL architecture and internals Embedded XINU Logic and shift operators.
© 2006 Cisco Systems, Inc. All rights reserved.Cisco PublicITE I Chapter 6 1 Router Initialization steps.
Chapter 2 Process Management. 2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states.
Implementation of Embedded OS Lab3 Porting μC/OS-II.
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
3/12/ Embedded XINU and WRT54GL. 3/12/ Topics Logic and shift operators Optimizing operations (mul, div VS shiftL, shiftR) WRT54GL architecture.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Operating System (Reference : OS[Silberschatz] + Norton 6e book slides)
An operating system for a large-scale computer that is used by many people at once is a very complex system. It contains many millions of lines of instructions.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
Cisco 2 - Routers Perrine. J Page 16/26/2016 Chapter 2 Cisco IOS Software Cisco’s operating system is called Cisco Internetwork Operating System (IOS)
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
CT101: Computing Systems Introduction to Operating Systems.
Introduction to Operating Systems Concepts
Chapter Objectives In this chapter, you will learn:
Real time systems RTS Engineering.
Credits: 3 CIE: 50 Marks SEE:100 Marks Lab: Embedded and IOT Lab
RTS: Kernel Design and Cyclic Executives
OPERATING SYSTEMS CS3502 Fall 2017
Hardware Considerations
Embedded XINU and WRT54GL
RTS: Kernel Design and Cyclic Executives
RTS: Kernel Design 11/30/2018.
Operating Systems Chapter 5: Input/Output Management
RTS: Kernel Design and Cyclic Executives
RTS: Kernel Design 1/2/2019.
Threads Chapter 4.
RTS: Kernel Design and Cyclic Executives
RTS: Kernel Design and Cyclic Executives
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Realtime Embedded System Design
Embedded XINU and WRT54GL
Presentation transcript:

Realtime Systems Fundamnetals B. Ramamurthy

Topics for Discussion Project 1 Review Kernel and device drivers Realtime kernel fundamentals (chapter 3)

Project 1: Load Embedded XINU into WRT54GL wireless router We create a little computer out of WR54GL by loading embedded XINU in to its RAM. Read project 1 handout Assemble the components needed to add a UART chip to the WRT54GL that will enable you to access WRT54GL storage and devices. Obtain a cross-compiler to compile embedded XINU kernel into MIPS code for the CPU on WRT54GL. We have downloaded a Linux-based cross-compiler that will compile the embedded XINU files and generate xinu.boot or variations of this. Download embedded xinu tar ball and untar it and compile it (gmake) to obtain it to generate the xinu.boot Lets study the various components of the embedded XINU distribution.

AUTHORS include/ LICENSE README system/ Once you have downloaded and extracted the xinu tarball, you will see a basic directory structure: AUTHORS include/ LICENSE README system/ tty/ compile/ lib/ loader/ shell/ test/ uart/ AUTHORS is a brief history of contributors to the XINU operating system in it's varying iterations. compile/ contains the Makefile and other necessities for building the XINU system once you have a cross-compiler. include/ contains all the header files used by XINU. lib/ contains a folder (libxc/) with a Makefile and source for the library, as well as a binary blob which contains the pre-compiled library. LICENSE is the license under which this project falls. loader/ contains assembly files and is where the bootloader will begin execution of O/S code. README is this document. shell/ contains the source for all shell related functions. system/ contains the source for all system functions such as the nulluser process (initialize.c) as well as code to set up a C environment (startup.S). test/ contains a number of testcases (which can be run using the shell command testsuite). tty/ contains the source for the tty driver. uart/ contains the source for the uart driver.

Next steps Connect the serial port of the modified hardware to the serial port of a host computer with xinu.boot code. Use a serial communication program (we used Hyperterminal) to configure the serial port of the host to the settings: 8 data bits, no parity bit, and 1 stop bit (8N1) with a speed of 115,200 bps. Use another router to form a local network and assign IP addresses to the router and the host computer. Power up the WRT54GL. If you send cntrlC (break) characters from host console, you will see it responding with CFE> (common firmware environment for WRT54GL) The Broadcom Common Firmware Environment (CFE) is a collection of software modules for initialization and bootstrap of designs incorporating Broadcom MIPS64™ processors. Link Serial port you created is your means to communicate with WRT54GL CFE Use a TFTP on the host to make the boot images available on the network for XINU to boot. (How?) ifconfig eth0 –auto (obtain ip address for eth0 of WRT54GL) boot -elf [host ip]:xinu.boot (initiate a TFTP boot) Above two commands are given from CFE command line Once XINU boots (uploads into the RAM), you will see XINU shell. Now you can run XINU commands: help, ps etc. Add a simple C program hello.c to print “hello world”. End of first project.

Kernel & Device drivers Servers (application ~, web ~, component ~) Shell XWin Thread lib ftp User applications System call interface Process, memory, file system, network managers. Kernel Device drivers Hardware/controller Devices

Real-time Kernels A process is an abstraction of a running program and a logical unit of work scheduled by the operating system. A thread is a light weight process that represents of a flow of control thorough a process. Real-time operating system must provide these specific functions for processes: Scheduling Dispatching Intercommunication and synchronization Kernel of an operating system provides these functions.

Simple kernels Polled loop: Say a kernel needs to process packets that are transferred into the DMA and a flag is set after transfer: for(;;) { if (packet_here) { process_data(); packet_here=0; } Excellent for handling high-speed data channels, a processor is dedicated to handling the data channel. Disadvantage: cannot handle bursts

Simple kernels: cyclic executives Illusion of simultaneity by taking advantage of relatively short processes in a continuous loop: for(;;) { process_1(); process_2(); process_3(); … process_n(); } Different rate structures can be achieved by repeating tasks in the list:

Cyclic Executives: example: Interactive games Space invaders: for(;;) { check_for_keypressed(); move_aliens(); check_collision(); update_screen(); } check_keypressed() checks for three button pressings: move tank left or right and fire missiles. If the schedule is carefully constructed we could achieve a very efficient game program with a simple kernel as shown above.

Finite state automata and Co-routine based kernels void process_a(void){ for(;;) { switch (state_a) { case 1: phase_a1(); | case 2: phase_a2(); | …. case n: phase_an();}}} void process_b(void){ switch (state_b) { case 1: phase_b1(); | case 2: phase_b2(); | case n: phase_bn();}}} state_a and state_b are state counters; Communication between coroutines thru’ global variables; Example: the fanous CICS from IBM : Customer Information Control System IBM’s OS/2 uses this in Windows presentation management.

Interrupt driven systems Main program is a simple loop. Various tasks in the system are schedules via software or hardware interrupts; Dispatching performed by interrupt handling routines. Hardware and software interrupts. Hardware: asynchronous Software: typically synchronous Executing process is suspended, state and context saved and control is transferred to ISR (interrupt service routine)

Interrupt driven systems: code example void main() { init(); while(TRUE); } void int1(void){ save (context); taks1(); retore (context);} restore (context);} Foreground/background systems is a variation of this where main does some useful task in the background;

Process scheduling Scheduling is a very important function in a real-time operating system. Two types: pre-run-time and run-time Pre-run-time scheduling: create a feasible schedule offline to meet time constraints, guarantee execution order of processes, and prevents simultaneous accesses to shared resources. Run-time scheduling: allows events to interrupt processes, on demand allocation of resources , and used complex run-time mechanisms to meet time constraints.

Task characteristics of real workload Each task Ti is characterized by the following temporal parameters: Precedence constraints: specify any tasks need to precede other tasks. Release or arrival time: ri,j: jth instance of ith task Phase Φi: release time of first instant of ith task Response time: time between activation and completion Absolute deadline: instant by which task must complete Relative deadline: maximum allowable response time Period Pi: maximum length of intervals between the release times of consecutive tasks. Execution time: the maximum amount of time required to complete a instance of the task assuming all the resources are available. Lets look at some examples.