Input / Output Flashcards

1
Q

How does a program running in EL0 do I/O?

A

It makes a system call, generating an exception by using the svc instruction, with the request value in x8

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

(T/F) All peripheral devices are represented as file

A

True

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

What are the service requests and their corresponding values?

A

openat - 56
close - 57
read - 63
write - 64

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

Where is the return value of a system call stored?

A

In x0

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

What is the C function to open a file?

A

openat(int dirfd, const char *pathname, int flags, mode_t mode);

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

What is the C function to read from a file?

A

read(int fd, void *buf, unsigned long n);

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

What is the C function to write to a file?

A

write(int fd, void* buf, unsigned long n);

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

How is the buffer base calcultated?

A

add buf_base, x29, buf_s

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

What is the value of AT_FDCWD?

A

-100

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