ECE 471 Embedded Systems Lecture 12

Similar documents
ECE 471 Embedded Systems Lecture 16

ECE 471 Embedded Systems Lecture 16

ECE 471 Embedded Systems Lecture 15

ECE 598 Advanced Operating Systems Lecture 2

64 bit Bare Metal Programming on RPI-3. Tristan Gingold

ECE 598 Advanced Operating Systems Lecture 22

PL-I Assignment Broup B-Ass 5 BIOS & UEFI

ECE 471 Embedded Systems Lecture 22

ECE 598 Advanced Operating Systems Lecture 10

ECE 598 Advanced Operating Systems Lecture 14

ECE 598 Advanced Operating Systems Lecture 11

ECE 598 Advanced Operating Systems Lecture 4

ECE 598 Advanced Operating Systems Lecture 14

ECE 471 Embedded Systems Lecture 5

ECE 471 Embedded Systems Lecture 4

The Early System Start-Up Process. Group Presentation by: Tianyuan Liu, Caiwei He, Krishna Parasuram Srinivasan, Wenbin Xu

Four Components of a Computer System

ECE 598 Advanced Operating Systems Lecture 14

ECE 471 Embedded Systems Lecture 2

ECE 571 Advanced Microprocessor-Based Design Lecture 12

ECE 471 Embedded Systems Lecture 2

ECE 574 Cluster Computing Lecture 8

ECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017

COS 318: Operating Systems

IA32 OS START-UP UEFI FIRMWARE. CS124 Operating Systems Fall , Lecture 6

Boot Process in details for (X86) Computers

Kernel Internals. Course Duration: 5 days. Pre-Requisites : Course Objective: Course Outline

Booting Linux Fast & Fancy. Embedded Linux Conference Europe Cambridge, Robert Schwebel

ECE 571 Advanced Microprocessor-Based Design Lecture 13

Advanced Embedded Systems

Misc. Third Generation Batch Multiprogramming. Fourth Generation Time Sharing. Last Time Evolution of OSs

ECE 498 Linux Assembly Language Lecture 1

Jan 20, 2005 Lecture 2: Multiprogramming OS

ECE 598 Advanced Operating Systems Lecture 10

ECE 471 Embedded Systems Lecture 2

COS 318: Operating Systems. Overview. Andy Bavier Computer Science Department Princeton University

ECE 471 Embedded Systems Lecture 12

Operating Systems. Introduction & Overview. Outline for today s lecture. Administrivia. ITS 225: Operating Systems. Lecture 1

Introduction to Embedded Bootloader. Intel SSG/SSD/UEFI

Scheduling. CS 161: Lecture 4 2/9/17

CS Operating Systems

Hard Disk Organization. Vocabulary

ECE 471 Embedded Systems Lecture 12

The Slide does not contain all the information and cannot be treated as a study material for Operating System. Please refer the text book for exams.

Lecture 4: Process Management

CST8177 Linux II. Linux Boot Process

9/19/18. COS 318: Operating Systems. Overview. Important Times. Hardware of A Typical Computer. Today CPU. I/O bus. Network

Introduction. What is an Operating System? A Modern Computer System. Computer System Components. What is an Operating System?

ECE 471 Embedded Systems Lecture 3

Operating Systems CS 571

Processes and Non-Preemptive Scheduling. Otto J. Anshus

Background: Operating Systems

University of Pennsylvania Zachary Goldberg. CIS c. More Kernel Bits. 10/03/09 Slide 1

Processes. CS 475, Spring 2018 Concurrent & Distributed Systems

Operating Systems (ECS 150) Spring 2011

BIOS. Chapter The McGraw-Hill Companies, Inc. All rights reserved. Mike Meyers CompTIA A+ Guide to Managing and Troubleshooting PCs

Porting Linux to a new SoC

Linux+ Guide to Linux Certification, Third Edition. Chapter 2 Linux Installation and Usage

ECE 598 Advanced Operating Systems Lecture 12

CSE 265: System and Network Administration

CSE 265: System and Network Administration

Introduction. CS3026 Operating Systems Lecture 01

ECE 571 Advanced Microprocessor-Based Design Lecture 24

