Reputation: 838
Is it possible for an external hardware device to use system calls and access the operating system? It reminds me of the auto-run of a disk-on-key device but I'm not sure whether it occurs because of the operating system or the device itself.
Upvotes: 1
Views: 694
Reputation: 71586
I am sure someone could or perhaps has built one. But in general that is not how it works. The hardware causes some software via interrupt or polling or other to handle that hardware event (the insertion of a usb key and enabled features of the usb driver or operating system software above the driver level to search for autorun files and run them).
when you click the mouse button it simply sends a signal to the computer which in turn wakes up some software that handles that button press. that software is either part of or interacts with the operating system.
In the case of automatically mounting a drive or cd or dvd when inserted starts with signals being sent that wakes up low level software for that interface, then that is passed up/over to the operating system which then if it has features enabled might automatically mount that drive, then if it has features and they are enabled might then search for certain agreed upon files that would allow software on that device to be run by the operating system. All the operating system interaction is done by software.
Upvotes: 0
Reputation: 21667
A system call requires a process. Unless there is a process tied to the device, there is no way to do a system call.
Normally devices access the operating system through interrupts. Interrupts are handled in a manner that is similar to the way system calls are dispatched. The difference that system calls are triggered by exceptions,rather than interrupts.
Upvotes: 1