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

Re: [f-cpu] Emulator with System C



Christophe wrote:
> Well, in a monolisthic kernel where we have two rings : user and kernel, we can
> have such a flag when in kernel mode to prevent any preemptive task switch.
> But, what happens if an IRQ wants to access a shared ressource locked by a
> spinlock ? it sounds very bad. With a CAS or a CAS2, it would always hit the
> first time (except if another IRQ wanting to access the same ressource is
> nested) and have access on ressource. The interrupted code will just have to
> retry because - after all - IRQ was more prioritized.
> 
> For user code, there is no way to disable interrupts because it is considered
> as a kernel priviledge to do so. So the spinlock cannot be fairly handled
> without using a kernel trap. Of course, we can use a flag for temporally
> disabling task switch (i.e, our scheduler first checks this flag is off before
> switching another task. It sounds like a useless overhead when flag is set).

The problem is the IRQ service has become a catch all for stuff. With
buffering now days lets just delete it and solve all the problems and go
back to polled I/O. BTW the really old computers like the IBM 1130 had a
keyboard lockout so you could not press a key until the computer
'unlocked' the keyboard. Could not some hardware IRQ's like timer ticks
have lower priority than the CAS instructions? I remember reading about
one old machine , interrupts were only allowed after a successful branch
instruction. Good system design here is needed  and not having software
do all the work.

-- 
Ben Franchuk - Dawn * 12/24 bit cpu *
www.jetnet.ab.ca/users/bfranchuk/index.html
*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/