logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Ashraf AliComputer science
(5/5)

553 Answers

Hire Me
expert
Satyender ReddyAccounting
(5/5)

872 Answers

Hire Me
expert
Rory BremnerComputer science
(5/5)

721 Answers

Hire Me
expert
Ashton HamiltonEnglish
(5/5)

626 Answers

Hire Me
Computer Science

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.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

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:

  1. dd if=/home/README of=/home/readme2

Copy README into readme2

  1. dd if=/home/README of=home/snippet skip=2 count=1

Copy 512B from README after 1KB

  1. dd if=/dev/random of=/home/keyfile bs=64 count=2

Generate random file that is 128 bytes

  1. dd if=/dev/random of=/test bs=8 count=1 seek=7

Generate file with 56 zeros and 8 random bytes

  1. dd if=/dev/random count=1

 

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme