TUD-OS / NRE

NOVA runtime environment (official branch)
GNU General Public License v2.0
33 stars 12 forks source link

Ideas for an NRE Interrupt API approach #57

Closed lonnietc closed 3 years ago

lonnietc commented 3 years ago

Hi Nils,

I wanted to get you opinion on an idea that I have been playing with such that the services created by the NRE framework could be accessed via some type of low level interrupt with a service call and data on the stack perhaps.

Basically, the idea would be that the user Apps compiled would not have to compile with the NRE Services headers and do everything through and API interrupt system instead, or something along these lines.

This would further separate the service drivers code from the application code.

Any thoughts on this or something similar?

Cheers and have a great day, my friend.

Nils-TUD commented 3 years ago

I'm not sure what you mean. NOVA already provides an IPC mechanism that is used by clients to talk to services. Are you talking about a different kind of IPC mechanism that interrupts services in case of a call similar to a UNIX signal? If so, I would strongly argue against that.

At first, signals are a very bad mechanism that leads to all kinds of problems. Just read the man pages to signals to get an impression of it :)

Second, I don't see any advantage over the current IPC mechanism. In particular, I don't see 1. what the problem with depending on specific services headers is and 2. how you can avoid this dependency (in a reasonable way). I mean, you will always have some kind of protocol for the communication between client and service and therefore will need something like a header as a shared dependency of client and service that describes this protocol.

However, maybe I missunderstood your question. Can you elaborate more on it?

lonnietc commented 3 years ago

Yea, I could be pretty far off base here, but if I remember my old days of assembly language, you would often write up an ISR (Interrupt Service Routine) that then load the stack, accumulators, and data segments appropriately after which you would issue and interrupt for the ISR to handle the task.

This would only require that the Application setup the data properly and then issue an appropriate interrupt number, thus no "headers" needed and accessible from just about any language.

I was thinking something similar, but had not really dug into it much beyond just a thought experiment.

I will read up on the IPC more since it is more than likely the best way to go as the above ISR approach is probably a bad idea, but just thought to ask. Cheers