-
Home
- Operating systems
- Projects
- Project 5: multi-programming,
Operation Systems
One-month project
Nachos is currently an uni-programming environment. In
the second project you will design and implement appropriate support formultiprogramming. You will extend the system calls to handle process management
and inter-process communication primitives. In addition you will implement apriority based scheduling and aging mechanism in nachos. You will add this to
the coded first project. Make sure you correct all the deficiencies in yourfirst project before starting the second project.
Phase 1 –memory allocation for multiprogramming: (15%)
Required Reading –
-
Translate.h / .cc – Each object of this class
is a translation of a single virtual page to a physical page.
-
Addrspace.h / .cc – Consists of all data
needed to keep track of executing user programs. The constructor allocatesmemory/pages to processes assuming every virtual address is the same as its
physical address. This restricts us to running one user program at a time. Inthis project we modify the constructor to allow multiple user programs to be run
concurrently.
-
Progtest.cc – The StartProcess function
serves as the starting point of every thread, where the addrspace is created andexecution of the userprogram begins. You might have to create a similar function
to account for new threads that you create.
-
System.h / .cc – All global/system objects
are defined here.
-
Machine.h / .cc - emulates the part of the
machine that executes user programs: main memory, processor registers, etc.
To implement multiprogramming we will have to alter
Nachos so that each process is maintained in its own system thread. We will haveto take care of memory allocation and de-allocation. Here are the
details:
- Add a case in exception handler so that non-system call exceptions
can finish (currentThread>Finish()) the thread. This will be important, as a
run time exception should not cause the operating system to shut down.
- Implement multiprogramming. The code we have given you is
restricted to running one user program at a time. You will need to make somechanges to addrspace.h, and addrspace.cc in order to convert the system from
uniprogramming to multiprogramming. You will need to:
- Come up with a way of allocating physical memory frames so that
multiple programs can be loaded into memory at once.
- Provide a way of copying data to/from the kernel from/to the
user’s virtual address space.
- Properly handling freeing address space when a user program
finishes.
- It is very important to alter the user program loader algorithm
such that it handles memory in terms of pages. Currently, memory spaceallocation assumes that a process is loaded into a contiguous section of memory.
Once multiprogramming is active, memory will no longer appear contiguous innature. If you do not correct the routine, it is most likely that loading
another user program will corrupt the operating system.
Phase 2 –process management: (35%)
- Implement the
SpaceID Exec(char *name, int priority) system call. Exec starts a new user program running within a new
system thread with the given priority. You will need to examine the“StartProcess” function in progtest.cc in order to figure out how to set up user
space inside a system thread. Exec should return –1 on failure, else it shouldreturn the “Process SpaceID” of the user level program it just created. (Note:
SpaceIDs can be kept track of in a similar manner to OpenFileIDs of your project1, except that you will want to keep track of them outside the thread.). For
this phase you can simply ignore the priority.
- Implement the
int Join(SpaceID id) and void Exit(int
exitCode) system calls. Join will wait and block on a “Process
SpaceID” as noted in its parameter. Exit returns an exit code to whomever isdoing a join. The exit code is 0 if a program successfully completes, another
value if there is an error. The exit code parameter is set via the
exitcode parameter. Join returns the exit code for the
process it is blocking on, -1 if the join fails. A user program can only join toprocesses that are directly created by
the Exec system
call . You can not join to other processes or to yourself. You will
have to use semaphores inside your system calls to coordinate Joining andExiting user processes. Also make sure that all processes release the resources
they have been allocated, after they Exit.
Questions & Answers
what does preconceived mean
How can I develope my cognitive domain
why is communication effective
Communication is effective because it allows individuals to share ideas, thoughts, and information with others.
effective communication can lead to improved outcomes in various settings, including personal relationships, business environments, and educational settings. By communicating effectively, individuals can negotiate effectively, solve problems collaboratively, and work towards common goals.
it starts up serve and return practice/assessments.it helps find voice talking therapy also assessments through relaxed conversation.
miss
Every time someone flushes a toilet in the apartment building, the person begins to jumb back automatically after hearing the flush, before the water temperature changes. Identify the types of learning, if it is classical conditioning identify the NS, UCS, CS and CR. If it is operant conditioning, identify the type of consequence positive reinforcement, negative reinforcement or punishment
please i need answer
Wekolamo
because it helps many people around the world to understand how to interact with other people and understand them well, for example at work (job).
Agreed 👍 There are many parts of our brains and behaviors, we really need to get to know. Blessings for everyone and happy Sunday!
ARC
A child is a member of community not society elucidate ?
Isn't practices worldwide, be it psychology, be it science. isn't much just a false belief of control over something the mind cannot truly comprehend?
compare and contrast skinner's perspective on personality development on freud
Skinner skipped the whole unconscious phenomenon and rather emphasized on classical conditioning
war
explain how nature and nurture affect the development and later the productivity of an individual.
nature is an hereditary factor while nurture is an environmental factor which constitute an individual personality. so if an individual's parent has a deviant behavior and was also brought up in an deviant environment, observation of the behavior and the inborn trait we make the individual deviant.
Samuel
I am taking this course because I am hoping that I could somehow learn more about my chosen field of interest and due to the fact that being a PsyD really ignites my passion as an individual the more I hope to learn about developing and literally explore the complexity of my critical thinking skills
and having a good philosophy of the world is like a sandwich and a peanut butter 👍
Jonathan
generally amnesi how long yrs memory loss
interpersonal relationships
What would be the best educational aid(s) for gifted kids/savants?
treat them normal, if they want help then give them.
that will make everyone happy
Saurabh
What are the treatment for autism?
hello. autism is a umbrella term. autistic kids have different disorder overlapping. for example. a kid may show symptoms of ADHD and also learning disabilities.
before treatment please make sure the kid doesn't have physical disabilities like hearing..vision..speech problem. sometimes these
Jharna
continue..
sometimes due to these physical problems..the diagnosis may be misdiagnosed.
treatment for autism.
well it depends on the severity.
since autistic kids have problems in communicating and adopting to the environment.. it's best to expose the child in situations where the child
Jharna
child interact with other kids under doc supervision.
play therapy.
speech therapy.
Engaging in different activities that activate most parts of the brain.. like drawing..painting. matching color board game.
string and beads game.
the more you interact with the child the more effective
Jharna
results you'll get..
please consult a therapist to know what suits best on your child.
and last as a parent. I know sometimes it's overwhelming to guide a special kid.
but trust the process and be strong and patient as a parent.
Jharna
Got questions? Join the online conversation and get instant answers!
Source:
OpenStax, Operating systems. OpenStax CNX. Aug 13, 2009 Download for free at http://cnx.org/content/col10785/1.2
Google Play and the Google Play logo are trademarks of Google Inc.