Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Advantages of Operating Systems vs. Raw Hardware Raw HardwareOperating System.

Similar presentations


Presentation on theme: "CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Advantages of Operating Systems vs. Raw Hardware Raw HardwareOperating System."— Presentation transcript:

1 CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Advantages of Operating Systems vs. Raw Hardware Raw HardwareOperating System Fast software (no overhead) Simpler development for 1-trick systems Better development environment (API) Stability guarantees Multitasking support Do you need an OS? Only if you need a flexible environment

2 CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst The 3 Roles of an OS Process Management – Control what tasks happen when and in what order/priority Memory Management – Allocate memory resources to processes – Protect processes from one accessing each others’ memory spaces. I/O (Device) Management –Provide an API for device interaction – Protect devices from misuse (abstraction barrier!) – Arbitrate between processes who would like to use a device

3 CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Device Drivers Part of the OS or integrated with the OS (from a 3 rd party/manufacturer) –In raw hardware systems, a function library for HW support is ~= a device driver Provide the interface between the HW device and the user software. Usually implemented through a series of system calls –Software-triggered interrupt which the OS handles –Function often based upon register states when the call happened

4 CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Components of Drivers A typical device driver will contain at least a subset of these functions: –Install (someone plugged it into the system – think USB) –Uninstall (removed) –Enable (give a device power/ set it up) –Disable –Acquire (acquire permission to use the device – for process protection) –Release (relinquish control of the device) –Read –Write –Startup (on boot-up) –Shutdown (on shut-down) These functions, besides manipulating data and devices, also move the device between 3 (normally) different states: Inactive – Busy – Idle(Finished)

5 CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst The Boot Process “Bootstrap” is the method by which a system brings itself up from reset/power on to a normal running state Some tasks to consider for this sequence (not ordered): –Self-diagnostics –Initializing registers –Initializing MMRs (clocks, power settings, memory map, bus settings) –Setting up ABI standards (starting the stack/heap, etc) –Enabling/Configuring interrupts –Move programs into memory –Transfer control to a program (main())

6 CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst CodeWarrior/MPC 555 Boot Process Our CodeWarrior projects implement a configurable boot process. You can find the code for it in these files: eppc_exception.asm MPC555CME_init.c __ppc_eabi_init.c __start.c – Not in project – located in: C:\Program Files\Freescale\CodeWarrior EPPC 5xx V8.7\PowerPC_EABI_Support\Runtime\src (numbers used to denote which file functions are in on next slide) (4) (3) (2) (1)

7 CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst CodeWarrior/MPC 555 Boot Process 1.Reset Interrupt starts everything 2.Interrupt handler table calls __reset() function 3._reset() enables machine check exceptions (for sanity) and calls _start() Note that everything is using nofralloc – there’s no stack yet! 4._start() calls _init_registers() to set up SP and other EABI reserved regs 5._start() calls _init_hardware() 6._init_hardware() takes care of some special cases and calls usr_init() 7.usr_init() is where the developer can configure the machine MMR setup that will be used at boot time. Sets up clock, power, interrupts, and most importantly, the memory controller. 8._start() allocates the stack base and the heaps 9._start() calls main () 10.main() returns, leading to an exit()-type routine (1) (2) (3) (4) (1) (4)


Download ppt "CS 478: Microcontroller Systems University of Wisconsin-Eau Claire Dan Ernst Advantages of Operating Systems vs. Raw Hardware Raw HardwareOperating System."

Similar presentations


Ads by Google