You are on page 1of 3

ASSIGMENT NO 2

OS

M Ateeb Saleem
Indus University
Difference between Interrupt & Trap?

Trap Interrupt
A trap is an exception in a user An interrupt is something generated by
process. the hardware.
Handling is synchronous (so the user These are asynchronous (i.e. they
code is suspended and continues don't happen at predictable places in
afterwards). the user code) or "passive"
Traps are software-invoked interrupts. Interrupts are hardware interrupts.

Define System Call & working of system call?


SYSTEM CALL
A system call is the programmatic way in which a computer program requests a
service from the kernel of the operating system it is executed on. This may include
hardware-related services (for example, accessing a hard disk drive), creation and
execution of new processes, and communication with integral kernel services such as
process scheduling.

Working Of System Call


 First, the user application program sets up the arguments for the system call.
 After the arguments are all set up, the program executes the "system call"
instruction.
 This instruction causes an exception: an event that causes the processor to jump
to a new address and start executing the code there.
 The instructions at the new address save your user program's state, figure out
what system call you want, call the function in the kernel that implements that
system call, restores your user program state, and returns control back to the
user program.

What Type of operations DMA is useful? Explain your answer?

DMA controllers vary as to the type of DMA transfers and the number of DMA
channels they support. The two types of DMA transfers are flyby DMA transfers
and fetch-and-deposit DMA transfers. The three common transfer modes are single,
block, and demand transfer modes. These DMA transfer types and modes are
described in the following paragraphs.
The fastest DMA transfer type is referred to as a single-cycle, single-address, or
flyby transfer. In a flyby DMA transfer, a single bus operation is used to accomplish
the transfer, with data read from the source and written to the destination
simultaneously. In flyby operation, the device requesting service asserts a DMA
request on the appropriate channel request line of the DMA controller. The DMA
controller responds by gaining control of the system bus from the CPU and then
issuing the pre-programmed memory address. Simultaneously, the DMA controller
sends a DMA acknowledge signal to the requesting device. This signal alerts the
requesting device to drive the data onto the system data bus or to latch the data from
the system bus, depending on the direction of the transfer.