Intel Embedded System Design Contest

Size: px
Start display at page:

Download "Intel Embedded System Design Contest"

Transcription

1 Intel Embedded System Design Contest Technical Notes FPGA Peripheral Linux Driver Usage Notes Rev 0.00 Date: 2012/03/13 Technical Notes Document Information TYPE Key words Abstract FPGA, Peripherals, driver CONTENT This document describes how to use FPGA peripheral drivers Guangzhou ZHIYUAN Electronics Stock Co., Ltd.

2 Revision History Version Rev. Date Modifications Original version. i Revision History

3 Content Chapter 1: LED Driver Function How to use... 1 Chapter 2: Toggle Switch Function How to use... 2 Charter 3: 12-bit ADC Function How to use... 3 Charter 4: 8-bit ADC Function How to use... 4 Charter 5: 10-bit DAC Function How to use... 5 Charter 6: Buttons Function How to use... 6 ii Content

4 Chapter 1: LED Driver 1.1 Function The LED driver controls the states of 8 LEDs. 1.2 How to use The LED driver provides the operation interfaces to LEDs for user application; these interfaces are saved as files in the following directories: /sys/class/leds/zlge6x5c:red:0/ /sys/class/leds/zlge6x5c:red:1/ /sys/class/leds/zlge6x5c:red:2/ /sys/class/leds/zlge6x5c:red:3/ /sys/class/leds/zlge6x5c:red:4/ /sys/class/leds/zlge6x5c:red:5/ /sys/class/leds/zlge6x5c:red:6/ /sys/class/leds/zlge6x5c:red:7/ Each of these directories is corresponding to one LED, and each directory contains one file named brightness, writing a 0 to this file means to turn off the LED, writing a numerical string that more than 0 means to turn on the LED. For example: Turn off LED0: # echo 0 > /sys/class/leds/zlge6x5c:red:0/brightness Turn on LED0 # echo 1 > /sys/class/leds/zlge6x5c:red:0/brightness Notes: User should determine the actual state of the LED based on the test results; FPGA firmware does not provide a default state for each LED. 1 Chapter 1: LED Driver

5 Chapter 2: Toggle Switch 2.1 Function The Toggle Switch driver can indicate the status of the toggle switches. 2.2 How to use The Toggle Switch driver provides the operation interface to toggle switch for user application; this interface is saved as a file in the following directory: /sys/bus/pci/devices/0000:01:00.0/zlge6x5c-switch/ User can get the current status of the switch by reading the switch file. For the lowest four bits, each bit represents a status of a switch. For example: cat /sys/bus/pci/devices/0000:01:00.0/zlge6x5c-switch/switch 2 Chapter 2: Toggle switch

6 Charter 3: 12-bit ADC 3.1 Function The ADC can convert the analogue signal to digital signal, if a voltage is inputted to the related pin, the corresponding voltage value would read out by the device, the range of voltage is 0~3.3 V. 3.2 How to use User can get the A/D conversion value by reading the following file: /sys/bus/pci/devices/0000:01:00.0/zlge6x5c-adc12bit/value This value is not the voltage value. In order to get the actual voltage value, user should use the following equation: volt = value * 3.3 / 4095 With in the equation, the value is the AD conversion value obtained from the file. Notes: The accuracy of the data depends on the hardware specification. 3 Chapter 3: 12-bit ADC

7 Charter 4: 8-bit ADC 4.1 Function The ADC can convert the analogue signal to digital signal, if a voltage is inputted to the related pin, the corresponding voltage value would read out by the device, the range of voltage is 0~3.3 V. 4.2 How to use User can get the A/D conversion value by reading the following file: /sys/bus/pci/devices/0000:01:00.0/zlge6x5c-adc8bit/value This value is not the voltage value. In order to get the actual voltage value, user should use the following equation: volt = value * 3.3 / 255 With in the equation, the value is the AD conversion value obtained from the file. Notes: The accuracy of the data depends on the hardware specification. 4 Chapter 4: 8-bit ADC

8 Charter 5: 10-bit DAC 5.1 Function The DAC can convert the digital signal into analog signal. After calculation using a conversion equation, user can write the result value to the register of the DAC to let it output a required voltage. But the range of this voltage must be [-1, +1]V. 5.2 How to use User can write value to the following file to access the register: /sys/bus/pci/devices/0000:01:00.0/zlge6x5c-dac10bit/value The equation for voltage value conversion: value = ((volt * 1024) ) / 2 after calculation, user should round in the result to get an integer value. The volt within the equation is the required output voltage, and its range should be between -1V and 1 V. Notes: The accuracy of the data depends on the hardware specification. 5 Chapter 5: 10-bit DAC

9 Charter 6: Buttons 6.1 Function The key value corresponding to each button is listed below: SW4 KEY_LEFT SW6 KEY_UP SW3 KEY_DOWN SW5 KEY_RIGHT Long press is supported. 6.2 How to use Since the return values of the buttons are configured to be the same with the arrow keys on a common computer keyboard, so if user presses a button, the same response to a corresponding arrow key would appear on the graphical user interface. User application can also get this key value by reading event device node. The name of event device node is generated dynamically. Following is the source codes for basic button operations. #include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <linux/input.h> int main(int argc, char *argv[]) { char *dev; int fd, ret; struct input_event event; if (argc > 1) dev = argv[1]; else dev = "/dev/input/by-path/pci-0000:01:00.0-platform-zlge6x5c-button-event"; fd = open(dev, O_RDWR); if (fd < 0) { perror("open failed"); return -1; /* open the device node*/ 6 Chapter 6: Buttons

