[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: off topic - Assembler using GCC



Sorry, forgot to do /group/ reply...

Quoting MallarJ@aol.com (MallarJ@aol.com):
> In a message dated 2/3/99 9:55:07 AM Central Standard Time,
> Marcus.Brinkmann@ruhr-uni-bochum.de writes:
[snip]
> >  The whole purpose of the Linux kernel is to protect the hardware from the
> >  user processes.
> 
> I for one say, yes, any program should be able to mess with interrupts.  I had
> a real-world example a few months ago.  My company wanted me to modify it's
> test facility - a program designed to simulate credit card transactions via
> serial communications.  It used interrupt driven comm routines to talk to the
> server over standard phone lines.  I was constantly messing with the
> interrupts.  (FYI - this was a DOS based program.)

Naturally; DOS is a single user/task OS, so you can do what you like
with it. If you happen to crash it, so be it.

> I understand the need to shield interrupts from the user in most cases, but
> Linux shouldn't prevent their use either.

That's just not possible with a multi-user multi-tasking OS,
particularly one like unix which has to present the same abstract
model on completely different hardware.

If one program "messes with" interrupts, how is any other program
meant to perform its function when it doesn't know what the first
one did?

If you screw up and crash the machine, what do you say to all the
other users of the machine?

It is the job of the kernel and its drivers to be in sole control
of the hardware. So, it doesn't /prevent/ the use of interrupts,
it just reserves the right to use them for itself alone.

> And why would this require root to run the software?

I don't think it would be sufficient to be root. AIUI, when
any non-kernel process is running, its privilege level is
set so it can't do any I/O etc. itself. Root just has the
power to override file permissions etc. including those set
on device files, but its ordinary processes are constrained
just like any other users.

Any standard texts on unix will explain these principles.

Cheers,

-- 
Email:  d.wright@open.ac.uk   Tel: +44 1908 653 739  Fax: +44 1908 655 151
Snail:  David Wright, Earth Science Dept., Milton Keynes, England, MK7 6AA
Disclaimer:   These addresses are only for reaching me, and do not signify
official stationery. Views expressed here are either my own or plagiarised.


Reply to: