Fully Preemptive nxtosek Kernel with Preemption Threshold Scheduling

Similar documents
Operating System. Hanyang University. Hyunmin Yoon Operating System Hanyang University

ELC4438: Embedded System Design ARM Cortex-M Architecture II

PROCESS SCHEDULING II. CS124 Operating Systems Fall , Lecture 13

Design and Implementation Interrupt Mechanism

Interrupts (Exceptions) Gary J. Minden September 11, 2014

KERNEL THREAD IMPLEMENTATION DETAILS. CS124 Operating Systems Winter , Lecture 9

Interrupts (Exceptions) (From LM3S1968) Gary J. Minden August 29, 2016

AN316 Determining the stack usage of applications

Interrupts and Low Power Features

DSP/BIOS Kernel Scalable, Real-Time Kernel TM. for TMS320 DSPs. Product Bulletin

EE458 - Embedded Systems Exceptions and Interrupts

18-349: Introduction to Embedded Real-Time Systems

Today s Topics. u Thread implementation. l Non-preemptive versus preemptive threads. l Kernel vs. user threads

Engineer To Engineer Note

real-time kernel documentation

Threads and Concurrency

Threads and Concurrency

Processes Prof. James L. Frankel Harvard University. Version of 6:16 PM 10-Feb-2017 Copyright 2017, 2015 James L. Frankel. All rights reserved.

COEN-4720 Embedded Systems Design Lecture 4 Interrupts (Part 1) Cristinel Ababei Dept. of Electrical and Computer Engineering Marquette University

Process Scheduling Queues

A New Real-time Kernel development on an embedded platform

Operating System Concepts Ch. 5: Scheduling

Why use an Operating System? Operating System Definition

ARM Advanced Interrupt Controller

Windows Interrupts

COMP I/O, interrupts, exceptions April 3, 2016

Today s Topics. u Thread implementation. l Non-preemptive versus preemptive threads. l Kernel vs. user threads

CODE TIME TECHNOLOGIES. Abassi RTOS. Porting Document. ARM Cortex-M3 CCS

Embedded Operating Systems

Concurrent and Distributed Systems Introduction

Implementing In-Application Programming on the ADuC702x

Virtual machines are an interesting extension of the virtual-memory concept: not only do we give processes the illusion that they have all of memory

Objectives. Making TOS preemptive Avoiding race conditions

Grundlagen Microcontroller Interrupts. Günther Gridling Bettina Weiss

Precept 3: Preemptive Scheduler. COS 318: Fall 2018

CODE TIME TECHNOLOGIES. Abassi RTOS. Porting Document MSP430/X CCS

1.1 CPU I/O Burst Cycle

Lecture 4: Mechanism of process execution. Mythili Vutukuru IIT Bombay

6.033 Spring 2018 Lecture #5

DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM

Lab 8 Real-time OS - 1

Lesson 5: Software for embedding in System- Part 2

CODE TIME TECHNOLOGIES. Abassi RTOS. Porting Document MSP430 GCC

What s An OS? Cyclic Executive. Interrupts. Advantages Simple implementation Low overhead Very predictable

embos Real Time Operating System CPU & Compiler specifics for ARM core with ARM RealView Developer Suite 3.0 Document Rev. 1

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Interrupt Handling Module No: CS/ES/13 Quadrant 1 e-text

The ARM Cortex-M0 Processor Architecture Part-1

Designing Responsive and Real-Time Systems

Introduction to Embedded Systems

Review: Program Execution. Memory program code program data program stack containing procedure activation records

Review: Program Execution. Memory program code program data program stack containing procedure activiation records

Processes and Non-Preemptive Scheduling. Otto J. Anshus

Module 1. Introduction:

Homework. Reading. Machine Projects. Labs. Intel 8254 Programmable Interval Timer (PIT) Data Sheet. Continue on MP3

ARM Interrupts. EE383: Introduction to Embedded Systems University of Kentucky. James E. Lumpp

Newbie s Guide to AVR Interrupts

Cooperative Multitasking

So far. Next: scheduling next process from Wait to Run. 1/31/08 CSE 30341: Operating Systems Principles

Operating System. Hanyang University. Hyunmin Yoon Operating System Hanyang University

ECE251: Thursday September 27

6.033 Spring Lecture #5. Threads Condition Variables Preemption spring 2018 Katrina LaCurts

ECE 598 Advanced Operating Systems Lecture 8

ARM Cortex-M and RTOSs Are Meant for Each Other

Review: Program Execution. Memory program code program data program stack containing procedure activation records

Measuring Interrupt Latency

CODE TIME TECHNOLOGIES. Abassi RTOS. Porting Document. ARM Cortex-A9 CCS

Interrupts, Etc. Operating Systems In Depth V 1 Copyright 2018 Thomas W. Doeppner. All rights reserved.

Real-Time Systems Resource Access Protocols

Introduction to Embedded Systems. Lab Logistics

CODE TIME TECHNOLOGIES. mabassi RTOS. Porting Document. SMP / ARM Cortex-A9 CCS

In Class Assignment 2

CODE TIME TECHNOLOGIES. Abassi RTOS. Porting Document. ATmega128 GCC

ECE 477 Digital Systems Senior Design Project. Module 10 Embedded Software Development

Review: Program Execution. Memory program code program data program stack containing procedure activation records

Chapter 7 Subroutines. Richard P. Paul, SPARC Architecture, Assembly Language Programming, and C

int $0x32 // call interrupt number 50

Virtual Machines & the OS Kernel

