操作系統-OS 作業輔導

<标题>操作系統程序輔導 操作系統編程作業

Raspberry Pi電腦板

CSE30 – HW #2
Part I – Due Monday Oct 26, 2015 by 11:30pm
Part II – Due Monday Nov 2, 2015 by 11:30 pm
Introduction
This is an assignment in two parts. In the first part you are given more
practice with GDB, the GNU Project Debugger and a lot of practice with
pointers by writing C code that uses them heavily. You will also make your
first venture into Assembly.
The second part of the assignment focusses on translating your C code
to Assembly. After completing the assignment you should know many of the
important ARM instructions (particularly those that interact with memory)
and understand what goes on under the hood of your C program.
Please note that part II is due one week after the due date of part I.
This assignment is subject to the style guidelines posted on the course
site:
https://cseweb.ucsd.edu/classes/fa15/cse30/hw/style.pdf.
All parts of this assignment should be completed and tested on
the Raspberry Pi.
1
Part I
1 GDB: More debugging practice
GDB allows you to inspect and modify the program as it

Inter-Process Communication Engines

<标题>Inter-Process Communication Engines

1. Objective
Lab 2 is designed to help you understand how to use IPC mechanisms to support communications
between two processes. In the class you have learned Pipe, RPC, Socket, Shared Memory, and Signal. In
this lab, you will practice three different IPC mechanisms: Unix Socket, System V Shm and Posix Shm to
enable processes to send/receive messages.
2. Background
This section introduces the context of the lab and gives you an idea of why and when you would need to
do this type of task.
When system software engineers in industry build backend server systems (e.g., in big cloud or large
data centers), they often start and run m communication-driver processes and n application processes
on the server, where m <= n. The driver process receives requests from a great number of clients, and
then sends them to the application process to process. Note that here the driver process and the
application process are on the same machine. To implement this step, you need an inter-pro

CSE320 Fall 2015 – Homework 4

CSE320 Fall 2015 – Homework 4
Due Friday 10/30/2015 @ 11:59pm
Introduction
The goal of this assignment is to become f amiliar with low-level Unix/POSIX system calls related to
process and job control, f ile access, and IPC (pipes and redirection). You will write a mini-shell with basic
operations (a small subset of Bash’s f unctionality). Expected length of this C program is 1000-2000
lines of code (not very long, but the code will be challenging, so start early).
Takeaways
Af ter completing this homework you should:
Understand process execution, pipes, and f orks
Enhance your understanding of *nix commands and the command line
Working with existing C libraries and system calls
Enhance your C programming abilities
Working with a partner
You are allowed to have groups of up to two members f or the remaining assignments. If you wish to
have a partner you must email cse320@cs.stonybrook.edu. The email should have the subject:
[CSE320] Group Formation . The contents of the email should contain the f ollowing inf

QEMU: Adding a System Call

Assignment 3 CMPT-300

QEMU: Adding a System Call

Disclaimer: This assignment is adapted from a project developed by Dr. Jason Nieh at

Columbia University.

Part A:

Setup Your Linux Kernel Building Environment and add dummy

<标题>syscall(25%):

The first step is to learn how to create a virtual machine using QEMU and install a

custom kernel.

Please follow this tutorial:

<标题>http://www.sfu.ca/~rws1/cmpt-300/assignments/a3-qemu-tut.pdf

All files can be downloaded from:

http://www.sfu.ca/~rws1/cmpt-300/assignments/cmpt300-a3.zip

Part B:

<标题>Adding an advanced system call(75%):

Write a new system call in Linux. The system call you write should take one argument

<标题>(pointer to a data structure) and return various information for the process identified by

<标题>the pid in the data structure. All return information will be put into the data structure. For

the following discussion all relative paths refer to the top of your kernel source

directory linux-2.6.26.5

The prototype for your system call will be:

int prinfo(struc