10 } } while (1) { ret = read(fd, &event, sizeof(event)); if (ret < 0) { perror("read failed"); close(fd); return -1; } switch (event.type) { case EV_SYN: printf("[%d.%d] Report Sync \n", event.time.tv_sec, event.time.tv_usec); break; case EV_MSC: printf("[%d.%d] type %d (Misc), code %d (ScanCode), value %d\n", event.time.tv_sec, event.time.tv_usec, event.type, event.code, event.value); case EV_KEY: printf("[%d.%d] type = %d, code = %d, value = %d\n", event.time.tv_sec, event.time.tv_usec, event.type, event.code, event.value); } } return 0; To check the name of a device node: $ cd /dev/input/by-path $ ls l pci-0000:01:00.0-platform-zlge6x5c-button-event Then the name of device node for buttons will be listed out. 7 Chapter 6: Buttons

USB -Keyboard Guide by DeadPool2 Last update: August 2, 2018

USB -Keyboard Guide by DeadPool2 Last update: August 2, 2018 USB -Keyboard Guide by DeadPool2 Last update: August 2, 2018 This document guides the user through: 1: Figuring out how to detect the USB-Keyboard event. 2. Translate USB-Keyboard raw input (keycode) to

More information

Pipes. Pipes Implement a FIFO. Pipes (cont d) SWE 545. Pipes. A FIFO (First In, First Out) buffer is like a. Pipes are uni-directional

Pipes. Pipes Implement a FIFO. Pipes (cont d) SWE 545. Pipes. A FIFO (First In, First Out) buffer is like a. Pipes are uni-directional Pipes SWE 545 Pipes Pipes are a way to allow processes to communicate with each other Pipes implement one form of IPC (Interprocess Communication) This allows synchronization of process execution There

More information

CSE 333 SECTION 3. POSIX I/O Functions

CSE 333 SECTION 3. POSIX I/O Functions CSE 333 SECTION 3 POSIX I/O Functions Administrivia Questions (?) HW1 Due Tonight Exercise 7 due Monday (out later today) POSIX Portable Operating System Interface Family of standards specified by the

More information

CS Operating Systems Lab 3: UNIX Processes

CS Operating Systems Lab 3: UNIX Processes CS 346 - Operating Systems Lab 3: UNIX Processes Due: February 15 Purpose: In this lab you will become familiar with UNIX processes. In particular you will examine processes with the ps command and terminate

More information

UNIX System Calls. Sys Calls versus Library Func

UNIX System Calls. Sys Calls versus Library Func UNIX System Calls Entry points to the kernel Provide services to the processes One feature that cannot be changed Definitions are in C For most system calls a function with the same name exists in the

More information

TIP570-SW-95 QNX-Neutrino Device Driver TIP570 16/8 Channel 12 Bit ADC and 8 Channel 12 Bit DAC on SBS PCI40 Carrier

TIP570-SW-95 QNX-Neutrino Device Driver TIP570 16/8 Channel 12 Bit ADC and 8 Channel 12 Bit DAC on SBS PCI40 Carrier TIP570-SW-95 QNX-Neutrino Device Driver TIP570 16/8 Channel 12 Bit ADC and 8 Channel 12 Bit DAC on SBS PCI40 Carrier Version 1.0.x Reference Manual Issue 1.0 January 2002 TEWS TECHNOLOGIES GmbH Am Bahnhof

More information

A: We see the ps auxw execute and print on screen. The program holds the command in buffer then it is printed on screen.

A: We see the ps auxw execute and print on screen. The program holds the command in buffer then it is printed on screen. Brian Duenas CSE 460 Lab 4 20 points Total 2. Process Pipes Q: What do you see when you execute "pipe1"? Why? We see the ps auxw execute and print on screen. The program holds the command in buffer then

More information

CSE 333 SECTION 3. POSIX I/O Functions

CSE 333 SECTION 3. POSIX I/O Functions CSE 333 SECTION 3 POSIX I/O Functions Administrivia Questions (?) HW1 Due Tonight HW2 Due Thursday, July 19 th Midterm on Monday, July 23 th 10:50-11:50 in TBD (And regular exercises in between) POSIX

More information

everything is a file main.c a.out /dev/sda1 /dev/tty2 /proc/cpuinfo file descriptor int

everything is a file main.c a.out /dev/sda1 /dev/tty2 /proc/cpuinfo file descriptor int everything is a file main.c a.out /dev/sda1 /dev/tty2 /proc/cpuinfo file descriptor int #include #include #include int open(const char *path, int flags); flagso_rdonly

More information

Lecture 23: System-Level I/O

Lecture 23: System-Level I/O CSCI-UA.0201-001/2 Computer Systems Organization Lecture 23: System-Level I/O Mohamed Zahran (aka Z) mzahran@cs.nyu.edu http://www.mzahran.com Some slides adapted (and slightly modified) from: Clark Barrett

More information

SSE3052: Embedded Systems Practice

SSE3052: Embedded Systems Practice SSE3052: Embedded Systems Practice Minwoo Ahn minwoo.ahn@csl.skku.edu Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu SSE3052: Embedded Systems Practice, Spring 2018, Jinkyu Jeong

