delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/02/12:00:52

Newsgroups: comp.os.msdos.djgpp
From: Peter Berdeklis <peter AT atmosp DOT physics DOT utoronto DOT ca>
Subject: Re: Int-Hooking, DOS vs LINUX
Message-ID: <Pine.SGI.3.91.971002100755.16860C-100000@atmosp.physics.utoronto.ca>
Nntp-Posting-Host: chinook.physics.utoronto.ca
Sender: news AT info DOT physics DOT utoronto DOT ca (System Administrator)
Mime-Version: 1.0
Organization: University of Toronto - Dept. of Physics
In-Reply-To: <EHCAw1.EKv@nonexistent.com>
Date: Thu, 2 Oct 1997 14:20:56 GMT
References: <199709282203 DOT PAA14896 AT adit DOT ap DOT net> <EHCAw1 DOT EKv AT nonexistent DOT com>
Lines: 36
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019