CSC369 Lecture 2. Larry Zhang

HPS SoC Boot Guide - Cyclone V SoC Development Kit

Backup, File Backup copies of individual files made in order to replace the original file(s) in case it is damaged or lost.

Mon Sep 17, 2007 Lecture 3: Process Management

WD AV GP Large Capacity Hard Drives

CSC369 Lecture 2. Larry Zhang, September 21, 2015

ECE 471 Embedded Systems Lecture 20

ECE 598 Advanced Operating Systems Lecture 23

ECE 471 Embedded Systems Lecture 30

CSC Operating Systems Fall Lecture - I Introduction. Tevfik Ko!ar. Louisiana State University. August 25 th, Contact Information

Installing Linux (Chapter 8) Note packet # 4. CSN 115 Operating Systems Ken Mead Genesee Community College. Objectives

Enhancing PAPI with Low-Overhead rdpmc Reads

Topics. Operating System I. What is an Operating System? Let s Get Started! What is an Operating System? OS History.

ECE 571 Advanced Microprocessor-Based Design Lecture 21

Operating Systems Course 2 nd semester 2016/2017 Chapter 1: Introduction

Advanced Operating Systems and Virtualization. Alessandro Pellegrini A.Y. 2017/2018

ECE 471 Embedded Systems Lecture 6

CPSC 341 OS & Networks. Introduction. Dr. Yingwu Zhu

How To Reinstall Grub In Windows 7 Without Losing Data And Programs

ECE 598 Advanced Operating Systems Lecture 18

Comp 310 Computer Systems and Organization

