I want to have clarity on user space program and OS interaction. In the context of a file I/O, I want to know how a user app like a java file i/o API read() may work. Since file operations are accessed by POSIX system calls like open() close() read() write(), how does the java code calls these system calls ?
When we compile the java code, what kind of instructions the java read() API would be compiled to ? Its said, user programs raise traps/software interrupts to make system calls. So does Java read() API is also raise traps ? Are there APIs in java to Raise traps ? If yes, so those APIs might be compiled to trap instructions like 'INT' ? But then does INT calls higher layer POSIX system calls or some fixed ISRs (Interrupt Service Routines) ?
I am confused and trying to know step by step... from compilation to execution- how system calls are done in this scenario.
Please help me with this simple concept.