® 14-2 Optional Products 14.1Overview Shared Memory Objects (VxMP) Virtual Memory (VxVMI)

Slides:



Advertisements
Similar presentations
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Advertisements

Threads, SMP, and Microkernels
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Global Environment Model. MUTUAL EXCLUSION PROBLEM The operations used by processes to access to common resources (critical sections) must be mutually.
Ch. 7 Process Synchronization (1/2) I Background F Producer - Consumer process :  Compiler, Assembler, Loader, · · · · · · F Bounded buffer.
5.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 5: CPU Scheduling.
Typical Memory Layout sysPhysMemTop() sysMemTop() FREE_RAM_ADRS
 Wind River Systems, Inc Chapter - 8 Memory.
Computer Systems/Operating Systems - Class 8
Architectural Support for OS March 29, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
6-1 I/O Methods I/O – Transfer of data between memory of the system and the I/O device Most devices operate asynchronously from the CPU Most methods involve.
Architectural Support for Operating Systems. Announcements Most office hours are finalized Assignments up every Wednesday, due next week CS 415 section.
CS 550 Amoeba-A Distributed Operation System by Saie M Mulay.
Inter Process Communication:  It is an essential aspect of process management. By allowing processes to communicate with each other: 1.We can synchronize.
1 I/O Management in Representative Operating Systems.
PRASHANTHI NARAYAN NETTEM.
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.
Chapter 8 Windows Outline Programming Windows 2000 System structure Processes and threads in Windows 2000 Memory management The Windows 2000 file.
VxWorks & Memory Management
1 Lecture 4: Threads Operating System Fall Contents Overview: Processes & Threads Benefits of Threads Thread State and Operations User Thread.
Multiple Processor Systems. Multiprocessor Systems Continuous need for faster and powerful computers –shared memory model ( access nsec) –message passing.
Chapter 4 Threads, SMP, and Microkernels Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design.
1-1 Embedded Network Interface (ENI) API Concepts Shared RAM vs. FIFO modes ENI API’s.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Threads and Processes.
Guide to Linux Installation and Administration, 2e1 Chapter 2 Planning Your System.
1-1 NET+OS Software Group Flash API Multiple flash memory bank support New Flash API introduction Detailed Flash API Function presentation Supporting.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Introduction to Concurrency.
CE Operating Systems Lecture 11 Windows – Object manager and process management.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
® 7-2 Semaphores 7.1Overview Binary Semaphores and Synchronization Mutual Exclusion.
VxWorks Fall 2005 Final Project CS 450: Operating Systems Section 1 Kenneth White Josh Houck Karl Ridgeway Mike Ripley Morgan Serene.
 Wind River Systems, Inc Appendix - E Shared Memory Network.
Source: Operating System Concepts by Silberschatz, Galvin and Gagne.
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
1 Threads, SMP, and Microkernels Chapter Multithreading Operating system supports multiple threads of execution within a single process MS-DOS.
1 CSE451 Architectural Supports for Operating Systems Autumn 2002 Gary Kimura Lecture #2 October 2, 2002.
RTX - 51 Objectives  Resources needed  Architecture  Components of RTX-51 - Task - Memory pools - Mail box - Signals.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
1 VxWorks 5.4 Group A3: Wafa’ Jaffal Kathryn Bean.
 Wind River Systems, Inc Chapter - 7 Intertask Communication.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
 Wind River Systems, Inc Chapter - 15 Optional Products.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
CHAPTER 3 Router CLI Command Line Interface. Router User Interface User and privileged modes User mode --Typical tasks include those that check the router.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Big Picture Lab 4 Operating Systems C Andras Moritz
Introduction to threads
Memory Management.
Topics Covered What is Real Time Operating System (RTOS)
Chapter 9: Virtual Memory
Chapter 2: System Structures
Chapter 3: Windows7 Part 2.
Chapter 3: Windows7 Part 2.
Operating Systems : Overview
Operating Systems : Overview
Multithreaded Programming
Chapter 2: Operating-System Structures
Tornado Training Workshop
Introduction to Operating Systems
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
Tornado Training Workshop
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
Intertask Communication
Chapter 6: Synchronization Tools
Chapter 2: Operating-System Structures
Presentation transcript:

® 14-2 Optional Products 14.1Overview Shared Memory Objects (VxMP) Virtual Memory (VxVMI)

® 14-3 Overview The following products may be purchased separately if desired. BSP Porting KitAssists porting VxWorks to a new board on a supported architecture. VxSimVxWorks simulation on a Solaris, HP-UX, or Windows host. Full simulator includes networking support and allows mulitiple simulators per host. WindNet SNMPProvides remote network management of target via SNMP. OSPFOpen Shortest Path First link-state routing protocol. More powerful than RIPv1/v2.

