Skip to content

Commit 5e8962a

Browse files
committed
io/file-descriptors: Add testing suggestion for each task.
Suggested students to test manually each task before using 'tests/checher.sh', for a better understanding of the concept. Added `lab9.md` that instructs students to download the arhive or use GitHub. Changed config.yaml to add `lab9.md` to the archive. Signed-off-by: Matei Stanuca <[email protected]>
1 parent a334efc commit 5e8962a

File tree

6 files changed

+20
-0
lines changed

6 files changed

+20
-0
lines changed

chapters/io/file-descriptors/drills/tasks/buffering/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ We'll checkout how effective buffering is in `libc` and then we'll do it ourselv
2121
Wrote 1048576 bytes to test-file.txt in 38 ms
2222
```
2323

24+
If possible, try to manually test your implementation.
25+
Use `./checker.sh` only when you are sure of your result.
26+
2427
Buffering achieves dramatic performance gains, reducing read times by **98%** and write times by **99.8%** in this example!
2528
This demonstrates the power of buffering, even though it’s an extreme case.
2629

chapters/io/file-descriptors/drills/tasks/mmap_cp/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ make: Nothing to be done for 'all'.
1616
Test PASSED (File copies are identical)
1717
```
1818

19+
To test your implementation, navigate to the `mmap_cp/support/src` folder.
20+
Run `make` to compile the code and test it manually with files generated by you.
21+
22+
When you think your code is correct, go to `mmap_cp/support/test` and run `checker.sh` to validate your solution.
23+
1924
1. Open `mmap_cp.c` and complete the TODOs to map the files in memory and copy the contents.
2025
Do not forget to clean up by unmapping and closing the files.
2126

chapters/io/file-descriptors/drills/tasks/my-cat/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ Good job!
1818
----------------------------------------
1919
```
2020

21+
To test your implementation, navigate to the `mmap_cp/support/src` folder.
22+
Run `make` to compile the code and test it manually with files generated by you.
23+
24+
When you think your code is correct, go to `mmap_cp/support/test` and run `checker.sh` to validate your solution.
25+
2126
1. Implement `rread()` wrapper over `read()`.
2227

2328
`read()` system call does not guarantee that it will read the requested number of bytes in a single call.

chapters/io/ipc/drills/tasks/anon-pipes/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ Test for short string ........... PASSED
1515
Test for long string ........... PASSED
1616
```
1717

18+
To test your implementation, navigate to the `mmap_cp/support/src` folder.
19+
Run `make` to compile the code and test it manually with files generated by you.
20+
21+
When you think your code is correct, go to `mmap_cp/support/test` and run `checker.sh` to validate your solution.
22+
1823
1. Use the [`pipe()` syscall](https://man7.org/linux/man-pages/man7/pipe.7.html) to create the pipe.
1924
Remember, the first file descriptor (`fds[0]`) is the read end, and the second (`fds[1]`) is the write end, similar to how `stdin` and `stdout` are represented by file descriptors `0` and `1`.
2025

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The contents of the lab are located in the [lab archive](https://github.com/cs-pub-ro/operating-systems/raw/refs/heads/lab-archives/Lab_9_File_Descriptors.zip) and in the [GitHub repository](https://github.com/cs-pub-ro/operating-systems).

config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ lab_structure:
126126
- title: Lab 9 - File Descriptors
127127
filename: lab9.md
128128
content:
129+
- reading/lab9.md
129130
- tasks/my-cat.md
130131
- tasks/mmap_cp.md
131132
- tasks/anon-pipes.md

0 commit comments

Comments
 (0)