More information

Universidad Carlos III de Madrid Computer Science and Engineering Department Operating Systems Course

Universidad Carlos III de Madrid Computer Science and Engineering Department Operating Systems Course Exercise 1 (20 points). Autotest. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 C D B A C B C B B C D C D D D Exercise 2 (30 points) Write a C program that creates the following processes: Parent Child1 ------>

More information

EAN-GPIO and I 2 C. PN: EAN-GPIO-and-I 2 C 2/28/2018. SightLine Applications, Inc.

EAN-GPIO and I 2 C. PN: EAN-GPIO-and-I 2 C 2/28/2018. SightLine Applications, Inc. EAN-GPIO and I 2 C PN: EAN-GPIO-and-I 2 C 2/28/2018 SightLine Applications, Inc. Contact: Web: sightlineapplications.com Sales: sales@sightlineapplications.com Support: support@sightlineapplications.com

More information

Introduction to Supercomputing

Introduction to Supercomputing Introduction to Supercomputing TMA4280 Introduction to UNIX environment and tools 0.1 Getting started with the environment and the bash shell interpreter Desktop computers are usually operated from a graphical

More information

COMP 2355 Introduction to Systems Programming

COMP 2355 Introduction to Systems Programming COMP 2355 Introduction to Systems Programming Christian Grothoff christian@grothoff.org http://grothoff.org/christian/ 1 Functions Similar to (static) methods in Java without the class: int f(int a, int

More information

Important Dates. October 27 th Homework 2 Due. October 29 th Midterm

