Week Fifteen Agenda. Announcements Revised Final Exam Outline Review week fourteen information Current weeks information Open Source Presenters Angelina LePes Richard Dawber John Ulrich Daniel Miotke Rob Ream Lucas Griffin William Smith. Week Fifteen Agenda.
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
1’s Complement is where all the bits that are a 1 are changed to 0 and all the bits that are 0 are changed to 1. Reversing the digits is also called complementing the number.
We will use 4-bit arithmetic to illustrate the point.
All negative integers begin with a 1. The most significant bit always tells the sign of the number. The only exception to this rule is the -0.
Kill command is use in several operating systems to send signals to running processes. Implementing the kill command, does not always result in terminating a process. The kill command is a wrapper around the kill() system call, which sends signals to processes or process groups on the system that can be referenced by their process ID (pid).
There are many different signals that can be sent to a process, although the ones of most interest are the SIGTERM and SIGKILL.
The default signal sent is SIGTERM. Programs that can handle this signal can have useful cleanup operations (save configuration information to a file) before a process terminates.
All signals can be intercepted by a process except the SIGKILL and SIGSTOP. These two signals cause a special function to be executed, that are only seen by the kernel. The SIGKILL kills the process, and SIGSTOP pauses it until a SIGCONT is received.
UNIX provides security mechanisms that prevent one user on the system from killing another user’s process. In order for one process to send a signal to another, the owner of the signaling process must be the same as the owner of the receiving process or be the superuser.
Other useful signals include the following:
SIGINT signal can be generated with a CTRL+c
SIGTSTP signal can be generated with a CTRL+z
SIGQUIT signal can be generated with a CTRL+\
The SIGQUIT will force the program to do a core dump.
Microsoft’s command line interpreter Windows PowerShell, kill is a predefined command alias for the Stop-Process command.
Microsoft Windows XP, Vista and 7, include the command taskkill.
The fork () function is used to create a new process from an existing process. The new process is called the child process, and the existing process is called the parent. Their differences can be verified by checking the return value from fork (). The parent gets the child’s pid returned to him, but the child get 0 (zero) to him.
The attributes the child inherits from the parent varies depending on the UNIX implementation.
Process credentials (uids and gids)
Open file descriptors
Close on exec flags
Signal handling settings
Process group ID
Current working directory
File mode creation mask (umask)
Unique to child process:
Different parent process ID
Own copy of file descriptors and directory streams
Process, text, data and other memory locks are NOT inherited
Process times, in the tms struct
Resource utilization are set to zero.
Pending signals initialized to the empty set
Timers created by timer_create operations not inherited
Asynchronous input or output operations not inherited