DRIVER AND LIBRARY FOR DB67 DSP BOARD DRIVER AND LIBRARY FOR DB67 DSP BOARD

Save this PDF as:
 WORD  PNG  TXT  JPG

Size: px
Start display at page:

Download "DRIVER AND LIBRARY FOR DB67 DSP BOARD DRIVER AND LIBRARY FOR DB67 DSP BOARD"

Transcription

1 DRIVER AND LIBRARY FOR DB67 DSP BOARD

2 G.Petrosyan MVP, DESY (Hamburg, Germany), ErPhi (Erevan, Armenia) K. Rehlich DESY (Hamburg, Germany) P.Vetrov DESY (Hamburg, Germany),

3 DRIVER The basic part of LLRF DSP control system is 6U-VME standard DSP board which contains TMS320C6701 floating-point DSP (Texas Instruments Inc.) and 8 Gigalink channels [1]. For effective usage of this board the driver for OS Solaris 2 was written. Additionally a bootable program was developed which is stored in the flash memory of the DSP board. On start up or reset this program initializes the DSP internal registers and DSP Interrupt Service Table (IST) [2]. After this initialization the program enters an idle loop. Init Internal registers Init IST IDLE xxxxx Since the idle loop instructions are arranged in reserved memory space, which is not used for application programs, we can load an application program in to the DSP memory without disturb this loop. By changing the loop instructions from Host Port Interface (HPI) can force DSP to exit from loop. Before doing it we have to set required branch instruction at xxxxx. For example, if we want to start a new application program we have to set branch instruction to 0x200h address. As default the HPI Interrupt Service Instruction Fetch contains branch to this idle loop and it is possible organise application program s pause sending host interrupt to the DSP. To return to the application program s interrupted point we have to set at xxxxx branch instruction with IRP (Interrupt Return Pointer) argument and exit idle loop. The DSP driver is written as a DDI/DDK Loadable Driver for SYSTEM V (Solaris 2) and DSP board presented as a Character Device. The driver controls the DSP board and allows read/write data from/to DSP board memory including DSP internal memory. IOR, SR, VR, DSP-RESET, HPIC, HPIA, and HPID registers of DSP board are accessible from VME bus [1]. SR and VR registers are used for setting interrupt vector and interrupt level for DSP interrupt to Host. Writing into the DSP-RESET register causes the DSP board reset. HPIC, HPIA, and HPID registers are DSP Host Port Interface s registers which are used for to read/write data from/to DSP board memory including DSP internal memory. The driver has two modes of operation for interrupt handling: 1. Driver pauses itself for 6 ms and after this time continues its work. The delay of 6 ms is defined by processing time of the macro pulse of LLRF system. 2. If there are processes requested to be notified on some events, the driver will sent them system signal. This modes are set by system call ioctl(). Description of this call is presented. A user process can use open(), close(), write(), read() and ioctl() system calls for this driver. For easier programming a programmer can use our C++ library. Petrosyan Gevorg Page 3 07/02/2005

4 [1] VME DSP module with 8 GigaLink interfaces. [2] TMS320c6000 CPU and Instruction Set, ch. 8, Texas Instruments Inc. SPRU189E. Petrosyan Gevorg Page 4 07/02/2005

5 DESCRIPTION OF SYSTEM CALLS AND LIBRARY FUNCTION Petrosyan Gevorg Page 5 07/02/2005

6 SYSTEM CALL OPEN int open(char *path, int flags); Opens link-level device named in the path string, e.g. /dev/db67ff0. The flags argument is a bitmap selecting behaviour of the device. The following fields may be specified: O_RDONLY O_WRONLY O_RDWR Opens the board for read access only. Opens the board for write access only. Opens the board for read and write access. Only one of flags must be specified. Returns: and numand or Upon successful completion, the function opens the file return a non-negative integer representing the lowest bered unused file descriptor. Otherwise, -1 is returned errno is set to indicate the error. No files are created modified if the function returns -1. int fd = open ( /dev/db67ff0, O_RDWR); if( fd < 0) perror( open ); else printf( Device db67ff0 opened OK!\n ); Petrosyan Gevorg Page 6 07/02/2005

7 SYSTEM CALL CLOSE int close(int fd); Closes the link-level device so that no further can be performed on it. This frees the device s file descriptor which may be allocated to another device or file when another call to open() is made. Returns: Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error. if (close(fd) < 0) perror ( close ); else printf ( Device closed OK!\n ); Petrosyan Gevorg Page 7 07/02/2005

8 SYSTEM CALL READ int read(int fd, char *buf, int nbyte); This function used to read nbyte-4 bytes data from DSP bord via DSP HPI into the given buffer decrypted by pointer buf. Start address of data in DSP memory allocated in first 4 bytes of the buffer e.g. returned data will be placed in the buffer starting at fifth byte. Returns: Upon successful completion, read() return a non-negative integer indicating the number of bytes actually read. Otherwise, the functions return -1 and set errno to indicate the error. Examples: Read 4 bytes at address 0x8000F000 int n,data[2]; data[0] = 0x8000F000; if((n = read (fd, &data[0], 8))!= 8) perror( read ); else printf( %d bytes read from DSP OK!\n, n 4 ); Petrosyan Gevorg Page 8 07/02/2005

9 SYSTEM CALL WRITE Returns: Examples: int write(int fd, char *buf, int nbyte); This function used to write nbyte-4 bytes data from the given buffer decrypted by pointer buf into the DSP board via DSP HPI. Start address of data in DSP memory allocated in first 4 bytes of the buffer. Upon successful completion, write() return a non-negative integer indicating the number of bytes actually read. Otherwise, the functions return -1 and set errno to indicate the error. write 4 bytes at address 0x8000F000 int n,data[2]; data[0] = 0x8000F000; data[1] = 12345; if((n = write (fd, &data[0], 8))!= 8) perror( write ); else printf( %d bytes written into DSP OK!\n, n 4 ); Petrosyan Gevorg Page 9 07/02/2005