Important Dates. October 27 th Homework 2 Due. October 29 th Midterm CSE333 SECTION 5 Important Dates October 27 th Homework 2 Due October 29 th Midterm String API vs. Byte API Recall: Strings are character arrays terminated by \0 The String API (functions that start with

More information

CSC 271 Software I: Utilities and Internals

CSC 271 Software I: Utilities and Internals CSC 271 Software I: Utilities and Internals Lecture 13 : An Introduction to File I/O in Linux File Descriptors All system calls for I/O operations refer to open files using a file descriptor (a nonnegative

More information

CSC209H Lecture 6. Dan Zingaro. February 11, 2015

CSC209H Lecture 6. Dan Zingaro. February 11, 2015 CSC209H Lecture 6 Dan Zingaro February 11, 2015 Zombie Children (Kerrisk 26.2) As with every other process, a child process terminates with an exit status This exit status is often of interest to the parent

More information

Why files? 1. Storing a large amount of data 2. Long-term data retention 3. Access to the various processes in parallel

Why files? 1. Storing a large amount of data 2. Long-term data retention 3. Access to the various processes in parallel 1 File System Why files? 1. Storing a large amount of data 2. Long-term data retention 3. Access to the various processes in parallel 2 Basic Terms File Structures Field basic unit of data. Contains single

More information

Programming the DMCC in C

Programming the DMCC in C Programming the DMCC in C Task This tutorial will teach you how to write your first program on a dual motor control cape (DMCC) through the BeagleBone microcontroller. The DMCC is a stackable board that

More information

File I/O. Dong-kun Shin Embedded Software Laboratory Sungkyunkwan University Embedded Software Lab.

File I/O. Dong-kun Shin Embedded Software Laboratory Sungkyunkwan University  Embedded Software Lab. 1 File I/O Dong-kun Shin Embedded Software Laboratory Sungkyunkwan University http://nyx.skku.ac.kr Unix files 2 A Unix file is a sequence of m bytes: B 0, B 1,..., B k,..., B m-1 All I/O devices are represented

More information

Software Development With Emacs: The Edit-Compile-Debug Cycle

Software Development With Emacs: The Edit-Compile-Debug Cycle Software Development With Emacs: The Edit-Compile-Debug Cycle Luis Fernandes Department of Electrical and Computer Engineering Ryerson Polytechnic University August 8, 2017 The Emacs editor permits the

More information

Grove Analog Moisture Sensor on BeagleBone Guide

Grove Analog Moisture Sensor on BeagleBone Guide Grove Analog Moisture Sensor on BeagleBone Guide By Group Name Introduction A Grove moisture sensor is used to determine the amount of moisture present around the sensor. It is most commonly used to measure

More information

File and Directories. Advanced Programming in the UNIX Environment

File and Directories. Advanced Programming in the UNIX Environment File and Directories Advanced Programming in the UNIX Environment stat Function #include int stat(const char *restrict pathname, struct stat *restrict buf ); int fstat(int fd, struct stat

More information

JetBox 95xx/ 93xx Linux Auto Run Function

JetBox 95xx/ 93xx Linux Auto Run Function JetBox 95xx/ 93xx Linux Auto Run Function User Manual www.korenix.com 0.0.9 Copyright Notice Copyright 2009 Korenix Technology Co., Ltd. All rights reserved. Reproduction without permission is prohibited.

More information

Chapter 7 File Operations

Chapter 7 File Operations 7.1. File Operation Levels Chapter 7 File Operations File operations consist of five levels, from low to high, as shown in the following hierarchy. (1). Hardware Level: File operations at hardware level

More information

System Programming. Pipes I

System Programming. Pipes I Content : by Dr. B. Boufama School of Computer Science University of Windsor Instructor: Dr. A. Habed adlane@cs.uwindsor.ca http://cs.uwindsor.ca/ adlane/60-256 Content Content 1 Review Signals and files

More information

Matt Ramsay CS 375 EXAM 2 Part 1

Matt Ramsay CS 375 EXAM 2 Part 1 Matt Ramsay CS 375 EXAM 2 Part 1 Output: csserver:/home/mr56/cs375/exam2 > parent 1 75000 Multiples of 3 between 3 and 15000 add to 37507500 This total written to /home/mr56/tmp/file8771.out Multiples

More information

518 Lecture Notes Week 3

518 Lecture Notes Week 3 518 Lecture Notes Week 3 (Sept. 15, 2014) 1/8 518 Lecture Notes Week 3 1 Topics Process management Process creation with fork() Overlaying an existing process with exec Notes on Lab 3 2 Process management

More information

Recitation 8: Tshlab + VM

Recitation 8: Tshlab + VM Recitation 8: Tshlab + VM Instructor: TAs 1 Outline Labs Signals IO Virtual Memory 2 TshLab and MallocLab TshLab due Tuesday MallocLab is released immediately after Start early Do the checkpoint first,

More information

System Calls and I/O Appendix. Copyright : University of Illinois CS 241 Staff 1

System Calls and I/O Appendix. Copyright : University of Illinois CS 241 Staff 1 System Calls and I/O Appendix Copyright : University of Illinois CS 241 Staff 1 More System Calls Directory and File System Management s = mkdir(name, mode) Create a new directory s = rmdir(name) s = link(name,

More information

All the scoring jobs will be done by script

All the scoring jobs will be done by script File I/O Prof. Jin-Soo Kim( jinsookim@skku.edu) TA Sanghoon Han(sanghoon.han@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Announcement (1) All the scoring jobs

More information

Friday, February 10, Lab Notes

Friday, February 10, Lab Notes Friday, February 10, 2017 Lab Notes Topics for today Structures in C Redirection of input and output in a Unix-like environment Command line arguments More pre-processor options Programs: Finish Program

More information

UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 4500/8506 Operating Systems Fall Programming Assignment 1 (updated 9/16/2017)

UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 4500/8506 Operating Systems Fall Programming Assignment 1 (updated 9/16/2017) UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 4500/8506 Operating Systems Fall 2017 Programming Assignment 1 (updated 9/16/2017) Introduction The purpose of this programming assignment is to give you

More information

Pointers and scanf() Steven R. Bagley

Pointers and scanf() Steven R. Bagley Pointers and scanf() Steven R. Bagley Recap Programs are a series of statements Defined in functions Can call functions to alter program flow if statement can determine whether code gets run Loops can

More information

The CCB gpio-104 device-driver

The CCB gpio-104 device-driver The CCB gpio-104 device-driver [Document number: A48001N007, revision 1] Martin Shepherd California Institute of Technology December 29, 2005 This page intentionally left blank. Abstract The gpio-104 board

More information

Friday, September 16, Lab Notes. Command line arguments More pre-processor options Programs: Finish Program 1, begin Program 2 due next week

Friday, September 16, Lab Notes. Command line arguments More pre-processor options Programs: Finish Program 1, begin Program 2 due next week Friday, September 16, 2016 Lab Notes Topics for today Redirection of input and output Command line arguments More pre-processor options Programs: Finish Program 1, begin Program 2 due next week 1. Redirection

More information

Computer Science & Engineering Department I. I. T. Kharagpur

Computer Science & Engineering Department I. I. T. Kharagpur Computer Science & Engineering Department I. I. T. Kharagpur Operating System: CS33007 3rd Year CSE: 5th Semester (Autumn 2006-2007) Lecture III (Linux System Calls II) Goutam Biswas Date: 1st-7th August,

More information

OPTO32A 24 Input Bit, 8 Output Bit Optical Isolator Board

OPTO32A 24 Input Bit, 8 Output Bit Optical Isolator Board OPTO32A 24 Input Bit, 8 Output Bit Optical Isolator Board PMC-OPTO32A Linux Device Driver User Manual Manual Revision: July 15, 2005 General Standards Corporation 8302A Whitesburg Drive Huntsville, AL

More information

Inter-Process Communication. Disclaimer: some slides are adopted from the book authors slides with permission 1

Inter-Process Communication. Disclaimer: some slides are adopted from the book authors slides with permission 1 Inter-Process Communication Disclaimer: some slides are adopted from the book authors slides with permission 1 Today Inter-Process Communication (IPC) What is it? What IPC mechanisms are available? 2 Inter-Process

More information

PCI-AIO01. User s Manual

PCI-AIO01. User s Manual PCI-AIO01 User s Manual Windows, Windows2000, Windows NT and Windows XP are trademarks of Microsoft. We acknowledge that the trademarks or service names of all other organizations mentioned in this document

More information

York University Faculty Science and Engineering Fall 2008

York University Faculty Science and Engineering Fall 2008 York University Faculty Science and Engineering Fall 2008 CSE2031 Final Software Tools Friday, Feb..26 th, 2008 Last Name 08:30 10:30am First name ID Instructions to students: Answer all questions. Marks

More information

Experiment 6 The Real World Interface

Experiment 6 The Real World Interface Experiment 6 The Real World Interface Instructions You are required to design, code, test and document the C program from the experiment listed below. You should prepare the pseudocode for the program

More information

All the scoring jobs will be done by script

All the scoring jobs will be done by script File I/O Prof. Jinkyu Jeong( jinkyu@skku.edu) TA-Seokha Shin(seokha.shin@csl.skku.edu) TA-Jinhong Kim( jinhong.kim@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu

More information

UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 4500/8506 Operating Systems Summer 2016 Programming Assignment 1 Introduction The purpose of this

UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 4500/8506 Operating Systems Summer 2016 Programming Assignment 1 Introduction The purpose of this UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 4500/8506 Operating Systems Summer 2016 Programming Assignment 1 Introduction The purpose of this programming assignment is to give you some experience

More information

Internet of Things: Using MRAA to Abstract Platform I/O Capabilities

Internet of Things: Using MRAA to Abstract Platform I/O Capabilities Internet of Things: Using MRAA to Abstract Platform I/O Capabilities Integrated Computer Solutions, Inc. Contents 1. Abstract... 3 2. MRAA Overview... 3 2.1. Obtaining MRAA APIs and API Documentation...

More information

DSP-Series 20MHz DSP Configuration

DSP-Series 20MHz DSP Configuration 33 South La Patera Lane Santa Barbara, CA 93117 ph (805) 681-3300 fax (805) 681-3311 technical@motioneng.com Release Note DSP-Series 20MHz DSP Configuration Option H001-00?? Firmware Version 2.4F4 Software

More information

F28HS2 Hardware-Software Interface. Lecture 3 - Programming in C 3

F28HS2 Hardware-Software Interface. Lecture 3 - Programming in C 3 F28HS2 Hardware-Software Interface Lecture 3 - Programming in C 3 Low level programming in C want to control hardware devices devices mapped into memory accessed at specific memory addresses set memory

More information

Contents. IPC (Inter-Process Communication) Representation of open files in kernel I/O redirection Anonymous Pipe Named Pipe (FIFO)

Contents. IPC (Inter-Process Communication) Representation of open files in kernel I/O redirection Anonymous Pipe Named Pipe (FIFO) Pipes and FIFOs Prof. Jin-Soo Kim( jinsookim@skku.edu) TA JinHong Kim( jinhong.kim@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Contents IPC (Inter-Process Communication)

More information

CS C Primer. Tyler Szepesi. January 16, 2013

CS C Primer. Tyler Szepesi. January 16, 2013 January 16, 2013 Topics 1 Why C? 2 Data Types 3 Memory 4 Files 5 Endianness 6 Resources Why C? C is exteremely flexible and gives control to the programmer Allows users to break rigid rules, which are

More information

EL2310 Scientific Programming LAB2: C lab session. Patric Jensfelt, Andrzej Pronobis

EL2310 Scientific Programming LAB2: C lab session. Patric Jensfelt, Andrzej Pronobis EL2310 Scientific Programming LAB2: C lab session Patric Jensfelt, Andrzej Pronobis Chapter 1 Introduction 1.1 Reporting errors As any document, this document is likely to include errors and typos. Please

More information

Operating systems for embedded systems. Embedded Operating Systems

Operating systems for embedded systems. Embedded Operating Systems Operating systems for embedded systems Embedded operating systems How do they differ from desktop operating systems? Programming model Process-based Event-based How is concurrency handled? How are resource

More information

Anne Bracy CS 3410 Computer Science Cornell University

Anne Bracy CS 3410 Computer Science Cornell University Anne Bracy CS 3410 Computer Science Cornell University The slides are the product of many rounds of teaching CS 3410 by Professors Weatherspoon, Bala, Bracy, McKee, and Sirer. How does a processor interact

More information

MMAP AND PIPE. UNIX Programming 2015 Fall by Euiseong Seo

MMAP AND PIPE. UNIX Programming 2015 Fall by Euiseong Seo MMAP AND PIPE UNIX Programming 2015 Fall by Euiseong Seo Memory Mapping mmap(2) system call allows mapping of a file into process address space Instead of using read() and write(), just write to memory

More information

User Guide Guangzhou Zhiyuan Electronics Stock Co., LTD

User Guide Guangzhou Zhiyuan Electronics Stock Co., LTD Platform EPCM-505C User Guide Guangzhou Zhiyuan Electronics Stock Co., LTD Safety information Electrical safety To prevent electrical shock hazard, disconnect the power cable from the electrical outlet

More information

Computer Systems Assignment 2: Fork and Threads Package

Computer Systems Assignment 2: Fork and Threads Package Autumn Term 2018 Distributed Computing Computer Systems Assignment 2: Fork and Threads Package Assigned on: October 5, 2018 Due by: October 12, 2018 1 Understanding fork() and exec() Creating new processes

More information

unsigned char memory[] STACK ¼ 0x xC of address space globals function KERNEL code local variables

unsigned char memory[] STACK ¼ 0x xC of address space globals function KERNEL code local variables Graded assignment 0 will be handed out in section Assignment 1 Not that bad Check your work (run it through the compiler) Factorial Program Prints out ENTERING, LEAVING, and other pointers unsigned char

More information

PRINCIPLES OF OPERATING SYSTEMS

PRINCIPLES OF OPERATING SYSTEMS PRINCIPLES OF OPERATING SYSTEMS Tutorial-1&2: C Review CPSC 457, Spring 2015 May 20-21, 2015 Department of Computer Science, University of Calgary Connecting to your VM Open a terminal (in your linux machine)

More information

UNIX I/O. Computer Systems: A Programmer's Perspective, Randal E. Bryant and David R. O'Hallaron Prentice Hall, 3 rd edition, 2016, Chapter 10

UNIX I/O. Computer Systems: A Programmer's Perspective, Randal E. Bryant and David R. O'Hallaron Prentice Hall, 3 rd edition, 2016, Chapter 10 Reference: Advanced Programming in the UNIX Environment, Third Edition, W. Richard Stevens and Stephen A. Rago, Addison-Wesley Professional Computing Series, 2013. Chapter 3 Computer Systems: A Programmer's

More information

BOOLEAN EXPRESSIONS CONTROL FLOW (IF-ELSE) INPUT/OUTPUT. Problem Solving with Computers-I

BOOLEAN EXPRESSIONS CONTROL FLOW (IF-ELSE) INPUT/OUTPUT. Problem Solving with Computers-I BOOLEAN EXPRESSIONS CONTROL FLOW (IF-ELSE) INPUT/OUTPUT Problem Solving with Computers-I Announcements HW02: Complete (individually)using dark pencil or pen, turn in during lab section next Wednesday Please

More information

Beyond this course. Machine code. Readings: CP:AMA 2.1, 15.4

Beyond this course. Machine code. Readings: CP:AMA 2.1, 15.4 Beyond this course Readings: CP:AMA 2.1, 15.4 CS 136 Spring 2018 13: Beyond 1 Machine code In Section 04 we briefly discussed compiling: converting source code into machine code so it can be run or executed.

More information

Soliton SCTS Extender

Soliton SCTS Extender Soliton SCTS Extender Rev 1.0 May 20, 2008 Rev. No. Description Date Approved 0.1 Initial May/20/2008 Vincent 1.0 First Relase Jun/13/2008 Vincent 1 1. Installation...3 2. Function Description...3 sctsctl_t

More information

Lab 5: Inter-Process Communication

Lab 5: Inter-Process Communication 1. Objective Lab 5: Inter-Process Communication Study the inter-process communication 2. Syllabus Understanding the concepts and principle of inter-process communication Implementing the inter-process

More information

Unix Basics Compiling and Using. CMPT 300 Operating Systems I Summer Segment 2: Unix Basics. Melissa O Neill

Unix Basics Compiling and Using. CMPT 300 Operating Systems I Summer Segment 2: Unix Basics. Melissa O Neill CMPT 300 Operating Systems I Summer 1999 Segment 2: Unix Basics Melissa O Neill Unix Basics Compiling and Using You had to learn how to do the basics on a Unix system, including: Look up a manual page

More information

Operating systems for embedded systems

Operating systems for embedded systems Operating systems for embedded systems Embedded operating systems How do they differ from desktop operating systems? Programming model Process-based Event-based How is concurrency handled? How are resource

More information

Owner s Manual for the. ClockMaster. Models: CM2-100-PCI

Owner s Manual for the. ClockMaster. Models: CM2-100-PCI Owner s Manual for the ClockMaster Models: CM2-100-PCI SpinCore Technologies, Inc. 3525 NW 67 th Avenue Gainesville, Florida 32653, USA Phone: (352)-271-7383 http:// Congratulations and THANK YOU for choosing

More information

Project 2: Shell with History1

Project 2: Shell with History1 Project 2: Shell with History1 See course webpage for due date. Submit deliverables to CourSys: https://courses.cs.sfu.ca/ Late penalty is 10% per calendar day (each 0 to 24 hour period past due). Maximum

More information

CS240: Programming in C

CS240: Programming in C CS240: Programming in C Lecture 15: Unix interface: low-level interface Cristina Nita-Rotaru Lecture 15/Fall 2013 1 Streams Recap Higher-level interface, layered on top of the primitive file descriptor

More information

System Programming. Introduction to Unix

System Programming. Introduction to Unix Content : by Dr. B. Boufama School of Computer Science University of Windsor Instructor: Dr. A. Habed adlane@cs.uwindsor.ca http://cs.uwindsor.ca/ adlane/60-256 Content Content 1 Introduction 2 3 Introduction

More information

Preview. Process Control. What is process? Process identifier The fork() System Call File Sharing Race Condition. COSC350 System Software, Fall

Preview. Process Control. What is process? Process identifier The fork() System Call File Sharing Race Condition. COSC350 System Software, Fall Preview Process Control What is process? Process identifier The fork() System Call File Sharing Race Condition COSC350 System Software, Fall 2015 1 Von Neumann Computer Architecture: An integrated set

More information

CS 33. Shells and Files. CS33 Intro to Computer Systems XX 1 Copyright 2017 Thomas W. Doeppner. All rights reserved.

CS 33. Shells and Files. CS33 Intro to Computer Systems XX 1 Copyright 2017 Thomas W. Doeppner. All rights reserved. CS 33 Shells and Files CS33 Intro to Computer Systems XX 1 Copyright 2017 Thomas W. Doeppner. All rights reserved. Shells Command and scripting languages for Unix First shell: Thompson shell sh, developed

More information

PCI-AIO02. User s Manual

PCI-AIO02. User s Manual PCI-AIO02 User s Manual Windows, Windows2000, Windows NT and Windows XP are trademarks of Microsoft. We acknowledge that the trademarks or service names of all other organizations mentioned in this document

More information

File Descriptors and Piping

File Descriptors and Piping File Descriptors and Piping CSC209: Software Tools and Systems Programming Furkan Alaca & Paul Vrbik University of Toronto Mississauga https://mcs.utm.utoronto.ca/~209/ Week 8 Today s topics File Descriptors

More information

TPMC860-SW-82. Linux Device Driver. 4 Channel Isolated Serial Interface RS232 Version 1.4.x. User Manual. Issue 1.4.

TPMC860-SW-82. Linux Device Driver. 4 Channel Isolated Serial Interface RS232 Version 1.4.x. User Manual. Issue 1.4. The Embedded I/O Company TPMC860-SW-82 Linux Device Driver 4 Channel Isolated Serial Interface RS232 Version 1.4.x User Manual Issue 1.4.4 December 2011 TEWS TECHNOLOGIES GmbH Am Bahnhof 7 25469 Halstenbek,

More information

CS 3013 Operating Systems WPI, A Term Assigned: Friday, August 31, 2007 Due: Monday, September 17, 2007

CS 3013 Operating Systems WPI, A Term Assigned: Friday, August 31, 2007 Due: Monday, September 17, 2007 CS 3013 Operating Systems WPI, A Term 2007 Craig E. Wills Project 2 (30 pts) Assigned: Friday, August 31, 2007 Due: Monday, September 17, 2007 Introduction This assignment is intended to help you learn

More information

Chapter 10. The UNIX System Interface

Chapter 10. The UNIX System Interface 프로그래밍 1 1 Chapter 10. The UNIX System Interface June, 2016 Dept. of software Dankook University http://embedded.dankook.ac.kr/~baeksj 파일의개념 (1/5) 2 파일의정의 사용자가이용할수있는데이터의실체레코드들의집합이라고정의 파일의필요성 데이터의효율적인저장및검색을위해파일단위구분

More information

arm light distance . The ADC is noisy, so its output randomly varies by ±1.

arm light distance . The ADC is noisy, so its output randomly varies by ±1. EE 4770 Homework 3 Solution Due: 8 March 1999 Problem 1: The distance from a light source of unknown but steady brightness is to be determined using a photodetector mounted on one end of a 250 mm rotating

More information

CONTROL THE GPIO PINS ON THE DELL EMBEDDED BOX PC 5000 IN UBUNTU LINUX

CONTROL THE GPIO PINS ON THE DELL EMBEDDED BOX PC 5000 IN UBUNTU LINUX CONTROL THE GPIO PINS ON THE DELL EMBEDDED BOX PC 5000 IN UBUNTU LINUX ABSTRACT The Dell Embedded Box PC 5000 provides General Purpose I/O (GPIO) pins for customization. Due to the unavailability of the

More information

CanBarry PI V 1.0 INDUSTRIAL BERRY.

CanBarry PI V 1.0 INDUSTRIAL BERRY. CanBarry PI V 1.0 INDUSTRIAL BERRY www.industrialberry.com August 2013 Contents 1 License 1 2 Introduction 3 3 Hardware implementation 5 4 Software implementation 9 4.1 Real Time Clock..........................

More information

Operating systems. Lecture 9

Operating systems. Lecture 9 Operating systems. Lecture 9 Michał Goliński 2018-11-27 Introduction Recall Reading and writing wiles in the C/C++ standard libraries System calls managing processes (fork, exec etc.) Plan for today fork

More information

COL100 Lab 2. I semester Week 2, Open the web-browser and visit the page and visit the COL100 course page.

COL100 Lab 2. I semester Week 2, Open the web-browser and visit the page   and visit the COL100 course page. COL100 Lab 2 I semester 2017-18 Week 2, 2017 Objective More familiarisation with Linux and its standard commands Part 1 1. Login to your system and open a terminal window. 2. Open the web-browser and visit

More information

This is a tutorial about sensing the environment using a Raspberry Pi. measure a digital input (from a button) output a digital signal (to an LED)

This is a tutorial about sensing the environment using a Raspberry Pi. measure a digital input (from a button) output a digital signal (to an LED) Practical 2 - Overview This is a tutorial about sensing the environment using a Raspberry Pi and a GrovePi+. You will learn: digital input and output measure a digital input (from a button) output a digital

More information

CpSc 1010, Fall 2014 Lab 10: Command-Line Parameters (Week of 10/27/2014)

CpSc 1010, Fall 2014 Lab 10: Command-Line Parameters (Week of 10/27/2014) CpSc 1010, Fall 2014 Lab 10: Command-Line Parameters (Week of 10/27/2014) Goals Demonstrate proficiency in the use of the switch construct and in processing parameter data passed to a program via the command

More information

15-213/18-243, Spring 2011 Exam 2

15-213/18-243, Spring 2011 Exam 2 Andrew login ID: Full Name: Section: 15-213/18-243, Spring 2011 Exam 2 Thursday, April 21, 2011 v2 Instructions: Make sure that your exam is not missing any sheets, then write your Andrew login ID, full

More information

C programming for beginners

C programming for beginners C programming for beginners Lesson 2 December 10, 2008 (Medical Physics Group, UNED) C basics Lesson 2 1 / 11 Main task What are the values of c that hold bounded? x n+1 = x n2 + c (x ; c C) (Medical Physics

More information

Contents. Programming Assignment 0 review & NOTICE. File IO & File IO exercise. What will be next project?

Contents. Programming Assignment 0 review & NOTICE. File IO & File IO exercise. What will be next project? File I/O Prof. Jin-Soo Kim(jinsookim@skku.edu) TA - Dong-Yun Lee(dylee@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Contents Programming Assignment 0 review & NOTICE

More information

Worksheet 4 Basic Input functions and Mathematical Operators

Worksheet 4 Basic Input functions and Mathematical Operators Name: Student ID: Date: Worksheet 4 Basic Input functions and Mathematical Operators Objectives After completing this worksheet, you should be able to Use an input function in C Declare variables with

More information

Lecture 3. Introduction to Unix Systems Programming: Unix File I/O System Calls

Lecture 3. Introduction to Unix Systems Programming: Unix File I/O System Calls Lecture 3 Introduction to Unix Systems Programming: Unix File I/O System Calls 1 Unix File I/O 2 Unix System Calls System calls are low level functions the operating system makes available to applications

More information

Introduction to Linux

Introduction to Linux Introduction to Linux Prof. Jin-Soo Kim( jinsookim@skku.edu) TA Sanghoon Han(sanghoon.han@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Announcement (1) Please come

More information

PetaLinux SDK User Guide. Application Development Guide

PetaLinux SDK User Guide. Application Development Guide PetaLinux SDK User Guide Notice of Disclaimer The information disclosed to you hereunder (the "Materials") is provided solely for the selection and use of Xilinx products. To the maximum extent permitted

More information

CARRIER-SW-82. Linux Device Driver. IPAC Carrier Version 2.2.x. User Manual. Issue November 2017

CARRIER-SW-82. Linux Device Driver. IPAC Carrier Version 2.2.x. User Manual. Issue November 2017 The Embedded I/O Company CARRIER-SW-82 Linux Device Driver IPAC Carrier Version 2.2.x User Manual Issue 2.2.0 November 2017 TEWS TECHNOLOGIES GmbH Am Bahnhof 7 25469 Halstenbek, Germany Phone: +49 (0)

More information

Roadmap. CPU management. Memory management. Disk management. Other topics. Process, thread, synchronization, scheduling. Virtual memory, demand paging

Roadmap. CPU management. Memory management. Disk management. Other topics. Process, thread, synchronization, scheduling. Virtual memory, demand paging CPU management Roadmap Process, thread, synchronization, scheduling Memory management Virtual memory, demand paging Disk management I/O Filesystem Other topics 1 I/O Heechul Yun Disclaimer: some slides

More information

Shared Memory Memory mapped files

Shared Memory Memory mapped files Shared Memory Memory mapped files 1 Shared Memory Introduction Creating a Shared Memory Segment Shared Memory Control Shared Memory Operations Using a File as Shared Memory 2 Introduction Shared memory

More information

C-String Library Functions

C-String Library Functions Strings Class 34 C-String Library Functions there are several useful functions in the cstring library strlen: the number of characters before the \0 strncat: concatenate two strings together strncpy: overwrite

More information

#include <stdio.h> int main() { char s[] = Hsjodi, *p; for (p = s + 5; p >= s; p--) --*p; puts(s); return 0;

#include <stdio.h> int main() { char s[] = Hsjodi, *p; for (p = s + 5; p >= s; p--) --*p; puts(s); return 0; 1. Short answer questions: (a) Compare the typical contents of a module s header file to the contents of a module s implementation file. Which of these files defines the interface between a module and

More information

Procedures, Parameters, Values and Variables. Steven R. Bagley

Procedures, Parameters, Values and Variables. Steven R. Bagley Procedures, Parameters, Values and Variables Steven R. Bagley Recap A Program is a sequence of statements (instructions) Statements executed one-by-one in order Unless it is changed by the programmer e.g.

More information

SU2017. LAB 1 (May 4/9) Introduction to C, Function Declaration vs. Definition, Basic I/O (scanf/printf, getchar/putchar)

SU2017. LAB 1 (May 4/9) Introduction to C, Function Declaration vs. Definition, Basic I/O (scanf/printf, getchar/putchar) SU2017. LAB 1 (May 4/9) Introduction to C, Function Declaration vs. Definition, Basic I/O (scanf/printf, getchar/putchar) 1 Problem A 1.1 Specification Write an ANSI-C program that reads input from the

More information

프로세스간통신 (Interprocess communication) i 숙명여대창병모

프로세스간통신 (Interprocess communication) i 숙명여대창병모 프로세스간통신 (Interprocess communication) i 숙명여대창병모 Contents 1. Pipes 2. FIFOs 숙대창병모 2 파이프 (Pipe) IPC using Pipes IPC using regular files unrelated processes can share fixed size life-time lack of synchronization

More information

From Java to C. Thanks to Randal E. Bryant and David R. O'Hallaron (Carnegie-Mellon University) for providing the basis for these slides

From Java to C. Thanks to Randal E. Bryant and David R. O'Hallaron (Carnegie-Mellon University) for providing the basis for these slides From Java to C Thanks to Randal E. Bryant and David R. O'Hallaron (Carnegie-Mellon University) for providing the basis for these slides 1 Outline Overview comparison of C and Java Good evening Preprocessor

More information

BIL 104E Introduction to Scientific and Engineering Computing. Lecture 14

BIL 104E Introduction to Scientific and Engineering Computing. Lecture 14 BIL 104E Introduction to Scientific and Engineering Computing Lecture 14 Because each C program starts at its main() function, information is usually passed to the main() function via command-line arguments.

More information