Input/Output Flashcards

(14 cards)

1
Q

How an application requests for the operating system to perform some specific operation.

A

Accessing system services

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The interface between an executing process and the operating system.

A

System call

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
  • 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.
A

System service call

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

True or False

When calling system services, arguments are placed in the standard argument registers.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
  • 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.
A

rax

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
  • 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.
A

call code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

If any are needed, the arguments for system services are placed in what registers?

A

rdi, rsi, rdx, r10, r8, and r9 registers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

After the call code and any arguments are set, the __________ instruction is executed.

A

syscall

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
  • 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.
A

syscall

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
  • The system service to output characters to the console is the 1.) __________
  • These characters are written to 2.) __________ which is the console.
A
  1. system write (SYS_write).
  2. standard out (STDOUT)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The arguments for the write system service are as follows:

A
  • rax -> Call code = SYS_write (1)
  • rdi -> Output location, STDOUT (1)
  • rsi -> Address of characters to output
  • rdx -> Number of characters to output
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

The system service to read characters from the console is the ___________

A

system read (SYS_read).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
  • These characters are read from 1.) ____________
  • The 2.) ____________ is the default file descriptor for reading characters from the keyboard.
A
  1. standard input (STDIN).
  2. STDIN
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

The arguments for the read system service are as follows:

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly