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

[f-cpu] Emulator with System C


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).

For operating systems which use 99,9% user code and reduce at maximum the usage
of kernel code for critical part, it becomes a nightmare.

That's why, I prefer to avoid spinlocks if possible.

Ok, let us forget all those details... I'm really impatient that you advanced
in your VHDL source. It would be easier for me to understand anything if those
damned VHDL sources are really written.

I was planning to do an emulator with System C but I lack a lot of details
about implementation.

To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/