Input/Output Flashcards
(14 cards)
How an application requests for the operating system to perform some specific operation.
Accessing system services
The interface between an executing process and the operating system.
System call
- Logically similar to calling a function, where the function code is located within the operating system.
- The function may require privileges to operate, which is why control must be transferred to the operating system.
System service call
True or False
When calling system services, arguments are placed in the standard argument registers.
True
- To call a system service, the first step is to determine which system service is desired.
- The general process is that the system service call code is placed in the _____ register.
rax
- The __________ is a number that has been assigned for the specific system service being requested.
- These are assigned as part of the operating system and cannot be changed by application programs.
call code
If any are needed, the arguments for system services are placed in what registers?
rdi, rsi, rdx, r10, r8, and r9 registers.
After the call code and any arguments are set, the __________ instruction is executed.
syscall
- The __________ instruction will pause the current process and transfer control to the operating system which will attempt to perform the service specified in the rax register.
- When the system service returns, the process will then resume.
syscall
- The system service to output characters to the console is the 1.) __________
- These characters are written to 2.) __________ which is the console.
- system write (SYS_write).
- standard out (STDOUT)
The arguments for the write system service are as follows:
- rax -> Call code = SYS_write (1)
- rdi -> Output location, STDOUT (1)
- rsi -> Address of characters to output
- rdx -> Number of characters to output
The system service to read characters from the console is the ___________
system read (SYS_read).
- These characters are read from 1.) ____________
- The 2.) ____________ is the default file descriptor for reading characters from the keyboard.
- standard input (STDIN).
- STDIN
The arguments for the read system service are as follows:
- rax -> Call code = SYS_read (0)
- rdi -> Input location, STDIN (0)
- rsi -> Address of where to store characters read
- rdx -> Number of characters to read