Ireland Assignments .ieIRELAND.ieASSIGNMENTS
Order Now Log In
  • Home
  • Services
    Writing Services
    • Essay Writing Services
    • Dissertation Writing
    • Thesis Writing Service
    • Literature Review Writing
    • Research Paper For Sale
    • Report Writing Assistance
    • Do My Assignment
    • Write My Essay
    • Buy Assignments Online
    • Irish Homework Help
    AI Support & Referencing
    • Assignment Review Service
    • AI-Free Assignment Help
    • Remove AI From Your Assignment
    • Citation and Referencing Help
    • AI Guidance for Students
    Assignment Type
    • Learner Record Writing
    • Skill Demonstration Assignments
    • Work Experience Diary
    • Reflection Journal
    • Online Exam Help
    • QQI Level 5
    • QQI Level 6
    Course
    • Nursing
    • Childcare
    • Healthcare
    • SNA (Special Needs)
    • Care of Older People
    • Child Development
    • Care Skills
    • Care Support
    • Disability Awareness
    • Infection Prevention
    • Health & Safety at Work
    Online Degree Course
    • Psychology Assignments
    • Early Childhood QQI Assignments
    • Montessori Assignments
    • Palliative Course Assignments
    • Communications FETAC Level 5 Assignments
    • Law Course Assignments
    • Management Assignments
    • Train the Trainer
    • Healthcare Assistance
    • Digital Marketing Assignment
    • QQI Assignments
    Cities
    • Dublin
    • Galway
    • Cork
    • Limerick
    • Waterford
    • Sligo
    • Dundalk
    • Carlow
    • Maynooth
  • Samples
  • Experts
  • Questions
  • Blog
  • Reviews 4.9/5
Order Now Log In
Search from Thousands of
Ireland Assignments Answers
  • 463+ Experts
  • A+ Grade
  • Free Turnitin Report
  1. Home
  2. Questions
  3. Using Promela to Model Non-Deterministic Finite-State-Automatons: Concurrent Systems and Operating Systems Assignment, TCD

Using Promela to Model Non-Deterministic Finite-State-Automatons: Concurrent Systems and Operating Systems Assignment, TCD

University Trinity College Dublin (TCD)

Part 1

Using Promela to model non-deterministic finite-state-automatons was described in Lecture 16. In the archive, you will find the image for an example (EXAMPLE-NDFA.png) along with a PML file (ndfa4.pml) that implements that example. This has added print statements that make its behavior easier to observe. It has been set up to allow SPIN to search for all possible accepting sequences of exactly length 4.

To do this search you need to do the following step: spin -run -E -c0 -e ndfa4.pml

This will generate a number of trail files, of which the nth can be viewed using spin -tn ndfa4.pml. So, for example, the 3rd trail file can be viewed using spin -t3 ndfa4.pml.

Task-1

Create a pml file called final.pml, that models the NDFA shown in FINAL-NDFA.png, and that also can search for accepting sequences of length less than or equal to 4.

Base your answer on ndfa4.pml, leaving lines 1..4 and 38..42 intact.

For submission for Part-1 : final.pml

Part 2

Practical 4 involved adding process priorities to a simulation of xv6. Here you are asked to extend this to the dynamic priority used in Linux, as described in Lecture 23.

The simulation has changed (from Practical 4) as follows

  • A global clock variable has been added (defs.h) and is used to track the time taken by processes in swtch().
  • The process state has a number of new components (see struct proc declaration in file proc.h).
  • The scheduler, in proc.c, does a regular pass over the processes to adjust their priorities, calling adjustpriority(p) for every process p.

Stuck in Completing this Assignment and feeling stressed ? Take our Private Writing Services

Get A Free Quote

Task-2

You need to edit adjustpriority() in proc.c to implement the priority (dynprio) and base time quantum (quantum) calculations described in Lecture 23, Slides 14..17 and 19 (ignore slide 18 for this exercise).

This may also require modifying the definition of struct proc in proc.h by adding in extra fields to keep track of useful dynamic information. In particular this may help with the calculation of average sleeping time (avgsleep). Any extra fields added to struct proc need to be initialised by function initproc(), also in proc.c. Note that this has required small modifications to defs.h and main.c.

You should never modify the staticprio or lastrun components.

The current sleeping time for a process is the current time minus the last time that process was running, determined whenever adjustpriority is applied to that process. The average sleeping time for a process is taken as the average of all the sleeping times that are determined in this way. You will need to come up with a way to store historical information for the process to be able to compute the average.

For submission for Part-2 : proc.h proc.c

Part 3

The xv6 filesystem uses one level of indirection at most when looking up file block locations (see Fig 6-3 on p84 in the xv6 “book”). The Linux filesystem uses up to three levels of indirection (See slide 25 in Lecture 28). You are to provide xv6 with the ability to use three levels as well.

