[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] Supexec taking one VBL?
This is all nice and good but how this helps programmer to make own VBL
handler code in FreeMiNT?
I will rephrase Frank's post: the user-space interrupt handler exists in
MiNT and it is called "signal handler". You cannot call the user code from
within an asynchronous hardware interrupt, because this would f.e. need to
reconfigure the MMU (which areas are protected etc.), and despite that, it
endangers the kernel stability (a bug in such a handler would be a
disaster).
Imagine that you register your VBL handler for process A, but this process
gets preempted, the CPU time is given to process B. While the process B is
running, your registered VBL occurs. What should the system do with your
user handler? Forcibly preempt the process B and switch the tasks to
process A? Or miss the turn? Or what?
Hardware interrupt handlers have to be registered in kernel space. So you
have to create a device driver, which would do what you want within the
VBL interrupt, and would be controlled from your user space application
(the demo) by means of such calls as Fopen(), Fread(), Fwrite(), Fcntl()
and such.
Pozdrawiam
KMK