Activities
These are the activities of the unit. Do them in order, after you read the matching notes. Activities 1, 3 and 4 use the Process & CPU Scheduler Lab.
Hand in every activity in Aules, in the matching task, as a document (PDF, ODT or DOCX) with your name. You do not need to copy the questions: number your answers. Write in English if you can. Do not include personal data (passwords, private photos) in your screenshots.
For activities 1, 6 and 7 you need an Ubuntu virtual machine (the one from Unit 2 is fine). Never practise partitioning or formatting on your real disk.
Activity 1 · Processes in Linux
Sección titulada «Activity 1 · Processes in Linux»Objective: observe the processes of a Linux system, change their state and read their information.
What you have to do:
- Open the tab Terminal of the lab and complete the six missions of the list. Then repeat the main steps in your Ubuntu virtual machine.
- In a terminal run
ps aux | head -15. Write thePID,USERandSTATof five processes. Runecho $$to find the PID of your shell and find it in the list. - Run
sleep 300 &. Withjobsandps -o pid,ppid,stat,cmd -p <PID>write its PID, its parent and its state. Stop it withkill -STOP <PID>, check the state again, continue it withkill -CONT <PID>and end it withkill <PID>. Copy each command and theSTATletter that you saw. - Run
yes > /dev/null &. Opentop(orhtop) and find it: what%CPUdoes it use? Change its priority withrenice -n 19 -p <PID>and describe what changes. End it withkill. - Create a zombie with the command of the notes (
bash -c 'sleep 2 & exec sleep 300' &). Show withpsthat there is a process in stateZ. Trykill -9on the zombie and explain what happens. Then remove it and explain how. - Run
systemctl status cron(or another service of your system). Say if it is active, since when, and what its PID is. Is it a user process or a system process? Is it a service? - Fill in a table of at least six processes with columns: PID, PPID, user, state, type (user, system or service) and what it does.
What you hand in: a document with the commands, the relevant output (text or screenshots) and your explanations. Task “Activity 1” in Aules.
Criteria that it works on: RA1.c, RA2.a, RA4.c
Difficulty: ★★☆ · Estimated time: 75 minutes
Activity 2 · Processes and services in Windows
Sección titulada «Activity 2 · Processes and services in Windows»Objective: do in Windows the same observations as in Linux and compare both systems.
What you have to do:
- Open Task Manager (
Ctrl + Shift + Esc). In the Details tab, add the columns PID, Status, User name and Priority (right click on a column header → Select columns). - Open Notepad and find
notepad.exe: write its PID, user and memory. Close it with End task and check that it disappears. - Find three processes that run with the user name
SYSTEM,LOCAL SERVICEorNETWORK SERVICEand three that run with your user name. Write what each of them does (look it up in the official documentation if you need to). - Open PowerShell and run
while ($true) {}. This uses one CPU core. Find thepowershell.exeprocess that uses most CPU, change its priority to Below normal and describe what you see. Close the window to stop it. - Open
services.msc. For three services (for example Print Spooler, Windows Time and Windows Update) write the status, the startup type and the account used to log on. Do not change anything. - Answer: what is the difference between Automatic, Manual and Disabled? Why does Windows have a
svchost.exeprocess for several services? - Make a comparison table with five rows: how to list processes, how to end one, how to change its priority, how to list services and how to start or stop a service. One column for Linux and one for Windows.
What you hand in: the document with screenshots and the comparison table. Task “Activity 2” in Aules.
Criteria that it works on: RA1.c, RA2.a, RA4.c
Difficulty: ★☆☆ · Estimated time: 60 minutes
Activity 3 · Scheduling by hand
Sección titulada «Activity 3 · Scheduling by hand»Objective: calculate scheduling results with a Gantt chart and check them with the simulator.
What you have to do:
-
Load A. Use FIFO, SJF and SRTF. Draw a Gantt chart for each one and calculate the completion, response and waiting time of every process and the averages.
Process Arrival Burst P1 0 7 P2 2 4 P3 3 1 P4 5 3 -
Load B. Use priorities (non-preemptive), priorities (preemptive) and Round Robin with q = 3. A lower number is a higher priority. Same work as in the first part.
Process Arrival Burst Priority P1 0 5 3 P2 1 3 1 P3 2 6 4 P4 4 2 2 -
Enter both loads in the tab Scheduler simulator and compare its results with yours. If there is a difference, find your mistake and correct it.
-
Which algorithm gives the best average waiting time in each load? Which one is the least fair, that is, makes a process wait for longest? Explain in two or three sentences.
-
Do three exercises of the tab Practice and write the number of correct answers.
What you hand in: the six Gantt charts (a photo of your handwriting is accepted) with the tables and your answers to 4 and 5. Task “Activity 3” in Aules.
Criteria that it works on: RA1.c, RA2.a
Difficulty: ★★★ · Estimated time: 90 minutes
Activity 4 · Quantum and starvation
Sección titulada «Activity 4 · Quantum and starvation»Objective: investigate with the lab how the quantum and the choice of algorithm change the results.
What you have to do:
- In the tab Algorithm shoot-out, use the preset Five processes (or enter this load: P1 0/8/3, P2 1/4/2, P3 2/9/4, P4 3/5/1, P5 6/2/2, where each triple is arrival/burst/priority). Write a table with the average waiting time, the average response time and the context switches of the six algorithms, with Round Robin at q = 3.
- Move the quantum slider from 1 to 8. Copy the results for q = 1, 2, 4 and 8 and draw a conclusion: what happens to the context switches? What happens to the response time? What does the algorithm look like when q is very big?
- Choose a quantum that you think is a good compromise and justify it.
- In the Starvation part, put 3, 6 and 8 short processes. Write the waiting time of the long process without aging and with aging. Explain the numbers.
- A desktop computer has a window manager, a video player and a backup program. Which algorithm would you use and why? Mention at least one problem of your choice and how to reduce it.
What you hand in: the tables, the conclusions and your answers. Task “Activity 4” in Aules.
Criteria that it works on: RA2.a, RA4.c
Difficulty: ★★☆ · Estimated time: 60 minutes
Activity 5 · Memory: calculate, observe and optimise
Sección titulada «Activity 5 · Memory: calculate, observe and optimise»Objective: do the memory calculations of the unit and check the memory of a real computer.
What you have to do:
- Fragmentation. A system has fixed partitions of 128 KiB. Processes of 100, 30, 128 and 65 KiB are loaded. How much memory is wasted in each partition? What kind of fragmentation is it?
- Paging. The page size is 1 KiB (1024 bytes). The page table of a process is: page 0 → frame 4, 1 → 9, 2 → 1, 3 → 7, 4 → 3, 5 → 0. Calculate page, offset and physical address for the logical addresses 2600, 5300, 1030 and 7000. One of them causes a problem: which one and why?
- Segmentation. A process has these segments (base, limit): S0 (3000, 2200), S1 (8000, 600), S2 (12000, 1500). Translate (0, 1500), (1, 600), (2, 1499) and (1, 599), or say that the access is not valid.
- Page replacement. With the reference string
7 1 4 1 7 3 4 3 1 7 5 7 4 1, count the page faults with FIFO and LRU, first with 3 frames and then with 4 frames. Show the frames after every reference. What do you observe when you compare LRU with FIFO in the case of 3 frames? - Observe. On your own computer (or in a virtual machine), find: total RAM, available RAM and swap (or page file) in use. In Linux use
free -handswapon --show; in Windows, Task Manager → Performance → Memory. Find the three processes that use most memory. - Optimise. Propose three realistic actions to reduce the memory use of that computer. For each one say what you would measure before and after. If you can, try one and report the difference.
What you hand in: the calculations (show the steps), the table of data and the three proposals. Task “Activity 5” in Aules.
Criteria that it works on: RA2.a, RA4.e
Difficulty: ★★★ · Estimated time: 100 minutes
Activity 6 · Partitions, file systems and an installation plan
Sección titulada «Activity 6 · Partitions, file systems and an installation plan»Objective: partition a virtual disk, compare three file systems and write an installation plan.
What you have to do:
- In VirtualBox, add a new virtual disk of 2 GiB to your Ubuntu virtual machine (the machine must be switched off). Start it and open GParted (install it with
sudo apt install gpartedif needed). - Select the new disk (check its name with
lsblk!). Create a partition table of type msdos (MBR). Create three primary partitions: 300 MiB FAT32 (labelFAT), 700 MiB NTFS (labelNTFS) and 600 MiB ext4 (labelEXT). Apply the changes. - Answer the following questions with GParted or the terminal: Can you create a fourth primary partition in the free space? And a fifth one? How? Can you make the NTFS partition bigger? What happens to the data if you shrink a partition?
- Mount the three partitions (click on them in the file manager). In each one create files named
Data.txtanddata.txt, then runchmod 600 Data.txtandls -l. Fill in a table: does the file system distinguish capital letters? Does it keep the permissions? Show the output. - Run
df -handlsblk -fand add the output to your report. Say the size of each file system and how much of it is already used. - Delete the three partitions, convert the disk to GPT (Device → Create Partition Table → gpt) and create five primary partitions. What changes? Write a table with five differences between MBR and GPT.
- Write a table that compares FAT32, NTFS and ext4: maximum file size, permissions, journaling, case-sensitivity and typical use. Mark which ones you proved yourself in step 4.
- Installation plan. A school wants Ubuntu Desktop on a computer with 8 GiB of RAM, an 80 GiB SSD and UEFI. Write a plan with the points of the table in section 7 of page 4: hardware check, partition table, partitions with size, file system and mount point, users, backup and checks.
- Say in one paragraph when you would choose a journaling file system and what would happen after a power cut in each of the three file systems.
What you hand in: screenshots of GParted before and after, the outputs, the tables and the plan. Task “Activity 6” in Aules.
Criteria that it works on: RA1.d, RA1.e, RA1.g, RA2.e, RA4.g
Difficulty: ★★★ · Estimated time: 120 minutes
Activity 7 · Permissions and shared resources
Sección titulada «Activity 7 · Permissions and shared resources»Objective: read and change permissions in Linux and Windows and configure a simple share.
What you have to do:
- In your Linux virtual machine create a folder
projectwith a filenotes.txtand a scriptrun.sh(with the textecho hello). Runls -land explain every field of the three lines (type, permissions, owner, group). - Write the
chmodcommands (in octal) to obtain each case and test them: (a)notes.txtreadable and writable by the owner, readable by the group and no access for others; (b)run.shexecutable by everybody and writable only by the owner; (c) the folderprojectaccessible only by its owner. Try to run./run.shbefore and after you add thexpermission. - Create a second user (
sudo adduser guest1). Test withsudo -u guest1 cat project/notes.txtin cases (a) and (c). Explain the results with the permissions of the file and of the directory. - Explain what happens when a directory has
r--but notx, and when it has--xbut notr. - In Windows (or a Windows virtual machine) create a folder
Sharedon an NTFS disk with a file inside. In the Security tab give the groupUsersonly Read. Then add a Deny for Write to a test user. What is the effective permission of that user? Why? - Share the folder: Properties → Sharing → Advanced Sharing, with a share permission of Read for one user. From another computer (or the same one) open
\\COMPUTERNAME\Shared. Try to create a file. Which permissions are being applied, the share one or the NTFS one? Which wins? - Write five good practices for sharing resources in a network and one risk that each one avoids.
- Look at the permissions of
/etc/passwd,/etc/shadowand/tmp(ls -ld). Why do you think they are different?
What you hand in: a document with the commands, outputs and screenshots and your answers. Task “Activity 7” in Aules.
Criteria that it works on: RA1.e, RA1.f, RA4.h
Difficulty: ★★☆ · Estimated time: 90 minutes
Esta web no usa cookies ni recoge datos personales. Tu navegador solo guarda, en tu propio equipo, algunas preferencias: el tema claro u oscuro, el estado del menú y, en los laboratorios, la última pestaña abierta y el tamaño de letra.