Information Technology > EXAM > CS252 Homework 1 Solution (All)

CS252 Homework 1 Solution

Document Content and Description Below

Part 1. True False Questions Answer True/False (T/F) __T__ The loader is also called “Runtime Linker” __T__ COFF is a format for executable files __F__ The command "chmod 440 file" makes a fil... e readable and writable by user, group, and others. (RW not for others). __F__ strace is a UNIX command that shows the tree of processes in the system. __F__ All processes have a parent process. (initial process does not have parent process) Part 2. Short questions. 2. Enumerate and describe the memory sections of a program. Text- Instructions that the program runs Data – Initialized global variables. Bss – Uninitialized global variables. They are initialized to zeroes. Heap – Memory returned when calling malloc/new. It grows upwards. Stack – It stores local variables and return addresses. It grows downwards. 3. Enumerate and describe the contents of an inode ● Flag/Mode - Read, Write, Execute (for Owner/Group/All) RWX RWX RWX Also tells if a file is directory, device, symbolic link ● Owners - Userid, Groupid ● Time Stamps - Creation time, Access Time, Modification Time. ● Size - Size of file in bytes ● Ref. Count – Reference count with the number of times the i-node appears in a directory (hard links). It Increases every time file is added to a directory. The file the i-node represents will be removed when the reference count reaches 0. ● Direct block – Points directly to the block. There are 12 of them in the structure ● Single indirect – Points to a block table that has 256 entry's. There are 3 of them. ● Double indirect – Points to a page table of 256 entries which then points to another page table of 256● Triple Indirect - Points to a page table of 256 entries which then points to another page table of 256 that points to another page of 256 bytes. 4. Enumerate the 5 Memory Allocation Errors and describe them. ● Memory Leaks - Memory leaks are objects in memory that are no longer in use by the program but that are not freed. ● Premature Free - A premature free is caused when an object that is still in use by the program is freed. ● Double Free- It is caused by freeing an object that is already free. ● Wild Frees - Wild frees happen when a program attempts to free a pointer in memory that was not returned by malloc. ● Memory Smashing - Memory Smashing happens when less memory is allocated than the memory that will be used. 5. List and explain the attributes of an Open File Object. An Open File Object contains the state of an open file: ● I-Node – It uniquely identifies a file in the computer. An I-nodes is made of two parts: ● Major number – Determines the devices ● Minor number –It determines what file it refers to inside the device. ● Open Mode – How the file was opened: Read Only, Read Write, Append ● Offset – The next read or write operation will start at this offset in the file. Each read/write operation increases the offset by the number of bytes read/written. ● Reference Count – It is increased by the number of file descriptors that point to this Open File Object. When file is closed, the reference count is decremented. When the reference count reaches 0 the Open File Object is removed. The reference count is initially 1 and it is increased after fork() or calls like dup and dup2. [Show More]

Last updated: 1 year ago

Preview 1 out of 13 pages

Reviews( 0 )

$7.00

Add to cart

Instant download

Can't find what you want? Try our AI powered Search

OR

GET ASSIGNMENT HELP
39
0

Document information


Connected school, study & course


About the document


Uploaded On

Aug 04, 2022

Number of pages

13

Written in

Seller


seller-icon
CourseWorks,Inc

Member since 1 year

8 Documents Sold


Additional information

This document has been written for:

Uploaded

Aug 04, 2022

Downloads

 0

Views

 39

Document Keyword Tags

More From CourseWorks,Inc

View all CourseWorks,Inc's documents »

Recommended For You

What is Browsegrades

In Browsegrades, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Browsegrades · High quality services·