Both xv6 and Linux have 12 direct addresses and use the 13th slot to point to an indirection table with 128 pointers.

Task-3

You need to edit bmap() in file fs.c to add the extra levels of indirection. Look at the existing code carefully. In the original xv6 (and Linux), the disk block size and the size of each block containing indirection pointers is the same, and both can be found on disk and in memory, so one allocation call is used to get storage for them (balloc()).

In this simulator, we have shrunk things a bit so there are only 3 direct addresses, instead of 12, and each indirection table has only 4 entries, rather than 128. This means we cannot allocate such tables using balloc() as the size is different. Instead a new allocate function called indalloc() is used instead. A short guide to compiling/running the simulator is given below

For submission for Part-3 : fs.c x

Compiling and running xv6

For the first time, and every time after modifying proc.h, do make clean and then make, from the command line.

At other times just make is enough

If you can’t use make (e.g. on Windows), then do:

cc -c -o ide.o ide.c
cc -c -o console.o console.c
cc -c -o bio.o bio.c
cc -c -o fs.o fs.c
cc -c -o file.o file.c
cc -c -o swtch.o swtch.c
cc -c -o proc.o proc.c
cc -c -o main.o main.c
cc -o sim ide.o console.o bio.o fs.o file.o swtch.o proc.o main.o

To run, just do ./sim < file.dat

All scenarios are now in .dat files

  • near120.dat – a scenario with process static priorities in the range 118..121
  • frw.dat – scenario reading and writing files
  • fpanic.dat – a scenario that fails with panic because the file is too large. Will work fine when Task 3 is done.
Shared with
Ireland Assignments Editorial Team

A student shared this brief with our team; personal details have been removed. Our editorial team works on tasks like this and can guide you on how to approach it.

Get Help By Expert

Get Concurrent Systems and  Operating Systems assignment help from irelandassignments.ie at a pocket-friendly price. Our expert dissertation writers help to solve your assignment questions at the given time slot. So if you want to score top grades at TCD College in computer science assignments then hire our professionals.

Submit Your Assignment Questions & Get Plagiarism Free Answers.

Buy Now
Get the Answer to This Question

Tell us about your assignment in 3 quick steps and get a free, no-obligation quote.

1 Basics 2 Details 3 Contact
The basics
Over 10,000 words? Choose 10,000+ and type your exact count.
Step 1 of 3 · takes under a minute
About your assignment
What help do you need?
Do you have the brief or marking rubric?
Step 2 of 3 · last step is your contact details
Where should we send your quote?
Attach your brief, rubric or notes (optional, up to 10 files)
PDF, Word, PowerPoint, Excel or images · up to 100MB in total
Uploading…
Free quote No payment to submit 100% confidential

To Get Answer
Please Fill the following Details

If you think the question is incomplete, then you can upload your assignment brief.

Facing Issues with Assignments? Talk to Our Experts Now!Download Our App Now!

Request a Call Back
Irish assignment expert ready to help a student

Have Questions About Our Services?
Download Our App!

Get the App Today!

iphone android
QRcode
Ireland Assignments .ieIRELAND.ieASSIGNMENTS

Ireland Assignments

Ireland Assignment's offers plagiarism free assistance to the students around the globe. We understand the value of top grades to a student. And that is the reason we are here to assist you with ultimate professionalism. By availing our services we assure you better grades. Raise your academic grades with our Ireland assignment help.

Useful Links

Useful Links

Useful Links
  • Home
  • Services
  • Samples
  • Blog
  • User Reviews
  • Questions
  • Experts
  • Submit Questions
Legal & Policies

Legal & Policies

Legal & Policies
  • Privacy Policy
  • Warranty
  • Copyright Notice
  • Terms & Conditions
  • About Us
  • Contact Us
  • How Ordering Works
  • FAQs
  • University Assignment Help
  • Final Year Project Help
  • Semester Assignment Help
  • Social Care Project Help
  • Care of the Surgical Patient
Cities

Cities

Cities
  • Dublin
  • Galway
  • Cork
  • Limerick
  • Waterford
  • Sligo
  • Dundalk
  • Carlow
  • Maynooth
GDPR
info@irelandassignments.ie
Secure Payment

77 Camden Street Lower, Dublin, D2 XE80, Ireland

Student Login·Facebook

Disclaimer: Ireland Assignments connects students with subject experts for academic guidance, model answers and study resources such as journals, articles and e-books. We do not offer ghostwriting, as it is academic misconduct. We are not sponsored or endorsed by Quality and Qualifications Ireland (QQI) or any college or university. All trademarks, logos and institution names belong to their owners and are used for identification only.

Ireland Assignments rated 4.9/5 based on 15,000+ student reviews on WhatsApp

Copyright © 2026 Ireland Assignments, All Right Reserved