Kmesg:
Modify cprintf function to save everything that kernel writes in internal buffer.
From kmesg file we can read the context of that buffer.
File needs to behave correctly while read is called multiple times.
And if more text is written than the buffer size, old context should not be overwritten.
Random:
Every time user press a key on a keyboard, scan code of that key and time when its pressed should somehow impact on next random number.
There is global variable "ticks" that can be used for time.
Reading from this file is filling buffer with random bytes and mutate so the next reading can give different value.
Writing into this file mutates buffer with value of written bytes and time when the writing happened.
Disk:
Reading and writing on this file directly operates with blocks on the disk avoiding file system.
System call lseek(int fd, int offset, int whence):
read() and write() on open files can add to intern offset of the file structure for that specified file, and in that process number of bytes which are successfully redden/written.
Whence can be:
SEEK_SET (file offset is set on absolute value of offset argument),
SEEK_CUR (file offset is summed with offset argument, negative value leads to going backwards) or
SEEK_END (file offset is set on sum of file size and offset argument).
System call write() should be changed to in case that file offset is set on value that is larger than real file length, space between old file context and where new data should be is filled with zeros.
User program dd:
if-input file (default is standard input)
of-output file (default is standard input)
bs-block size (default is 512)
count-number of blocks (default is till the end of input file)
skip-how many blocks should be skipped in input file (default is 0)
seek-how many blocks should be skipped in output file (default is 0)
Examples:
Copy README into readme2
Copy 512B from README after 1KB
Generate random file that is 128 bytes
Generate file with 56 zeros and 8 random bytes
DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma
Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t
Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th
1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of
1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of