10 SYSTEM CALL IOCTL int ioctl(int fd, int request, int arg); This command allows the user to perform miscellaneous function in relation to the module driver specified by the file descriptor fd. The function to be performed is determined by the parameter request. The role of the arg parameter is dependent on which function is to be performed. Valid request functions are: DB67D_RESET Reset DSP board. DB67_INT Send interrupt to DSP. DB67_INT_FREE DB67_NO_INT Puts ban to sent interrupt from DSP to Host. DB67D_INFO Get information about DSP board. Information will be placed into t_board_info type structure which is defined in db67cmd.h. t_board_info board_data1; ioctl(brd,db67d_info,&board_data1); printf(" Board info \n address = %x\n interrupt type = %i\n interrupt vector = %x\n interrupt level = %i\n", board_data1.adr, board_data1.int_type, board_data1.int_vector, board_data1.int_number); DB67_LLRF_INT Set interrupt type for LLRF control. When driver received interrupt then it paused 6 us. Petrosyan Gevorg Page 10 07/02/2005

11 DB67_SIG_INT Set interrupt type for send signal to registered process. The command must be look like this: ioctl (brd, DB67_SIG_INT_DEL, &ioctl_data); ioctl_data is db67_ioctl_data type structure. struct db67_ioctl_data { u_short f_irqnr; int f_sigirq; u_int f_status; }; struct db67_ioctl_data ioctl_data; sigset_t mask; struct sigaction hdl; sigemptyset (&mask); sigaddset (&mask, SIGUSR1); sigprocmask (SIG_SETMASK, &mask, NULL); sigemptyset (&hdl.sa_mask); hdl.sa_flags = 0; hdl.sa_handler = signal_handler; sigaction(sigusr1, &hdl, NULL); sigprocmask (SIG_UNBLOCK, &mask, NULL); ioctl_data.f_irqnr = 0; ioctl_data.f_sigirq = SIGUSR1; ioctl_data.f_status = 0; ioctl (brd, DB67_SIG_INT, &ioctl_data); This command saves information into the driver and when driver receives interrupt from DSP sends SIGNAL described in db67_ioctl_data.f_sigirq to the registered process. DB67_SIG_INT_DEL Clear all interrupt (SIGNAL) requests for process sent this command. ioctl (brd, DB67_SIG_INT_DEL, &ioctl_data); Petrosyan Gevorg Page 11 07/02/2005

12 LIBRARY FUNCTION db67open int db67open(int a); This function adds a as char at end the string /dev/db67ff and calls the system call open() whit this argument. a can be 0,1,2,3 and it depend from conf file of driver. This function returns the value which returned from system call open(). Petrosyan Gevorg Page 12 07/02/2005

13 LIBRARY FUNCTION db67close argument. returned. int db67close(int fd) This function calls the system call close() with fd The returned value from system call close() will be Petrosyan Gevorg Page 13 07/02/2005

14 LIBRARY FUNCTION db67_write_data_int int db67_write_data_int(int fd, int data, int adr) This function used to write integer data type to the DSP board memory. fd DSP board s file descriptor returned by db67open(int a) function. data integer data type which will be written in the DSP memory. adr address of DSP memory where data will be written. Upon successful completion, db67_write_data_int returns 0. Otherwise, error number WR_D_INT_ERR defined in db67lib.h will be returned and errno is set to indicate the error from write() system call. #include db67lib.h int data1; int adr1=0x ; if(db67_write_data_int(fd, data1, adr1)!=0)perror( db67_write_data_int ); Petrosyan Gevorg Page 14 07/02/2005

15 LIBRARY FUNCTION db67_read_data_int int db67_read_data_int(int fd, int adr, int *data) This function used to read integer data type from the DSP board memory. fd DSP board s file descriptor returned by db67open(int a) function. data pointer of integer data type where data will be written. adr address of DSP memory from where data will be read. Upon successful completion, db67_read_data_int returns 0. Otherwise, error number RD_D_INT_ERR defined in db67lib.h will be returned and errno is set to indicate the error from read() system call. int data1; int adr1=0x ; if(db67_read_data_int(fd, adr1, &data1)!= 0)perror( db67_read_data_int ); Petrosyan Gevorg Page 15 07/02/2005

16 LIBRARY FUNCTION db67_write_data_float int db67_write_data_float(int fd, float data, int adr) This function used to write float data type to the DSP board memory. fd DSP board s file descriptor returned by db67open(int a) function. data float data type which will be written in the DSP memory. adr address of DSP memory where data will be written. Upon successful completion, db67_write_data_float returns 0. Otherwise, error number WR_D_FLT_ERR defined in db67lib.h will be returned and errno is set to indicate the error from write() system call. float data1; int adr1=0x ; if(db67_write_data_ float(fd, data1, adr1)!=0 )perror( db67_write_data_ float ); Petrosyan Gevorg Page 16 07/02/2005

17 LIBRARY FUNCTION db67_read_data_float int db67_read_data_float(int fd, int adr, float *data) This function used to read float data type from the DSP board memory. fd DSP board s file descriptor returned by db67open(int a) function. data pointer of float data type where data will be written. adr address of memory from where data will be read. Upon successful completion, db67_read_data_float returns 0. Otherwise, error number RD_D_FLT_ERR defined in db67lib.h will be returned and errno is set to indicate the error from read() system call. float data1; int adr1=0x ; if(db67_read_data_float(fd, adr1, &data1)!= 0)perror( db67_read_data_float ); Petrosyan Gevorg Page 17 07/02/2005