Today: Computer System Overview (Stallings, chapter ) Next: Operating System Overview (Stallings, chapter ,

Last class: Today: Course administration OS definition, some history. Background on Computer Architecture

Embedded Linux Conference Europe Sascha Hauer

A+ Guide to Managing and Maintaining Your PC. How Hardware and Software Work Together

Longhorn Large Sector Size Support. Anuraag Tiwari Program Manager Core File System

Comparison on BIOS between UEFI and Legacy

Boot. How OS boots

UEFI Support for Memtest86+ Patricio Chilano Mateo

Booting Up & Processes

10 Steps to Virtualization

Topics. Operating System. What is an Operating System? Let s Get Started! What is an Operating System? Where in the Book are we?

TQ2440 Development Platform Manual

Chapter 2: Operating-System Structures

COS 318: Operating Systems. Overview. Prof. Margaret Martonosi Computer Science Department Princeton University

CS 61C: Great Ideas in Computer Architecture Virtual Memory. Instructors: John Wawrzynek & Vladimir Stojanovic

ECE 598 Advanced Operating Systems Lecture 5

Transcription:

ECE 471 Embedded Systems Lecture 12 Vince Weaver http://www.eece.maine.edu/~vweaver vincent.weaver@maine.edu 8 October 2015

Announcements Homework grades have been sent out, let me know if you did not receive them. Homework #5 was due Homework #6 will be posted today A midterm exam is coming up on the 22nd. 1

Homework 6 notes Handout should cover most of it bit-banging i2c Use the sysfs gpio interface and driving the SDA and SCL lines manually to talk to the 4x7 LED display A lot of the code is provided for you, follow the directions How do you set SDA low? How do you set SDA high? 2

Device Detection x86, well-known standardized platform. What windows needs to boot. Can auto-discover things like PCI bus, USB. Linux kernel on x86 can boot on most. Old ARM, hard-coded. So a rasp-pi kernel only could boot on Rasp-pi. Lots of pound-defined and hard-coded hw info. New way, device tree. A blob that describes the hardware. Pass it in with boot loader, and kernel can use 3

it to determine what hardware is available. So instead of Debian needing to provide 100 kernels, instead just 1 kernel and 100 device tree files that one is chosen at install time. Does mean that updating to a new kernel can be a pain. 4

Detecting Devices There are many ways to detect devices Guessing/Probing can be bad if you guess wrong and the hardware reacts poorly to having unexpected data sent to it Standards always knowing that, say, VGA is at address 0xa0000. PCs get by with defacto standards Enumerable hardware busses like USB and PCI allow you to query hardware to find out what it is and where 5

it is located Hard-coding have a separate kernel for each possible board, with the locations of devices hard-coded in. Not very maintainable in the long run. Device Trees see next slide 6

Devicetree Traditional Linux ARM support a bit of a copy-paste and #ifdef mess Each new platform was a compile option. No common code; kernel for pandaboard not run on beagleboard not run on gumstix, etc. Work underway to be more like x86 (where until recently due to PC standards a kernel would boot on any x86) A devicetree passes in enough config info to the kernel 7

to describe all the hardware available. Thus kernel much more generic Still working on issues with this. 8

Device Firmware Devices are their own embedded systems these days. May even have full CPUs, etc. Need to run code. Firmware. In ROM? Or upgradable? Why might you want to upgrade? (bug fixes, economy, etc.) Talk about recent USB firmware malware 9

Firmware Provides booting, configuration/setup, sometimes provides rudimentary hardware access routines. Kernel developers like to complain about firmware authors. Often mysterious bugs, only tested under Windows, etc. BIOS legacy 16-bit interface on x86 machines UEFI Unified Extensible Firmware Interface ia64, x86, ARM. From Intel. Replaces BIOS OpenFirmware old macs, SPARC LinuxBIOS 10

Boot Methods Firmware can be quite complex. Floppy Hard-drive (PATA/SATA/SCSI/RAID) CD/DVD USB Network (PXE/tftp) 11

Flash, SD card Tape Networked tape Paper tape? Front-panel switches? 12

Disk Partitions Way to virtually split up disk. DOS GPT old partition type, in MBR. Start/stop sectors, type Types: Linux, swap, DOS, etc GPT had 4 primary and then more secondary Lots of different schemes (each OS has own, Linux supports many). UEFI more flexible, greater than 2TB 13

Bootloaders on ARM uboot Universal Bootloader, for ARM and under embedded systems So both BIOS and bootloader like minimal OSes 14

Raspberry Pi Booting Unusual Small amount of firmware on SoC ARM 1176 brought up inactive (in reset) Videocore loads first stage from ROM This reads bootcode.bin from fat partition on SD card into L2 cache. It s actually a RTOS (real time OS in own right ThreadX ) 15

This runs on videocard, enables SDRAM, then loads start.elf This initializes things, the loads and boots Linux kernel.img. (also reads some config files there first) 16

More booting Most other ARM devices, ARM chip runs first-stage boot loader (often MLO) and second-stage (uboot) FAT partition Why FAT? (Simple, Low-memory, Works on most machines, In theory no patents despite MS s best attempts (see exfat)) The boot firmware (burned into the CPU) is smart enough to mount a FAT partition 17

Booting Linux Bootloader jumps into OS entry point Set Up Virtual Memory Setup Interrupts Detect Hardware / Install Device Drivers Mount filesystems Pass control to userspace / call init 18

Run init scripts rc boot scripts, /etc/rc.local Start servers, or daemons as they re called under Linux. fork()/exec(), run login, run shell 19

How a Program is Loaded on Linux Kernel Boots init started init calls fork() child calls exec() Kernel checks if valid ELF. Passes to loader Loader loads it. Clears out BSS. Sets up stack. Jumps 20

to entry address (specified by executable) Program runs until complete. Parent process returned to if waiting. Otherwise, init. 21

Viewing Processes You can use top to see what processes are currently running Also ps but that s a bit harder to use. 22

Context Switching OS provides the illusion of single-user system despite many processes running, by switching between them quickly. Switch rate in general 100Hz to 1000Hz, but can vary (and is configurable under Linux). Faster has high overhead but better responsiveness (guis, etc). Slower not good for interactive workloads but better for longrunning batch jobs. 23

You need to save register state. Can be slow, especially with lots of registers. When does context switch happen? Periodic timer interrupt. Certain syscalls (yield, sleep) when a process gives up its timeslice. When waiting on I/O Who decided who gets to run next? The scheduler. The scheduler is complex. Fair scheduling? If two users each have a process, who runs when? If one has 99 and one has 1, which runs 24

next? Various O() ratios for the schedulers 25