当前位置:毕业生招聘信息网知名企业资料IT/电信扬智 → 知名企业资料内容

扬智(软)第9题答案

作者:佚名  来源:不详  发布时间:2007-4-27 15:29:00
题目:
9. What is hardware interrupt? What is software interrupt? What is
   exception?   Please tell me all you know about interrupt.
an:
(1) hardware interrupt and software interrupt
In general, there are hardware interrupts and software interrupts. A hardwar
e interrupt occurs, for example, when an I/O operation is completed such as
reading some data into the computer from a tape drive. A software interrupt
occurs when an application program terminates or requests certain services f
rom the operating system. In a personal computer, a hardware interrupt reque
st (IRQ) has a value associated with it that associates it with a particular
device
(2) exception
exceptions are the result of some action by the currently executing code.
Examples of e xceptions are divide by zero, illegal instruction,
bad memory access, etc.
(3) about interrupt
An interrupt is a signal from a device attached to a computer or from a pro
gram within the computer that causes the main program that operates the comp
uter (the operating system) to stop and figure out what to do next. Almost a
ll personal (or larger) computers today are interrupt-driven - that is, they
start down the list of computer instructions in one program (perhaps an app
lication such as a word processor) and keep running the instructions until e
ither (A) they can''t go any further or (B) an interrupt signal is sensed. Af
ter the interrupt signal is sensed, the computer either resumes running the
program it was running or begins running another program.
Basically, a single computer can perform only one computer instruction at a
time. But, because it can be interrupted, it can take turns in which program
s or sets of instructions that it performs. This is known as multitasking. I
t allows the user to do a number of different things at the same time. The c
omputer simply takes turns managing the programs that the user effectively s
tarts. Of course, the computer operates at speeds that make it seem as thoug
h all of the user''s tasks are being performed at the same time. (The compute
r''s operating system is good at using little pauses in operations and user t
hink time to work on other programs.)
An operating system usually has some code that is called an interrupt handle
r. The interrupt handler prioritizes the interrupts and saves them in a queu
e if more than one is waiting to be handled. The operating system has anothe
r little program, sometimes called a scheduler, that figures out which progr
am to give control to next.

请在邮件中注明:信息来自Byszp.COM

热门招聘信息more

推荐招聘信息more