® 14-4 Overview StethoScopeHost based debugging tool with GUI. Monitor VxWorks program variables in real time, or store data and analyze later. Also contains a task profiler. VxMPHigh speed multiprocessing tools for distributed applications needing to communicate over the VMEbus. VxVMIVirtual memory support. Can restrict a tasks access to certain addresses. WindViewWindView support available for non-simulator targets as an optional product. TrueFFSFlash file system--provides wear-leveling and redundancy on FLASH parts.

® 14-5 Overview Tornado For Java Java Virtual Machine for VxWorks. Interoperable VxWorks tasks and Java threads. Zinc for VxWorks Small (about 0.5 MB) configurable C++ GUI Toolkit and libraries. Allows customized look and feel for graphical applications. eNavigator /HTMLWorkseNavigator is an embeddable browser, based on Netscape Navigator; includes a toolkit for customization and scalability. HTMLWorks allows construction of HTML-based graphical interfaces.

® 14-6 Overview CodeTestCode coverage and memory leak checking tool. WindNavigatorCode browsing tool with support for C and C++. Able to construct call tree. Look!C++ visualization and debugging tool. Allows graphical exploration of a C++ program as it executes.

® 14-7 Optional Products Optional Products Overview 14.2Shared Memory Objects (VxMP) Virtual Memory (VxVMI)

® 14-8 VxMP Features Allows multiprocessing on the VMEbus. Faster than shared memory network. Components: Name databaseAllows boards to share information on objects. Shared semaphoresFor mutual exclusion and synchronization. Shared message queuesFor message passing. Shared memory managerTo dynamically allocate and free shared memory blocks. Familiar interface (e.g., semGive( ), msgQSend( )).

® 14-9 Example Usage The tFooServer task on CPU1 wants to read requests from a shared message queue: 1.It first creates the message queue. 2.It then registers the MSG_Q_ID in the name database under the name “ServerSMQueue” 3.Finally, it reads and services requests in a loop. The tFooClient task on CPU0 wants to send a request to tFooServer: 1.It first queries the name database to find the MSG_Q_ID under the name “ServerSMQueue” 2.This MSG_Q_ID is then used to send requests to the server.

® Registering Shared Objects STATUS smNameAdd (name, objId, type) nameString used to name this object. objIdShared memory object identifier (e.g., SEM_ID or MSG_Q_ID). typeThe type of shared memory object (e.g. binary semaphore or message queue). Registers the object in the name database. Typically called right after object creation.

® Finding Shared Objects STATUS smNameFind (name, &objId, &type, wait) nameName to find in the database. objIdObject id returned through this variable. typeObject type returned. waitWait until the object is created. Can be NO_WAIT or WAIT_FOREVER. Does not specify timeout in ticks. Obtains the objId of an object created on another board.

® Shared Semaphores SEM_ID semBSmCreate (options, initialState) SEM_ID semCSmCreate (options, initialCount) Creation routines similar to local semaphore creation routines, except options must be SEM_Q_FIFO. Mutex semaphores are not provided. Once created, semLib routines (e.g., semGive( ), semTake( )) work as before, except –Can not give a semaphore from an ISR. –May not delete semaphores.

® Shared Message Queues MSG_Q_ID msgQSmCreate (maxMsgs, maxMsgLen, options) Creation routine similar to local message queue creation routine, except options must be MSG_Q_FIFO. Once created, msgQLib routines (e.g., msgQSend( ), msgQReceive( )) work as before, except can not send a message from an ISR.

® Shared Memory Manager Can dynamically allocate/free blocks of shared memory: void * smMemMalloc (nBytes) smMemFree (void * ptr) These routines use local addresses. When exchanging address information through the name database, may need to call: void * smObjLocalToGlobal (localAdrs) void * smObjGlobalToLobal (globalAdrs)

® Creating Shared Memory Partitions To creates additional shared memory partitions: PART_ID memPartSmCreate (pPool, poolSize) pPoolAddress of some shared memory. poolSizeSize of this pool. Manipulated with memPartLib routines (just like local partitions).

® Terminology Shared Memory Master Shared Memory Master - CPU 0. Initializes the shared memory objects data structures. Once initialized, all boards are peers. Shared Memory Shared Memory - Memory used for shared memory objects. Can be dual ported RAM on CPU0, or RAM on a memory card, but it must be accessible to all CPU’s. Anchor Anchor - Structure containing ready value and an offset to shared memory. Must be at an address known by all CPU’s. Heartbeat Heartbeat - Integer incremented once per second by CPU0, used to indicate that the shared memory objects system is alive. Ready Value Ready Value - Stored in anchor by CPU0 to indicate that the shared memory objects facility is initialized.

® System Requirements All boards must support an atomic read-modify-write cycle (e.g., test and set) in hardware. Software implementation limits the number of CPU’s to 20 (CPU0 through CPU19). Hardware considerations may limit this number further.

® Caveats Non-deterministic; exclusive access to shared memory object over the VMEbus is subject to unpredictable delays. Slower than corresponding local objects; only use for distributed applications. Increases interrupt latency; interrupts are locked out while shared memory object is updated.