18 LIBRARY FUNCTION db67_write_table_int adr) int db67_write_table_int(int fd, int *data, int len, int This function used to write integer type data array to the DSP board memory. fd DSP board s file descriptor returned by db67open(int a) function. data pointer of integer data type array. len number of data which will be written. adr - start address of the DSP memory space where data array will be written. Upon successful completion, db67_write_data_float returns 0. Otherwise, error numbers defined in db67lib.h will be returned and errno is set to indicate the error from write() or calloc() system calls. Returned value from the function WR_T_INT_ERR CALLOC_ERR System call set errno write() Calloc() int x[100]; int adr1 = 0x80000; if(db67_write_table_int(&x, 100,adr1)!= 0) perror( db67_write_table_int ); Petrosyan Gevorg Page 18 07/02/2005

19 LIBRARY FUNCTION db67_write_table_float adr) int db67_write_table_float(int fd, float *data, int len, int This function used to write float type data array to the DSP board memory. fd DSP board s file descriptor returned by db67open(int a) function. data pointer of float type data array. len number of data which will be written. adr - start address of the DSP memory space where data array will be written. Upon successful completion, db67_write_table_float returns 0. Otherwise, error numbers defined in db67lib.h will be returned and errno is set to indicate the error from write() or calloc() system calls. Returned value from the function WR_T_FLT_ERR CALLOC_ERR System call set errno write() Calloc() int x[100]; int adr1 = 0x80000; if(db67_write_table_float(&x, 100,adr1)<0) perror( db67_write_table_float ); Petrosyan Gevorg Page 19 07/02/2005

20 LIBRARY FUNCTION db67_read_table_int adr) int db67_read_table_int(int fd, int *data, int len, int This function used to read integer type data array from the DSP board memory. fd DSP board s file descriptor returned by db67open(int a) function. data pointer of integer type data array. len number of data which will be read. adr - start address of the DSP memory space from where data array will be read. Upon successful completion, db67_read_table_int returns 0. Otherwise, error number RD_T_INT_ERR defined in db67lib.h will be returned and errno is set to indicate the error from read() system call. int x[100]; int adr1 = 0x80000; if(db67_read_table_int (brd,&x, 100,adr1)<0) perror( db67_read_table_int ); Petrosyan Gevorg Page 20 07/02/2005

21 LIBRARY FUNCTION db67_read_table-float adr) int db67_read_table_float(int brd, float *d1, int len, int This function used to read float type data array from the DSP board memory. fd DSP board s file descriptor returned by db67open(int a) function. data pointer of float data type array. len number of data which will be read. adr - start address of the DSP memory space from where data array will be read. Upon successful completion, db67_read_table_float returns 0. Otherwise, error number RD_T_FLT_ERR defined in db67lib.h will be returned and errno is set to indicate the error from read() system call. float x[100]; int adr1 = 0x80000; if(db67_read_table_float (fd, &x, 100,adr1)!=0 ) perror( db67_read_table_int ); Petrosyan Gevorg Page 21 07/02/2005

22 LIBRARY FUNCTION db67_prog_load int db67_prog_load(int fd, char file[80]) This function resets DSP board and loads compiled program into the DSP. fd DSP board s file descriptor returned by db67open(int a) function. file path to the executable coff file. Upon successful completion, db67_prog_load returns 0. Otherwise, error numbers defined in db67lib.h will be returned and errno is set to indicate the error from write(),open() or calloc() system calls. Returned value from the function WR_SYS_ERR CALLOC_ERR NO_FILE System call set errno write() Calloc() Open() if(db67_prog_load (fd, linac.out )!=0 ) perror( db67_prog_load ); Petrosyan Gevorg Page 22 07/02/2005

23 LIBRARY FUNCTION db67_pause int db67_pause( int fd ) This function paused program in DSP. Upon successful completion, db67_pause returns 0. Otherwise, error number defined in db67lib.h will be returned and errno is set to indicate the error from write(),read() or ioctl() system calls. Returned value from the function WR_T_INT_ERR RD_T_INT_ERR WR_D_INT_ERR IOCTL_ERR System call set errno write() read() write() ioctl() if(db67_pause ( fd )!=0 ) perror( db67_pause ); Petrosyan Gevorg Page 23 07/02/2005

24 LIBRARY FUNCTION db67_run int db67_run(int fd) If a program in DSP was paused the program runs from the paused point. If DSP board was reset then the DSP runs the instructions at address 0x200. Before calling this function one of functions db67_reset, db67_pause, db67_prog_load mast be called, otherwise the error PR_NO_STOP will be returned. Upon successful completion, db67_pause returns 0. Otherwise, error numbers defined in db67lib.h will be returned and errno is set to indicate the error from write() system call. Returned value from the function WR_T_INT_ERR PR_NO_STOP System call set errno write() if(db67_run ( fd )!=0 ) perror( db67_run ); Petrosyan Gevorg Page 24 07/02/2005

25 LIBRARY FUNCTION db67_reset int db67_reset(int fd ) This function reset DSP board. Upon successful completion, db67_pause returns 0. Otherwise, error number IOCTL_ERR defined in db67lib.h will be returned and errno is set to indicate the error from ioctl() system call. if(db67_reset ( fd )!=0 ) perror( db67_reset ); ******************************************************************** Petrosyan Gevorg Page 25 07/02/2005

Processes often need to communicate. CSCB09: Software Tools and Systems Programming. Solution: Pipes. Recall: I/O mechanisms in C

Processes often need to communicate. CSCB09: Software Tools and Systems Programming. Solution: Pipes. Recall: I/O mechanisms in C 2017-03-06 Processes often need to communicate CSCB09: Software Tools and Systems Programming E.g. consider a shell pipeline: ps wc l ps needs to send its output to wc E.g. the different worker processes

More information

I/O Management! Goals of this Lecture!

I/O Management! Goals of this Lecture! I/O Management! 1 Goals of this Lecture! Help you to learn about:" The Unix stream concept" Standard C I/O functions" Unix system-level functions for I/O" How the standard C I/O functions use the Unix

More information

Outline. OS Interface to Devices. System Input/Output. CSCI 4061 Introduction to Operating Systems. System I/O and Files. Instructor: Abhishek Chandra

Outline. OS Interface to Devices. System Input/Output. CSCI 4061 Introduction to Operating Systems. System I/O and Files. Instructor: Abhishek Chandra Outline CSCI 6 Introduction to Operating Systems System I/O and Files File I/O operations File Descriptors and redirection Pipes and FIFOs Instructor: Abhishek Chandra 2 System Input/Output Hardware devices:

More information

Operating Systems. Lecture 06. System Calls (Exec, Open, Read, Write) Inter-process Communication in Unix/Linux (PIPE), Use of PIPE on command line

Operating Systems. Lecture 06. System Calls (Exec, Open, Read, Write) Inter-process Communication in Unix/Linux (PIPE), Use of PIPE on command line Operating Systems Lecture 06 System Calls (Exec, Open, Read, Write) Inter-process Communication in Unix/Linux (PIPE), Use of PIPE on command line March 04, 2013 exec() Typically the exec system call is

More information

Operating System Labs. Yuanbin Wu

Operating System Labs. Yuanbin Wu Operating System Labs Yuanbin Wu cs@ecnu Annoucement Next Monday (28 Sept): We will have a lecture @ 4-302, 15:00-16:30 DON'T GO TO THE LABORATORY BUILDING! TA email update: ecnucchuang@163.com ecnucchuang@126.com

More information

CMPS 105 Systems Programming. Prof. Darrell Long E2.371

CMPS 105 Systems Programming. Prof. Darrell Long E2.371 + CMPS 105 Systems Programming Prof. Darrell Long E2.371 darrell@ucsc.edu + Chapter 3: File I/O 2 + File I/O 3 n What attributes do files need? n Data storage n Byte stream n Named n Non-volatile n Shared

More information

TIP675-SW-82. Linux Device Driver. 48 TTL I/O Lines with Interrupts Version 1.2.x. User Manual. Issue November 2013

TIP675-SW-82. Linux Device Driver. 48 TTL I/O Lines with Interrupts Version 1.2.x. User Manual. Issue November 2013 The Embedded I/O Company TIP675-SW-82 Linux Device Driver 48 TTL I/O Lines with Interrupts Version 1.2.x User Manual Issue 1.2.5 November 2013 TEWS TECHNOLOGIES GmbH Am Bahnhof 7 25469 Halstenbek, Germany

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. Reading from a file. Closing a file

System calls. Reading from a file. Closing a file System calls The C language and C compiler has no knowledge about system calls. They are just function calls to precompiled functions. Example: fd = open( test.c, O_RDONLY); This will open the file test.c

More information

Input and Output System Calls

Input and Output System Calls Chapter 2 Input and Output System Calls Internal UNIX System Calls & Libraries Using C --- 1011 OBJECTIVES Upon completion of this unit, you will be able to: Describe the characteristics of a file Open

More information

COSC Operating Systems Design, Fall Lecture Note: Unnamed Pipe and Shared Memory. Unnamed Pipes

COSC Operating Systems Design, Fall Lecture Note: Unnamed Pipe and Shared Memory. Unnamed Pipes COSC4740-01 Operating Systems Design, Fall 2001 Lecture Note: Unnamed Pipe and Shared Memory Unnamed Pipes Pipes are a form of Inter-Process Communication (IPC) implemented on Unix and Linux variants.

More information

Preview. The pause() System Call. The pause() System Call. The signal() System Call 10/18/2017

Preview. The pause() System Call. The pause() System Call. The signal() System Call 10/18/2017 Preview The pause() System Call The pause() System call The signal() system call Signal set The sigprocmask() system call The sigaction() system call The sigsuspend() system call The abort() system call

More information

Introduction to File Systems. CSE 120 Winter 2001

Introduction to File Systems. CSE 120 Winter 2001 Introduction to File Systems CSE 120 Winter 2001 Files Files are an abstraction of memory that are stable and sharable. Typically implemented in three different layers of abstraction 3 I/O system: interrupt

More information

Communication. Serial port programming

Communication. Serial port programming Applied mechatronics Communication. Serial port programming Sven Gestegård Robertz sven.robertz@cs.lth.se Department of Computer Science, Lund University 2017 Outline 1 Introduction 2 Terminal I/O programming

More information

Lecture 21 Systems Programming in C

Lecture 21 Systems Programming in C Lecture 21 Systems Programming in C A C program can invoke UNIX system calls directly. A system call can be defined as a request to the operating system to do something on behalf of the program. During

More information

I/O OPERATIONS. UNIX Programming 2014 Fall by Euiseong Seo

I/O OPERATIONS. UNIX Programming 2014 Fall by Euiseong Seo I/O OPERATIONS UNIX Programming 2014 Fall by Euiseong Seo Files Files that contain a stream of bytes are called regular files Regular files can be any of followings ASCII text Data Executable code Shell

More information

CMSC 216 Introduction to Computer Systems Lecture 17 Process Control and System-Level I/O

CMSC 216 Introduction to Computer Systems Lecture 17 Process Control and System-Level I/O CMSC 216 Introduction to Computer Systems Lecture 17 Process Control and System-Level I/O Sections 8.2-8.5, Bryant and O'Hallaron PROCESS CONTROL (CONT.) CMSC 216 - Wood, Sussman, Herman, Plane 2 Signals

More information

TIP120-SW-42. VxWorks Device Driver. Motion Controller with Incremental Encoder Interface. Version 2.1.x. User Manual. Issue 2.1.

TIP120-SW-42. VxWorks Device Driver. Motion Controller with Incremental Encoder Interface. Version 2.1.x. User Manual. Issue 2.1. The Embedded I/O Company TIP120-SW-42 VxWorks Device Driver Motion Controller with Incremental Encoder Interface Version 2.1.x User Manual Issue 2.1.0 May 2010 TEWS TECHNOLOGIES GmbH Am Bahnhof 7 25469

More information

OS COMPONENTS OVERVIEW OF UNIX FILE I/O. CS124 Operating Systems Fall , Lecture 2

OS COMPONENTS OVERVIEW OF UNIX FILE I/O. CS124 Operating Systems Fall , Lecture 2 OS COMPONENTS OVERVIEW OF UNIX FILE I/O CS124 Operating Systems Fall 2017-2018, Lecture 2 2 Operating System Components (1) Common components of operating systems: Users: Want to solve problems by using

More information

ECEN 449 Microprocessor System Design. Review of C Programming. Texas A&M University

ECEN 449 Microprocessor System Design. Review of C Programming. Texas A&M University ECEN 449 Microprocessor System Design Review of C Programming 1 Objectives of this Lecture Unit Review C programming basics Refresh programming skills 2 Basic C program structure # include main()

More information

Windows architecture. user. mode. Env. subsystems. Executive. Device drivers Kernel. kernel. mode HAL. Hardware. Process B. Process C.

Windows architecture. user. mode. Env. subsystems. Executive. Device drivers Kernel. kernel. mode HAL. Hardware. Process B. Process C. Structure Unix architecture users Functions of the System tools (shell, editors, compilers, ) standard library System call Standard library (printf, fork, ) OS kernel: processes, memory management, file

More information

10. I/O System Library

10. I/O System Library 10. I/O System Library Header File #include // Found in C:\Nburn\include General File Descriptor Functions close --- Close open file descriptors read --- Read data from a file descriptor ReadWithTimeout

More information

Systems Programming. COSC Software Tools. Systems Programming. High-Level vs. Low-Level. High-Level vs. Low-Level.

Systems Programming. COSC Software Tools. Systems Programming. High-Level vs. Low-Level. High-Level vs. Low-Level. Systems Programming COSC 2031 - Software Tools Systems Programming (K+R Ch. 7, G+A Ch. 12) The interfaces we use to work with the operating system In this case: Unix Programming at a lower-level Systems

More information

Operating System Labs. Yuanbin Wu

Operating System Labs. Yuanbin Wu Operating System Labs Yuanbin Wu cs@ecnu Announcement Project 1 due 21:00, Oct. 8 Operating System Labs Introduction of I/O operations Project 1 Sorting Operating System Labs Manipulate I/O System call

More information

CS360 Midterm 2 Spring, 2016 James S. Plank March 10, 2016

CS360 Midterm 2 Spring, 2016 James S. Plank March 10, 2016 CS360 Midterm 2 Spring, 2016 James S. Plank March 10, 2016 In all of these questions, please assume the following: Pointers and longs are 4 bytes. The machine is little endian, but that doesn't matter

More information

Advcan QNX Driver User Manual V1.02

Advcan QNX Driver User Manual V1.02 Advcan QNX Driver User Manual V1.02 Contents 1. Introduction...1 1.1. System Requirement...1 1.2. Driver configuration...1 2. AdvCan Data Structures...2 2.1. Canmsg_t Struct Reference...2 2.2. CanStatusPar

More information

TMS320C3X Floating Point DSP

TMS320C3X Floating Point DSP TMS320C3X Floating Point DSP Microcontrollers & Microprocessors Undergraduate Course Isfahan University of Technology Oct 2010 By : Mohammad 1 DSP DSP : Digital Signal Processor Why A DSP? Example Voice

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

Outline. Overview. Linux-specific, since kernel 2.6.0

Outline. Overview. Linux-specific, since kernel 2.6.0 Outline 25 Alternative I/O Models 25-1 25.1 Overview 25-3 25.2 Signal-driven I/O 25-9 25.3 I/O multiplexing: poll() 25-12 25.4 Problems with poll() and select() 25-29 25.5 The epoll API 25-32 25.6 epoll

More information

UNIX input and output

UNIX input and output UNIX input and output Disk files In UNIX a disk file is a finite sequence of bytes, usually stored on some nonvolatile medium. Disk files have names, which are called paths. We won t discuss file naming

More information

Bootloading the TMS320VC5402 in HPI Mode

Bootloading the TMS320VC5402 in HPI Mode Application Report SPRA382 April 2002 Bootloading the TMS320VC5402 in HPI Mode Scott Tater DSP Applications Semiconductor Group ABSTRACT The TMS320VC5402 bootloader allows the system designer flexibility

More information

SOFTWARE ARCHITECTURE 2. FILE SYSTEM. Tatsuya Hagino lecture URL. https://vu5.sfc.keio.ac.jp/sa/login.php

SOFTWARE ARCHITECTURE 2. FILE SYSTEM. Tatsuya Hagino lecture URL. https://vu5.sfc.keio.ac.jp/sa/login.php 1 SOFTWARE ARCHITECTURE 2. FILE SYSTEM Tatsuya Hagino hagino@sfc.keio.ac.jp lecture URL https://vu5.sfc.keio.ac.jp/sa/login.php 2 Operating System Structure Application Operating System System call processing

More information

Asynchronous Events on Linux

Asynchronous Events on Linux Asynchronous Events on Linux Frederic.Rossi@Ericsson.CA Open System Lab Systems Research June 25, 2002 Ericsson Research Canada Introduction Linux performs well as a general purpose OS but doesn t satisfy

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

Introduction to Computer Systems. Exam 2. April 11, Notes and calculators are permitted, but not computers.

Introduction to Computer Systems. Exam 2. April 11, Notes and calculators are permitted, but not computers. 15-213 Introduction to Computer Systems Exam 2 April 11, 2006 Name: Andrew User ID: Recitation Section: Model Solution fp This is an open-book exam. Notes and calculators are permitted, but not computers.

More information

libnetfilter_log Reference Manual

libnetfilter_log Reference Manual libnetfilter_log Reference Manual x.y Generated by Doxygen 1.4.6 Tue Mar 21 13:47:12 2006 CONTENTS 1 Contents 1 libnetfilter_log File Index 1 2 libnetfilter_log File Documentation 1 1 libnetfilter_log

More information

CS 25200: Systems Programming. Lecture 14: Files, Fork, and Pipes

CS 25200: Systems Programming. Lecture 14: Files, Fork, and Pipes CS 25200: Systems Programming Lecture 14: Files, Fork, and Pipes Dr. Jef Turkstra 2018 Dr. Jeffrey A. Turkstra 1 Lecture 14 File table and descriptors Fork and exec Fd manipulation Pipes 2018 Dr. Jeffrey

More information

SYSTEM CALL IMPLEMENTATION. CS124 Operating Systems Fall , Lecture 14

SYSTEM CALL IMPLEMENTATION. CS124 Operating Systems Fall , Lecture 14 SYSTEM CALL IMPLEMENTATION CS124 Operating Systems Fall 2017-2018, Lecture 14 2 User Processes and System Calls Previously stated that user applications interact with the kernel via system calls Typically

More information

Overview. Administrative. * HW 1 grades. * HW 2 Due. Topics. * 5.1 What is a Signal? * Dealing with Signals - masks, handlers

Overview. Administrative. * HW 1 grades. * HW 2 Due. Topics. * 5.1 What is a Signal? * Dealing with Signals - masks, handlers Overview Administrative * HW 1 grades * HW 2 Due Topics * 5.1 What is a Signal? * 5.2-3 Dealing with Signals - masks, handlers * 5.4 Synchronization: pause(), sigsuspend() * 5.6 Interaction with other

More information

CSC209H Lecture 7. Dan Zingaro. February 25, 2015

CSC209H Lecture 7. Dan Zingaro. February 25, 2015 CSC209H Lecture 7 Dan Zingaro February 25, 2015 Inter-process Communication (IPC) Remember that after a fork, the two processes are independent We re going to use pipes to let the processes communicate

More information

File I/O. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

File I/O. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University File I/O Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Unix Files A Unix file is a sequence of m bytes: B 0, B 1,..., B k,..., B m-1 All I/O devices

More information

Maria Hybinette, UGA. ! One easy way to communicate is to use files. ! File descriptors. 3 Maria Hybinette, UGA. ! Simple example: who sort

Maria Hybinette, UGA. ! One easy way to communicate is to use files. ! File descriptors. 3 Maria Hybinette, UGA. ! Simple example: who sort Two Communicating Processes Hello Gunnar CSCI 6730/ 4730 Operating Systems Process Chat Maria A Hi Nice to Hear from you Process Chat Gunnar B Dup & Concept that we want to implement 2 On the path to communication

More information

How do we define pointers? Memory allocation. Syntax. Notes. Pointers to variables. Pointers to structures. Pointers to functions. Notes.

How do we define pointers? Memory allocation. Syntax. Notes. Pointers to variables. Pointers to structures. Pointers to functions. Notes. , 1 / 33, Summer 2010 Department of Computer Science and Engineering York University Toronto June 15, 2010 Table of contents, 2 / 33 1 2 3 Exam, 4 / 33 You did well Standard input processing Testing Debugging

More information

Secure Software Programming and Vulnerability Analysis

Secure Software Programming and Vulnerability Analysis Secure Software Programming and Vulnerability Analysis Christopher Kruegel chris@auto.tuwien.ac.at http://www.auto.tuwien.ac.at/~chris Heap Buffer Overflows and Format String Vulnerabilities Secure Software

More information

Operating Systems CS 217. Provides each process with a virtual machine. Promises each program the illusion of having whole machine to itself

Operating Systems CS 217. Provides each process with a virtual machine. Promises each program the illusion of having whole machine to itself Operating Systems CS 217 Operating System (OS) Provides each process with a virtual machine Promises each program the illusion of having whole machine to itself Process Process Process Process OS Kernel

More information

Unix System Programming - Chapter 8

Unix System Programming - Chapter 8 Unix System Programming - Chapter 8 Neal Nelson The Evergreen State College Apr 2010 USP Chapter 8 - Signals Section 8.1 - Basic Signal Concepts Section 8.2 - Generating Signals Section 8.3 - Signal Masks

More information

Overview. POSIX signals. Generation of signals. Handling signals. Some predefined signals. Real-time Systems D0003E 3/3/2009

Overview. POSIX signals. Generation of signals. Handling signals. Some predefined signals. Real-time Systems D0003E 3/3/2009 Overview Real-time Systems D0003E Lecture 13: More on inter-process communication (Burns & Wellings ch. 8, 11 & 10.6) Posix signals Posix timers timers in cygwin (lab environment) event-loop pattern semaphores

More information

Outline. Basic features of BPF virtual machine

Outline. Basic features of BPF virtual machine Outline 10 Seccomp 10-1 10.1 Introduction and history 10-3 10.2 Seccomp filtering and BPF 10-11 10.3 Constructing seccomp filters 10-16 10.4 BPF programs 10-30 10.5 Further details on seccomp filters 10-47

More information

Basic OS Progamming Abstrac2ons

Basic OS Progamming Abstrac2ons Basic OS Progamming Abstrac2ons Don Porter Recap We ve introduced the idea of a process as a container for a running program And we ve discussed the hardware- level mechanisms to transi2on between the

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 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017 CS 471 Operating Systems Yue Cheng George Mason University Fall 2017 Review: RAID 2 RAID o Idea: Build an awesome disk from small, cheap disks o Metrics: Capacity, performance, reliability 3 RAID o Idea:

More information

Layers in a UNIX System. Create a new process. Processes in UNIX. fildescriptors streams pipe(2) labinstructions

Layers in a UNIX System. Create a new process. Processes in UNIX. fildescriptors streams pipe(2) labinstructions Process Management Operating Systems Spring 2005 Layers in a UNIX System interface Library interface System call interface Lab Assistant Magnus Johansson magnusj@it.uu.se room 1442 postbox 54 (4th floor,

More information

COMP 3100 Operating Systems

COMP 3100 Operating Systems Programming Interface» A process is an instance of a running program. COMP 3100 Operating Systems» Functionality that an OS provides to applications» Process Management» Input/Output Week 3 Processes and

More information

Fall 2017 :: CSE 306. File Systems Basics. Nima Honarmand

Fall 2017 :: CSE 306. File Systems Basics. Nima Honarmand File Systems Basics Nima Honarmand File and inode File: user-level abstraction of storage (and other) devices Sequence of bytes inode: internal OS data structure representing a file inode stands for index

More information

What is a Process. Preview. What is a Process. What is a Process. Process Instruction Cycle. Process Instruction Cycle 3/14/2018.

What is a Process. Preview. What is a Process. What is a Process. Process Instruction Cycle. Process Instruction Cycle 3/14/2018. Preview Process Control What is process? Process identifier A key concept in OS is the process Process a program in execution Once a process is created, OS not only reserve space (in Memory) for the process

More information

IC221: Systems Programming 12-Week Written Exam [SOLUTIONS]

IC221: Systems Programming 12-Week Written Exam [SOLUTIONS] IC221: Systems Programming 12-Week Written Exam [SOLUTIONS] April 2, 2014 Answer the questions in the spaces provided on the question sheets. If you run out of room for an answer, continue on the back

More information

Naked C Lecture 6. File Operations and System Calls

Naked C Lecture 6. File Operations and System Calls Naked C Lecture 6 File Operations and System Calls 20 August 2012 Libc and Linking Libc is the standard C library Provides most of the basic functionality that we've been using String functions, fork,

More information

Final Exam. Fall Semester 2016 KAIST EE209 Programming Structures for Electrical Engineering. Name: Student ID:

Final Exam. Fall Semester 2016 KAIST EE209 Programming Structures for Electrical Engineering. Name: Student ID: Fall Semester 2016 KAIST EE209 Programming Structures for Electrical Engineering Final Exam Name: This exam is open book and notes. Read the questions carefully and focus your answers on what has been

More information

This is an open book, open notes exam. But no online or in-class chatting.

This is an open book, open notes exam. But no online or in-class chatting. Principles of Operating Systems Fall 2017 Final 12/13/2017 Time Limit: 8:00am - 10:00am Name (Print): Don t forget to write your name on this exam. This is an open book, open notes exam. But no online

More information

bytes per disk block (a block is usually called sector in the disk drive literature), sectors in each track, read/write heads, and cylinders (tracks).

bytes per disk block (a block is usually called sector in the disk drive literature), sectors in each track, read/write heads, and cylinders (tracks). Understanding FAT 12 You need to address many details to solve this problem. The exercise is broken down into parts to reduce the overall complexity of the problem: Part A: Construct the command to list

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

T4-Input/Output Management

T4-Input/Output Management T4-Input/Output Management SO-Grade 2013-2014 Q2 License Aquest document es troba sota una llicència Reconeixement - No comercial - Compartir Igual sota la mateixa llicència 3.0 de Creative Commons. Per

More information

Unit IV & V Previous Papers 1 mark Answers

Unit IV & V Previous Papers 1 mark Answers 1 What is pointer to structure? Pointer to structure: Unit IV & V Previous Papers 1 mark Answers The beginning address of a structure can be accessed through the use of the address (&) operator If a variable

More information

CMPSC 311- Introduction to Systems Programming Module: Input/Output

CMPSC 311- Introduction to Systems Programming Module: Input/Output CMPSC 311- Introduction to Systems Programming Module: Input/Output Professor Patrick McDaniel Fall 2014 Input/Out Input/output is the process of moving bytes into and out of the process space. terminal/keyboard

More information

Janus-MM Basic CAN Driver For Linux 2.6.xx and Windows XP. User Manual Revision A

Janus-MM Basic CAN Driver For Linux 2.6.xx and Windows XP. User Manual Revision A Janus-MM Basic CAN Driver For Linux 2.6.xx and Windows XP User Manual Revision A Revision Date Comments A 06/16/2011 Initial Version FOR TECHNICAL SUPPORT PLEASE CONTACT: Copyright 2011 Diamond Systems

More information

Processes COMPSCI 386

Processes COMPSCI 386 Processes COMPSCI 386 Elements of a Process A process is a program in execution. Distinct processes may be created from the same program, but they are separate execution sequences. call stack heap STACK

More information

UNIX System Programming. Overview. 2. Signal Types (31 in POSIX) Signal Sources. Signals. 1. Definition

UNIX System Programming. Overview. 2. Signal Types (31 in POSIX) Signal Sources. Signals. 1. Definition UNIX System Programming Signals Objectives Introduce signals Concentrate on sigaction() function 1730 UNIX System Programming Signals Maria Hybinette 1 Overview 1. Definition 2. Signal Types 3. Generating

More information

CS240: Programming in C

CS240: Programming in C CS240: Programming in C Lecture 13 si 14: Unix interface for working with files. Cristina Nita-Rotaru Lecture 13/Fall 2013 1 Working with Files (I/O) File system: specifies how the information is organized

More information

Bit Manipulation in C

Bit Manipulation in C Bit Manipulation in C Bit Manipulation in C C provides six bitwise operators for bit manipulation. These operators act on integral operands (char, short, int and long) represented as a string of binary

More information

TMS320VC5510 DSP Host Port Interface (HPI) Reference Guide

TMS320VC5510 DSP Host Port Interface (HPI) Reference Guide TMS320VC5510 DSP Host Port Interface (HPI) Reference Guide Literature Number: August 2004 IMPORTANT NOTICE Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections,

More information

Systems Programming. 08. Standard I/O Library. Alexander Holupirek

Systems Programming. 08. Standard I/O Library. Alexander Holupirek Systems Programming 08. Standard I/O Library Alexander Holupirek Database and Information Systems Group Department of Computer & Information Science University of Konstanz Summer Term 2008 Last lecture:

More information

Like select() and poll(), epoll can monitor multiple FDs epoll returns readiness information in similar manner to poll() Two main advantages:

Like select() and poll(), epoll can monitor multiple FDs epoll returns readiness information in similar manner to poll() Two main advantages: Outline 23 Alternative I/O Models 23-1 23.1 Overview 23-3 23.2 Nonblocking I/O 23-5 23.3 Signal-driven I/O 23-11 23.4 I/O multiplexing: poll() 23-14 23.5 Problems with poll() and select() 23-31 23.6 The

More information

System support for adaptation and composition of applications

System support for adaptation and composition of applications System support for adaptation and composition of applications Stephen Kell Stephen.Kell@cl.cam.ac.uk Computer Laboratory University of Cambridge... adaptation and composition... p. 1 First, a video Note:

More information

Like select() and poll(), epoll can monitor multiple FDs epoll returns readiness information in similar manner to poll() Two main advantages:

Like select() and poll(), epoll can monitor multiple FDs epoll returns readiness information in similar manner to poll() Two main advantages: Outline 22 Alternative I/O Models 22-1 22.1 Overview 22-3 22.2 Nonblocking I/O 22-5 22.3 Signal-driven I/O 22-11 22.4 I/O multiplexing: poll() 22-14 22.5 Problems with poll() and select() 22-31 22.6 The

More information

Quiz: Address Translation

Quiz: Address Translation Quiz: Address Translation 8 bits 1 st level 8 bits 8 bits 2 nd level offset Virtual address format (24bits) 4 bits 3 Frame # Unused 1 V Page table entry (8bit) Vaddr: 0x0703FE Paddr: 0x3FE Vaddr: 0x072370

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

CMPSC 311- Introduction to Systems Programming Module: Assignment #2 Cartridge HRAM Filesystem

CMPSC 311- Introduction to Systems Programming Module: Assignment #2 Cartridge HRAM Filesystem CMPSC 311- Introduction to Systems Programming Module: Assignment #2 Cartridge HRAM Filesystem Professor Patrick McDaniel Fall 2016 Assignment #2 Idea you are to maintain the correct file contents in an

More information

Programs. Function main. C Refresher. CSCI 4061 Introduction to Operating Systems

Programs. Function main. C Refresher. CSCI 4061 Introduction to Operating Systems Programs CSCI 4061 Introduction to Operating Systems C Program Structure Libraries and header files Compiling and building programs Executing and debugging Instructor: Abhishek Chandra Assume familiarity

More information

CS 33. Architecture and the OS. CS33 Intro to Computer Systems XIX 1 Copyright 2017 Thomas W. Doeppner. All rights reserved.

CS 33. Architecture and the OS. CS33 Intro to Computer Systems XIX 1 Copyright 2017 Thomas W. Doeppner. All rights reserved. CS 33 Architecture and the OS CS33 Intro to Computer Systems XIX 1 Copyright 2017 Thomas W. Doeppner. All rights reserved. The Operating System My Program Mary s Program Bob s Program OS CS33 Intro to

More information

Tutorial on Socket Programming

Tutorial on Socket Programming Tutorial on Socket Programming Computer Networks - CSC 458 Department of Computer Science Hao Wang (Slides are mainly from Seyed Hossein Mortazavi, Monia Ghobadi, and Amin Tootoonchian, ) 1 Outline Client-server

More information

Topics. Unix Pipes (CSE 422S) In A Nutshell. Ken Wong Washington University. Pipe (Unnamed FIFO) in the Shell.

Topics. Unix Pipes (CSE 422S) In A Nutshell. Ken Wong Washington University. Pipe (Unnamed FIFO) in the Shell. Unix s (CSE 422S) Ken Wong Washington University kenw@wustl.edu www.arl.wustl.edu/~kenw Topics Interprocess Communication (IPC) with named and unnamed pipes»unbuffered I/O system calls (open, read, write,

More information

ICS143A: Principles of Operating Systems. Lecture 14: System calls (part 2) Anton Burtsev November, 2017

ICS143A: Principles of Operating Systems. Lecture 14: System calls (part 2) Anton Burtsev November, 2017 ICS143A: Principles of Operating Systems Lecture 14: System calls (part 2) Anton Burtsev November, 2017 System call path 3316 void 3317 tvinit(void) 3318 { 3319 Initialize IDT int i; tvinit() is called

More information

CS321: Computer Networks Socket Programming

CS321: Computer Networks Socket Programming CS321: Computer Networks Socket Programming Dr. Manas Khatua Assistant Professor Dept. of CSE IIT Jodhpur E-mail: manaskhatua@iitj.ac.in Socket Programming It shows how the network application programs

More information

Preview. Interprocess Communication with Pipe. Pipe from the Parent to the child Pipe from the child to the parent FIFO popen() with r Popen() with w

Preview. Interprocess Communication with Pipe. Pipe from the Parent to the child Pipe from the child to the parent FIFO popen() with r Popen() with w Preview Interprocess Communication with Pipe Pipe from the Parent to the child Pipe from the child to the parent FIFO popen() with r Popen() with w COCS 350 System Software, Fall 2015 1 Interprocess Communication

More information

CSCI 4500/8506 Operating Systems Some UNIX System Calls, Library, and PThreads Functions

CSCI 4500/8506 Operating Systems Some UNIX System Calls, Library, and PThreads Functions CSCI 4500/8506 Operating Systems Some UNIX System Calls, Library, and PThreads Functions Described below is a subset of UNIX system calls, library functions, and Pthreads (that is, POSIX Threads) functions.

More information

EL2310 Scientific Programming

EL2310 Scientific Programming Lecture 12: Memory, Files and Bitoperations (pronobis@kth.se) Overview Overview Lecture 12: Memory, Files and Bit operations Wrap Up Main function; reading and writing Bitwise Operations Wrap Up Lecture

More information

Practical Malware Analysis

Practical Malware Analysis Practical Malware Analysis Ch 4: A Crash Course in x86 Disassembly Revised 1-16-7 Basic Techniques Basic static analysis Looks at malware from the outside Basic dynamic analysis Only shows you how the

More information

Signals are a kernel-supported mechanism for reporting events to user code and forcing a response to them. There are actually two sorts of such

Signals are a kernel-supported mechanism for reporting events to user code and forcing a response to them. There are actually two sorts of such Signals are a kernel-supported mechanism for reporting events to user code and forcing a response to them. There are actually two sorts of such events, to which we sometimes refer as exceptions and interrupts.

More information

CS350 Operating Systems

CS350 Operating Systems CS350 Operating Systems Instructor: Ali Mashtizadeh IAs: Zhenyu Bai, Michael Honke, Jade Marcoux-Ouellet Instructional Support: Gang Lu University of Waterloo 1 / 32 Outline 1 Administrivia 2 Substance

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

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

Byte Ordering. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Byte Ordering. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University Byte Ordering Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Memory Model Physical memory DRAM chips can read/write 4, 8, 16 bits DRAM modules

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

Last week. Data on the stack is allocated automatically when we do a function call, and removed when we return

Last week. Data on the stack is allocated automatically when we do a function call, and removed when we return Last week Data can be allocated on the stack or on the heap (aka dynamic memory) Data on the stack is allocated automatically when we do a function call, and removed when we return f() {... int table[len];...

More information

Chapter 10. Programming in C

Chapter 10. Programming in C Chapter 10 Programming in C Lesson 05 Functions in C C program Consists of three parts preprocessor directives macros main function functions 3 Function Each has a name (for identity ID) May have the arguments

More information

UNIX System Programming. Overview. 1. A UNIX System. 2. Processes (review) 2.1. Context. Pipes/FIFOs

UNIX System Programming. Overview. 1. A UNIX System. 2. Processes (review) 2.1. Context. Pipes/FIFOs UNIX System Programming Pipes/FIFOs Overview 1. A UNIX System (review) 2. Processes (review) Objectives Look at UNIX support for interprocess communication (IPC) on a single machine Review processes pipes,

More information

Chapter 5. TCP Client-Server

Chapter 5. TCP Client-Server Chapter 5. TCP Client-Server Example Contents Introduction TCP Echo Server TCP Echo Client Normal Startup and Termination Posix Signal Handling Handling SIGCHLD Signals Data Format and so on... 5.1 Introduction

More information

CS429: Computer Organization and Architecture

CS429: Computer Organization and Architecture CS429: Computer Organization and Architecture Dr. Bill Young Department of Computer Sciences University of Texas at Austin Last updated: March 5, 2018 at 05:33 CS429 Slideset 11: 1 Alignment CS429 Slideset

More information

Data Representation and Storage

Data Representation and Storage Data Representation and Storage Learning Objectives Define the following terms (with respect to C): Object Declaration Definition Alias Fundamental type Derived type Use size_t, ssize_t appropriately Use

More information

NOTE: Debug and DebugSingle are the only MPI library configurations that will produce trace output.

NOTE: Debug and DebugSingle are the only MPI library configurations that will produce trace output. Trace Objects Trace Objects Introduction Use the Trace module to selectively produce trace output on a global and/or per-object basis for your application. You can specify the types of trace output when

More information