In Amigaland, you transfer control to the operating system by calling library functions. Piru knows a lot more about this than I do, but generally, your header files include function table offsets (indexes). You store the library base address in your application via LoadLibrary, and a call to a function loads the table and jumps to the address referenced by the index.
In other systems, control is usually passed to the operating system using a system call instructon or interrupt or an invalid instruction exception trapped by an operating system dispatch routine. Windows uses INT 2E, for example, and Linux uses INT 80 (on x86--different architectures provide different means for making system calls).
For resources, the system functions store and keep track of allocations. For example, AllocMem and AllocVec track memory allocation. It's the application's responsibility to notify the system when those resources are no longer needed. This is true in most operating environments, althogh some, like Java, have garbage collection routines that will clean up resources that are no longer in use.