A Methodology for Interrupt Analysis in Virtual Platforms

IoT and Security: ARM v8-m Architecture. Robert Boys Product Marketing DSG, ARM. Spring 2017: V 3.1

Please do not handin a.doc file, a.zip file, a.tar file, or anything else

Review: Program Execution. Memory program code program data program stack containing procedure activation records

OSEK Standard and experiments on microcontroller devices. Paolo Gai Evidence Srl

Interrupt/Timer/DMA 1

+ Overview. Projects: Developing an OS Kernel for x86. ! Handling Intel Processor Exceptions: the Interrupt Descriptor Table (IDT)

CODE TIME TECHNOLOGIES. Abassi RTOS. Porting Document MSP430 IAR

Link Service Routines

Exam TI2720-C/TI2725-C Embedded Software

Evaluation of Real-time Performance in Embedded Linux. Hiraku Toyooka, Hitachi. LinuxCon Europe Hitachi, Ltd All rights reserved.

CODE TIME TECHNOLOGIES. Abassi RTOS. Porting Document. ARM Cortex-M0 Atollic

Homework / Exam. Return and Review Exam #1 Reading. Machine Projects. Labs. S&S Extracts , PIC Data Sheet. Start on mp3 (Due Class 19)

KEY CENG 334. Midterm. Question 1. Question 2. Question 3. Question 4. Question 5. Question 6. Total. Name, SURNAME and ID

Embedded System Curriculum

Lecture 3. Introduction to Real-Time kernels. Real-Time Systems

RTA-OS V850E2/GHS Release Note - Version ( )

BUD17-301: KVM/ARM Nested Virtualization. Christoffer Dall

CPS221 Lecture: Operating System Protection

October, Saeid Nooshabadi. Overview COMP 3221

Fast Interrupts. Krste Asanovic, UC Berkeley / SiFive Inc. (Chair) Kevin Chen, Andes (Vice-Chair)

LatencyMon has been analyzing your system for 0:09:55 (h:mm:ss) on all processors.

For more notes of DAE

Transcription:

Fully Preemptive nxtosek Kernel with Preemption Threshold Scheduling Jimit Doshi (jdoshi@ncsu.edu) and Saransh Gupta (sgupta20@ncsu.edu) We present below the tasks done so far for this project. Essentially, we have mapped out the entire flow chart for normal scheduler operation as documented below: Normal Scheduler Operation We begin with the timer ISR handler in the irq.s file from where the execution begins in case of a systick interrupt. File: irq.s Routine : (macro) irq_wrapper_type2, C_function, isr

File : cpu_support.s Routine : _interrupt Only for call_level == TCL_TASK does the sp gets pointed to the top of the stack (_system_stack_). This is because otherwise it s an irs_to_isr call in which case the data from the previous isr is still saved on the system stack, and so sp should not be pointed to the top of the stack.

File : cpu_support.s Routine : int_from_int

File : cpu_support.s Routine : int_return

Whenever interrupt occurs the core does the below: 1. CSPR is stored in the SPSR of the new mode (IRQ Mode in our case). 2. lr_irq = pc Hence if nested interrupts are allowed without any precautions, lr would get corrupted (previous isr s lr would be overwritten). Therefore to support nested ISR s move processing to System stack after saving lr_irq in System stack (and this can be done recursively) Therefore, towards the end of the interrupt, the lr_irq value needs to be popped from the System stack (as it was stored there at the beginning of the ISR). File : cpu_support.s Routine : ret_int

File : cpu_support.s Routine : dispatcher

Open Points / Key Observations: 1. Entire ISR is executed from the System stack and this architecture is followed to support nested interrupts, so that a given isr s lr doesn t get corrupted when another isr occurs within it. 2. While the IRQ interrupts are disabled explicitly in int_from_int, we couldn t figure out yet where/when are they enabled again. 3. Analysis of the int_from_int code shows that in case of preemption, before the preempting task s execution is begun sp is pointed back to the preempted task s stack (and not the system stack). This implies execution of the preempting task occurs in the preempted task s stack. As such, this should support nested preemptions. We need to figure out what is preventing this (nested preemptions) from happening. Of course, the fact that interrupts are disabled (and hence the scheduler/kernel is suppressed) is the root cause, however, if we resolve that, then do we have any other blocking point to prevent nested preemptions? We don t think so, based on our current understanding of the code. 4. We have studied the theoretical aspects of PTS algorithm but haven t started with the implementation yet, as it would be premature to do so without having a kernel that supports nested preemption. We plan to take it up once we are done with the implementation and testing to support nested preemptions. Tasks Accomplished (with reference to the Project proposal): Task Understand the complete assembly code used for dispatch and ISR routines Analyze the impact of making changes in the kernel scheduler on any other part of nxtosek Documentation of understanding, preparation of interim report Team Member Jimit Saransh Jimit & Saransh Tasks in progress / planned: Task Team Member Date Coordinate with nxtosek kernel Saransh & Jimit 4/4/2014 designers/contributors and also Dr.Mueller for their support in understanding the issue with preemption or the rationale behind present implementation Design algorithm and implementation to resolve the preemption issue Jimit 4/15/2014

Design test cases and perform Saransh 4/20/2014 validation PTS algorithm design and Saransh 4/22/2014 implementation PTS test and validation Jimit 4/24/2014 Final report preparation Saransh & Jimit 4/25/2014 Presentation Saransh & Jimit 4/27/2014 PTS implementation is subject to timely and successful completion of nested preemption implementation.