® Initialization /operating system components/kernel components/shared memory objects Include the component /operating system components/kernel components/shared memory objects. If booting over the shared memory network, no extra initialization necessary. If not booting over the shared memory network: 1.On CPU0, configure the location and size of the shared memory region. Boot CPU0. 2.Before another CPU can access shared memory objects, you must: Calculate anchor address as seen by that board (as discussed in the shared memory network chapter). Specify SM_ANCHOR_ADRS parameter and rebuild VxWorks for that CPU.

® Shared Memory Location/Size (CPU0) Example parameter values for CPU0: SM_ANCHOR_ADRS ((char *) 0xfb800000) SM_OBJ_MEM_ADRS (SM_MEM_ADRS+SM_MEM_SIZE) SM_OBJ_MEM_SIZE 0x80000 SM_OFF_BOARD FALSE SM_ANCHOR_ADRS ((char *) 0xfb800000) SM_MEM_ADRS SM_ANCHOR_ADRS SM_MEM_SIZE 0x80000 SM_OBJ_MEM_ADRS (SM_MEM_ADRS+SM_MEM_SIZE) SM_OBJ_MEM_SIZE 0x80000

® : Calculating the Anchor Address (for other CPU’s) 1.If the anchor is in dual ported memory on CPU0, call sysLocalToBusAdrs( ) on CPU0 to calculate the VMEbus address of the anchor. 2.Call sysBusToLocalAdrs( ) on each other CPU board to calculate the local address which maps to the anchor’s VMEbus address. May need to examine source code for this routine if this CPU has not booted. More information, and an example anchor address calculation, are available in the Shared Memory Network appendix.

® Other Configuration Parameters Other configuration parameters and their default values: ConstantDescription (default value) SM_OBJ_MAX_TASKMaximum number of tasks using shared memory objects (40) SM_OBJ_MAX_SEMMaximum number of semaphores (30). SM_OBJ_MAX_MSG_QMessage queues (10). SM_OBJ_MAX_MEM_PARTMemory partitions (4) SM_OBJ_MAX_NAMENames in database (100). SM_OBJ_MAX_TRIESTries to obtain lock (100).

® Optional Products Overview Shared Memory Objects (VxMP) 14.3Virtual Memory (VxVMI)

® VxVMI Features Allows write protecting: –The interrupt vector table. –Program text. –Crucial user data. Makes application safer. Makes debugging easier since writing to a protected area will incur a bus error.

® Virtual Addresses

® Default Virtual Memory Context A mapping of virtual to physical addresses is called a virtual memory context. A global mapping is defined at system start-up. –Local memory, on board devices, and some VME addresses are mapped. –Same as physical mapping, except some VME addresses are not mapped. –Controlled by sysPhysMemDesc structure in sysLib.c. By default, all tasks use the global mapping.

® Other Uses of VxVMI Can dynamically create new virtual memory contexts. User is responsible for managing the contexts: –Initializing virtual to physical address maps in newly created contexts. –Swapping between contexts. Low level support routines provided. Allows application to restrict a set of addresses to: –Only to one task. –Only to a select group of tasks. –Only through a library.

® Including VxVMI /hardware/memory/MMU/MMU Mode/full MMU support Include /hardware/memory/MMU/MMU Mode/full MMU support component..../basic MMU Note: The component.../basic MMU support is not part of VxVMI. It is bundled with VxWorks to provide support for cacheLib.

® Write Protection - Text and Vector Table /hardware/memory/MMU/write protect vector table Include the component /hardware/memory/MMU/write protect vector table to write protect the interrupt vector table. /hardware/memory/MMU/write protect program text Include /hardware/memory/MMU/write protect program text to write protect program text. Prevents accidental modifications. Intentional modification can still occur (e.g., via intConnect( )).

® Write Protection Overview- User Data 1.Allocate a page aligned buffer. 2.Fill buffer with data. 3.Modify the state of the page to be read-only.

® Allocating Page Aligned Buffers void * valloc (nBytes) nBytesNumber of bytes to allocate. Returns a pointer to allocated buffer, or NULL on error. Allocated buffer will begin on a page boundary. nBytes should be a multiple of VM_PAGE_SIZE. If not, then other data might get write protected when we try to write protect our buffer.

® Changing Page States STATUS vmStateSet (context, pVirtual, len, stateMask, state) contextA VM_CONTEXT_ID, or NULL to use current context. pVirtuaVirtualaddress of page to modify. lenNumber of pages affected (in bytes). stateMaskWhich states to modify. stateState to set.

® Write Protection Example char *buf; /* Allocate physical memory on a page boundary */ buf = (char *)valloc (VM_PAGE_SIZE); /* fill buf with important data */... /* write protect virtual memory buf */ vmStateSet (NULL, buf, VM_PAGE_SIZE, VM_STATE_MASK_WRITABLE, VM_STATE_WRITABLE_NOT);