Mail Archives: djgpp/1997/10/02/12:00:52
On Tue, 30 Sep 1997, Arthur Bredrick wrote:
> Why would it be good to forbid hooking interrupts when it is obviously
> useful in many situations?
Unix is a multiplatform OS, Linux is the Intel 386+ port of Unix.
Whenever you create multiplatform software, it must be designed around
hardware that is common to all platforms. Any hardware specific code is
an extension, and therefore inherintly unportable. Unportable code in
Unix is kept in the Kernel, which is different for each platform but
provides a uniform API for the rest of the Unix system.
The method of hooking hardware interrupts and dealing with them varies
drastically between machines, even when those machines are capable of it
(remember, Unix is a very old OS). Therefore, all system hardware
are presented to applications as /dev/* streams, and the device drivers
and Kernel worry about how the machine interacts with the hardware. This
provides a consitent, portable interface, that makes Unix so popular for
heterogeneous networks.
Properly written Unix code is just a recompile away from running on your
state of the art machine. In the past, code written under DOS for IBM PC
XT's wouldn't run on AT's. The code interacted directly with the hardware
and depended on looping delays to time the hardware response. When the
machine got faster the loops finished to quick! When you change the
hardware card, the loop was wrong again.
That's why hardware abstraction is A Good Thing, even if you're writing a
state of the art game. If you can get fast enough drivers you don't
haven't to write seperate code for each video card, making your code
smaller and development time much shorter.
---------------
Peter Berdeklis
Dept. of Physics, Univ. of Toronto
- Raw text -