Table of Contents

Return to Operationg Systems home


Operating Systems Course: Lab01

Laboratory number 01

Exercise 01: Management of files and directories

Part 01

Produce the following tree of directories in your home directory:

               osEx01
                  |
      ------------------------
      |           |          |
     src         bin       test
      |                      |
   ----------            -----------
   |        |            |         |
  include  lib         script   results

Part 02

Part 03

Executing all the commands from the root of your user (i.e., /home/username), do the following:

Part 04

Check what they do and for what the following commands are used:

For any problem, remember that you can use the following command to obtain an online help manual for a specific command:

Exercise 02: Permissions management

Verify and reply to the following questions:

How is it possible to modify in the same way the access rights to all the files and directories of a directory tree (for example, to eliminate the read right to all, user, group, and other of the directory osEx01backup)?

Observation:
The command
touch <nomefile>
allows to update date and time of the last modification performed on a file.
In the case the specified file does not exist, it creates an empty file with that name.

Exercise 04: C programs and compilation

Perform the following tasks using:

Part 01

Write a C language program that, using the ANSI C I/O primitives (fgetc/fputc, fscanf/fprint,fget/fputs of your choice), is able to copy a text file to an identical file.
The name of the two files is received on the command line, so that the program can be executed using a command that specifies three parameters:
nameExcutable sourceFile destinationFile

Part 02

Compile the source files using gcc

Part 03

How does the written program behave if you try to copy a binary file?

Part 04

Change the program using

Exercise 05: Compilation and makefile

Take as reference the example analyzed in classroom: Makefile4