It's UWAweek 47

help2002

This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.
Displaying 181 tagged articles
Showing 181 of 828 articles.
Currently 95 other people reading this forum.


SVG not supported 11:48am Mon 18th Nov, ANONYMOUS

Has anyone's project been remarked? I emailed the professor on the 10th, and it seems that there are still no updates. I understand that there is a large amount of exams to mark, just worried if this will be looked at before the marks release on the 2...


 UWA week 45 (2nd semester, 2nd exam week) ↓
SVG not supported 10:30am Wed 6th Nov, ANONYMOUS

Same here, we got 2 10 and checked that our code passed all the test cases on help forum - and still waiting for reply from Amitava


SVG not supported 3:58pm Tue 5th Nov, ANONYMOUS

I m in a similar boat and would love some clarification on it )


SVG not supported 10:03am Tue 5th Nov, ANONYMOUS

Hi everyone, I m really frustrated with the grading of my recent project submission, where I received a 0 10. I just verified if my submission was proper with the appropriate names and student IDs mentioned in the code and despite the code passing m...


SVG not supported 9:51am Tue 5th Nov, ANONYMOUS

Even I have the same issue. We got a zero score.


SVG not supported 11:14pm Mon 4th Nov, Joshua N.

ANONYMOUS wrote Hi Anon, I would recommend sending an email to Amitava as soon as possible, it might have been a mistake, especially if your project met the requirements. It seems very odd to get 0, usually that's a grade reserved for submitting nothi...


SVG not supported 4:43pm Mon 4th Nov, ANONYMOUS

Hello everyone, I'm reaching out to seek advice and support regarding the recent grading of our Project 2. Our team received a zero score, which we find difficult to accept given the time, effort, and energy we invested. We carefully rechecked our cod...


 UWA week 43 (2nd semester, study break) ↓
SVG not supported 7:34pm Fri 25th Oct, Amitava D.

No, we haven't started marking the second project.


SVG not supported 9:09pm Thu 24th Oct, Joshua N.

look up " start()" for more info otherwise https en.cppreference.com w c program exit


SVG not supported 8:42pm Thu 24th Oct, ANONYMOUS

Does every process use the exit() system call to terminate?


SVG not supported 8:37pm Thu 24th Oct, Joshua N.

ANONYMOUS wrote I would personally say exit would apply better because technically you can just make a program that does nothing and so doesn't use I O but I O is still a good answer. I know how you feel, but according to research, it is linked to bet...


SVG not supported 8:28pm Thu 24th Oct, Joshua N.

I'm sorry Sean but as far as I know project 2 marking hasn't commenced yet. I doubt the marks will be out before the exam. Hopefully I am wrong.


SVG not supported 4:20pm Thu 24th Oct, Sean G.

Hi ) I was wondering if the results of project 2 will be released before the exam. If not, what is the average score so far for project 2? Thankyou


 UWA week 42 (2nd semester, week 12) ↓
SVG not supported 4:56pm Thu 17th Oct, Joshua N.

You can if you want but it is unnecessary.


SVG not supported 4:55pm Thu 17th Oct, Joshua N.

No.


SVG not supported 3:51pm Thu 17th Oct, ANONYMOUS

Sorry if this is answered, but do we need the trailing semicolon at the end of the ram content line? Thank you


SVG not supported 12:55pm Thu 17th Oct, Joshua N.

ANONYMOUS wrote Honestly it could be interpreted either way, but I don't think you need to increase the last accessed time if you are ignoring the entry since it would presumably take no time to ignore an entry (as opposed to loading an entry onto RA...


SVG not supported 12:50pm Thu 17th Oct, Joshua N.

One person submits for the team. Put both of your names and student numbers as comments at the top of the file.


SVG not supported 12:49pm Thu 17th Oct, Joshua N.

It is definitely possible to complete the project without creating virtual memory, but I believe Amitava intends you to create virtual memory (since it is in the specification), so it is probably best to create virtual memory.


SVG not supported 10:29am Thu 17th Oct, ANONYMOUS

Hi, in the project description it says that "time will increase by 1 for each entry in the file". So, do we need to increase last accessed time if we decide to ignore an entry that already exists in RAM? Thank you for your help


SVG not supported 2:31am Thu 17th Oct, ANONYMOUS

Is it mandatory to maintain a data structure for virtual memory as an array of size 32? Coz I developed all the way without having virtual memory in mind.


SVG not supported 10:34pm Wed 16th Oct, ANONYMOUS

Thank you


SVG not supported 8:09pm Wed 16th Oct, Joshua N.

One person submits. You put your names and student numbers at the top of the file.


SVG not supported 8:08pm Wed 16th Oct, Joshua N.

ANONYMOUS wrote No, it isn't. I don't think he intended for the example output to match the in.txt file.


SVG not supported 8:06pm Wed 16th Oct, Joshua N.

ANONYMOUS wrote My other post was incorrect. Don't increase the time stamp when you ignore a page.


SVG not supported 8:05pm Wed 16th Oct, Joshua N.

ANONYMOUS wrote You are right the time stamp shouldn't increase when you ignore a page I got mixed up with the reloading.


SVG not supported 8:03pm Wed 16th Oct, Joshua N.

ANONYMOUS wrote As Anon said this is incorrect. The page table is the slot in RAM the page occupies. A slot is of size 2. So, it should be 0, 1, 2, 3 4, 7, 99, 99 99, 99, 5, 99 99, 99, 6, 99


SVG not supported 7:56pm Wed 16th Oct, Joshua N.

As Anon said, either way is fine. It is not necessary to have a newline character at the end. np.


SVG not supported 7:54pm Wed 16th Oct, ANONYMOUS

You are getting confused with the location in the RAM array and the page frame in the RAM. Page tables print which page frame the process page is in, NOT the array index the page starts at. From the project description "We have a computer...


SVG not supported 7:54pm Wed 16th Oct, Joshua N.

Yes. The first argument will always be in.txt (file read from) and the second will be out.txt (file written to).


SVG not supported 7:49pm Wed 16th Oct, Joshua N.

Assumptions should appear as a comment at the top of your source file.


SVG not supported 7:35pm Wed 16th Oct, ANONYMOUS

It doesn't matter. As long as the point comes across, write it in your assumptions since most of these are just formatting. As long as it is clear what is what, you'll be fine


SVG not supported 7:33pm Wed 16th Oct, ANONYMOUS

Read your emails.


SVG not supported 4:41pm Wed 16th Oct, ANONYMOUS

sorry I was mistakenly looking at another tread and just thought to post new one cause i thought missed the question in first one


SVG not supported 4:37pm Wed 16th Oct, ANONYMOUS

I meant this sorry 0 2 4 6 8 14 99 99 99 99 10 99 99 99 12 99


SVG not supported 4:35pm Wed 16th Oct, ANONYMOUS

ANONYMOUS wrote shouldn't the page table here be 0 2 4 6 8 14 99 99 10 99 99 99 12 99 99 99 because of each page taking up to spaces in RAM, or am I being dumb?


SVG not supported 4:30pm Wed 16th Oct, ANONYMOUS

If we do it with a partner only one of us need to submit right?


SVG not supported 4:18pm Wed 16th Oct, ANONYMOUS

Are we allowed to submit an assumptions.txt along with our code for this project? Thanks.


SVG not supported 4:01pm Wed 16th Oct, Harrison L.

I actually have already implemented it so as that the command-line arguments will be the files taken from written to- is this okay? I assume that it is, as in.txt and out.txt are always passed when calling . simulation


SVG not supported 4:00pm Wed 16th Oct, Harrison L.

Hi In the project brief, RAM is printed as 0,0,0; 0,0,0; 1,0,1; 1,0,1; EMPTY,EMPTY,EMPTY; ... However in many help forum posts, it is listed as 0, 0, 0; 0, 0, 0; 1, 0, 1; 1, 0, 1; EMPTY, EMPTY, EMPTY; ... In the first, commas do not have a ...


SVG not supported 1:32pm Wed 16th Oct, ANONYMOUS

ANONYMOUS wrote You are correct on that, yes. By not incrementing the time that is the expected output - you should list that as one of your assumptions though, just in case.


SVG not supported 1:20pm Wed 16th Oct, ANONYMOUS

Does time stamp increase when you ignore a page? I have seen some conflicting answers on the forum, and would like to confirm before submitting. For example, if you don't increase time when ignoring a page, output for 0 0 0 0 1 0 0 2 3 1 0 2 3 3 2 wou...


SVG not supported 1:16pm Wed 16th Oct, ANONYMOUS

Are you assuming time stamp increases when you ignore a page? Our output is 0, 1, 2, 3 4, 7, 99, 99 99, 99, 5, 99 99, 99, 6, 99 0,0,0; 0,0,0; 0,1,1; 0,1,1; 0,2,2; 0,2,2; 0,3,3; 0,3,3; 1,0,4; 1,0,4; 2,2,11; 2,2,11; 3,2,10; 3,2,10; 1,1,7; 1,1,7; Cheers


SVG not supported 11:06am Wed 16th Oct, Joshua N.

Since the size of the RAM, page table and Virtual memory is static, you can use static arrays.


SVG not supported 10:21am Wed 16th Oct, Joshua N.

Yes.


SVG not supported 10:02am Wed 16th Oct, ANONYMOUS

Hi, just to confirm, we only submit one file which is the simulation.c file and not the compiled executable? Thanks


SVG not supported 8:49am Wed 16th Oct, Joshua N.

Answered here https secure.csse.uwa.edu.au run help2002?p np opt U685


SVG not supported 4:39pm Tue 15th Oct, Joshua N.

Both are correct. The struct you make doesn't need to be exactly the same.


SVG not supported 4:33pm Tue 15th Oct, Joshua N.

ANONYMOUS wrote This isn't correct because we are using the "Local" Least Recently Used (LRU) algorithm to evict processes. You seem to be using "global". 1. At time 0,1,2,3 0 0 0 0 is loaded. 2. At time 4 The fifth zero is ignored. 3. At time 5,6,7,8...


SVG not supported 4:26pm Tue 15th Oct, ANONYMOUS

Okay nevermind, i have'nt read the specification properly.


SVG not supported 4:23pm Tue 15th Oct, ANONYMOUS

I got the same output, so it's probably correct. In case anyone is looking at this later and wants to know the output for not allowing process pages to be read more than once, the output should be something like this 0, 1, 2, 3 4, 7, 99, 99 99, 9...


SVG not supported 4:23pm Tue 15th Oct, Joshua N.

ANONYMOUS wrote I believe that's a typo should be ". simulation.c in.txt out.txt".


SVG not supported 4:22pm Tue 15th Oct, Joshua N.

ANONYMOUS wrote You wouldn't gain marks since it isn't asked for in the specification. Whether you lose marks or not would be up to the discretion of whoever marks your code (usually, you wouldn't be marked down for having extra code that exists for ...


SVG not supported 4:16pm Tue 15th Oct, Anthony S.

Hi, I know the memory struct given to us is an unnamed struct but is it okay if we make a new type called struct memory? This is how I have defined my struct struct memory int process id; int page num; int last accessed; ; Also can you verif...


SVG not supported 4:09pm Tue 15th Oct, ANONYMOUS

How come it is correct, if the replacement is ignored? Because in the example in the given input last sequence of numbers are "1 1 2 2 3 3 2 2 1 1" and because of that all the pages of process 0 will definitely be replaced by the new pages of all the ...


SVG not supported 2:44pm Tue 15th Oct, ANONYMOUS

"You have to write a C program in a single file called simulation.c, and compiled as an executable called simulation. It will read two file names from the command line, in.txt and out.txt. The first file is the one mentioned above, for reading process i...


SVG not supported 2:40pm Tue 15th Oct, ANONYMOUS

I have code throughout the project that generates an optional log file. Assuming the debug code is done well, I was wondering if there would be marks taken off for having extra code, marks added for having good debug functionality, or no difference t...


SVG not supported 8:50am Tue 15th Oct, Joshua N.

Thanks. Your solution is correct.


SVG not supported 8:47am Tue 15th Oct, Joshua N.

ANONYMOUS wrote Just what is written in the spec. each page table entry on a new line. Followed by the RAM contents with each page semi-colon separated. You also need to explicitly print out the empty slots of RAM (You can just print "empty" for that...


SVG not supported 8:44am Tue 15th Oct, Joshua N.

ANONYMOUS wrote You have to take the page that has not been in the RAM before. So 3.


SVG not supported 3:27am Tue 15th Oct, ANONYMOUS

Hello, I would like to ask regarding the output file we should write to, is there any particular format we need to follow besides the format of the page table and RAM? 0, 2, 99, 99 1, 99, 5, 99 3, 99, 99, 4 99, 99, 7, 6 0, 0, 3; 0, 0, 3; 2, 2, 5; 2, 2, 5;...


SVG not supported 11:09pm Mon 14th Oct, ANONYMOUS

Adding to this to show how it'd look if you chose to ignore it instead of pushing 99, 1, 2, 3 99, 99, 4, 5 99, 99, 6, 7 99, 0, 99, 99 3,1,10; 3,1,10; 0,1,1; 0,1,1; 0,2,2; 0,2,2; 0,3,3; 0,3,3; 1,2,13; 1,2,13; 1,3,14; 1,3,14; 2,2,11; 2,2,11; 2,3,12; 2,3,12...


SVG not supported 9:30pm Mon 14th Oct, Joshua N.

That's right.


SVG not supported 9:28pm Mon 14th Oct, Joshua N.

Thanks for clarifying.


SVG not supported 9:27pm Mon 14th Oct, Joshua N.

Yes. The spec explicitly states the names of the files will be in.txt and out.txt As Anon said it is good practice to be able to read a file of any name as opposed to a hard coded value. However, for this project you can assume that the file name pass...


SVG not supported 9:21pm Mon 14th Oct, Joshua N.

Looks good.


SVG not supported 8:56pm Mon 14th Oct, ANONYMOUS

That looks right to me Just tested it on my end and I got the same result, so either we are both right are both wrong. I certainly hope it's the former.


SVG not supported 8:17pm Mon 14th Oct, ANONYMOUS

ANONYMOUS wrote Noted, I've made the changes. Could you verify if this should be the correct output? Thanks in.txt 0 0 0 0 0 1 1 2 2 3 3 2 2 1 1 out.txt 0, 99, 2, 3 99, 99, 4, 5 99, 99, 6, 7 99, 1, 99, 99 RAM Contents 0,0,4; 0,0,4; 3,1,10; 3,1,10; 0,2,2; 0,...


SVG not supported 5:41pm Mon 14th Oct, ANONYMOUS

Hi, no this this should not be the case. Note that a process will always replace one of its own pages if the RAM is full and there is one available to replace (as local replacement is prioritised over global). As a result of this, once 1 page of each...


SVG not supported 3:11pm Mon 14th Oct, ANONYMOUS

You can write is as an assumption that it will always be named that. This is a simple project so I doubt they'd check it. But a good practice is to not hard code it but instead let it work with any names. Hope this helps


SVG not supported 3:10pm Mon 14th Oct, ANONYMOUS

ANONYMOUS wrote As Amitava said in his clarification email "(1) What happens if all the pages of a process are already in memory and the process id appears again in the input. You can handle this one of two ways, either you can ignore it, or 'bring' ...


SVG not supported 3:07pm Mon 14th Oct, ANONYMOUS

I have emailed Amitava this and he says it doesn't matter how you put it (99, 99, 0 or Empty, Empty, 0 or Empty, Empty, Empty) just put it under your assumptions as comments at the very top of your code His exact response is "Yes, you can choose your ...


SVG not supported 1:46pm Mon 14th Oct, Harrison L.

Hello I was just wondering whether the input file will always be called in.txt, and the outfile will always be called out.txt since the project description says that we should take in.txt and out.txt as command-line arguments. If a filename o...


SVG not supported 10:49am Mon 14th Oct, ANONYMOUS

I apologise if this has been answered previously If the RAM is not full, when we are printing the contents should we only print the pages that exist in RAM or should we specify that it is empty with a keyword like 'Empty' if a location in RAM has no p...


SVG not supported 12:38am Mon 14th Oct, ANONYMOUS

Assume that we had called the same process ID 5 times like so 0 0 0 0 0 when we get to that fifth call, since it's already in memory, should we increase the time? like should it be 0, 1, 2, 3, 4 or 0, 1, 2, 3, 3 (since were not moving values from Virtual...


 UWA week 41 (2nd semester, week 11) ↓
SVG not supported 3:31pm Sun 13th Oct, Joshua N.

All good answered here https secure.csse.uwa.edu.au run help2002?p np opt U545 hl input 20validation


SVG not supported 2:48pm Sun 13th Oct, ANONYMOUS

Sorry if this has been asked in a previously, but do we assume that the input file syntax will always be correct, or should we implement measures to detect errors e.g. alphabetic characters?


SVG not supported 12:49pm Sun 13th Oct, Joshua N.

ANONYMOUS wrote Hi Anon That's fine. np.


SVG not supported 12:27pm Sun 13th Oct, ANONYMOUS

Hello, In the project it says that the VRAM size is 32, however each page specific to a process takes up 2 spaces (i.e. a duplicate). Do we have to make our VRAM array size 32 in our code or can we make it 16. (And of course printing the duplicate of e...


SVG not supported 7:04pm Sat 12th Oct, Joshua N.

The spec doesn't specify the exact format. You would need to ask Amitava to be complete sure.


SVG not supported 5:32pm Fri 11th Oct, Joshua N.

Answered here https secure.csse.uwa.edu.au run help2002?p np opt U574


SVG not supported 5:32pm Fri 11th Oct, Joshua N.

ANONYMOUS wrote Yes, Amitava said you can either do that or reload the pg 0 again (which would just be updating the "last accessed" variable). I believe moving pointers was the intention, otherwise using an array of pointers to structs wouldn't have a...


SVG not supported 2:48pm Fri 11th Oct, ANONYMOUS

Sorry, I forgot to link the post in my first question https secure.csse.uwa.edu.au run help2002?p np opt U564


SVG not supported 12:54pm Fri 11th Oct, ANONYMOUS

Hi, I have the following questions about Project 2. 1. Based on the response in the post linked below which states that a process can only be loaded once, does this mean that after the fourth page (with page number 3) of a process has been loaded into...


SVG not supported 12:49pm Fri 11th Oct, ANONYMOUS

Hi, I have the following questions about Project 2. 1. Based on the response in the post below stating that a process can only be loaded into RAM once, does this mean that after the fourth page (with page number 3) of a process has been loaded into ...


SVG not supported 12:27pm Fri 11th Oct, Joshua N.

ANONYMOUS wrote Yes. Is there a need to present it in stdout? No.


SVG not supported 11:28am Fri 11th Oct, ANONYMOUS

Hi, does the output have to be written to out.txt only? Is there a need to present it in stdout?


SVG not supported 8:15am Fri 11th Oct, Joshua N.

ANONYMOUS wrote Yes (although technically you could use an array of size 16 since there are duplicates).


SVG not supported 11:57pm Thu 10th Oct, ANONYMOUS

Hi, I am a bit confused with the role of the disk in the project. From my understanding we just have to initialise each of the 32 slots to their respective pointer structure, for example slot 0 and 1 would point to structure with process-id 0 and pag...


SVG not supported 12:26pm Thu 10th Oct, Joshua N.

ANONYMOUS wrote I don't think so, Amitava never said anything about an assumption sheet for this project. From his email he said to put any assumptions you made as comments in the file you submit. Make sure to put them at the top of the file.


SVG not supported 12:23pm Thu 10th Oct, Joshua N.

ANONYMOUS wrote The specification states that the struct you use "may" look like the one it provides. So, no you don't have to use the exact same struct. However, I do believe you need to use a struct.


SVG not supported 12:20pm Thu 10th Oct, Joshua N.

ANONYMOUS wrote Yes. Global means evict the page in RAM with the lowest "last accessed" time. Local means evict the page from the same process in RAM with the lowest "last accessed" time (e.g. If you are loading process 0 onto RAM and RAM is full and ...


SVG not supported 12:15pm Thu 10th Oct, Joshua N.

ANONYMOUS wrote Amitava needs to clarify. I'm assuming you don't need a ";" at the end. If memory isn't allocated, then how are you able to store anything in your structure? Most likely, it's bad practice to not free dynamically allocated (or malloced)...


SVG not supported 12:11pm Thu 10th Oct, ANONYMOUS

Hi, just making sure I understand correctly In reality a page table for each process will be stored in RAM, however in this project only page frames can be stored on RAM - so I am assuming that we can use an array completely separate from main memory...


SVG not supported 12:08pm Thu 10th Oct, ANONYMOUS

Hi, After I ran the in.txt 0 2 1 3 3 2 2 0 2 1 0 2 3 0 , the out.txt format was as shown in the figure. I checked all the records in the help2002 and saw that some people had a ";" after the last line, while others did not. My result did not have a "...


SVG not supported 10:34am Thu 10th Oct, ANONYMOUS

Thanks But one more question, the project specifies this structure struct int process id; int page num; int last accessed; memory; Would i be penalised if i do not use that struct or can i do this project in any way I like?


SVG not supported 10:27am Thu 10th Oct, ANONYMOUS

We're not meant to have an assumptions sheet are we?, (if we are, do we submit a .zip file with simulation.c, rather than just the files directly??)


SVG not supported 9:26am Thu 10th Oct, ANONYMOUS

Yh, that was more for explaining my current understanding, and making sure that I am meant to remember the previous page. I think this part explains it well though. Thanks a lot for that, it clears it up a good bit.


SVG not supported 6:35am Thu 10th Oct, Joshua N.

ANONYMOUS wrote One person submits the simulation.c file with the names of both members in the file as a comment at the top.


SVG not supported 6:34am Thu 10th Oct, Joshua N.

ANONYMOUS wrote Yes. Yes. So the out.txt of the example above should look like this? For the RAM content is it process, page, time stamp; or page, process, time stamp; ? I believe it follows the same order as the struct, which is process;page;last acce...


SVG not supported 6:26am Thu 10th Oct, Joshua N.

ANONYMOUS wrote Yes. Yes. You need to remember the last page you loaded for each process. It's up to you how to determine how to do that. Since RAM is full and there is no page of process 3 on RAM, we can't use local LRU to make room, we need to use glo...


SVG not supported 7:41pm Wed 9th Oct, ANONYMOUS

Hi I am just wonder if i do the project with a partner would just one of us submitting be enough and do we just submit simulation.c file or do we submit the exe file as well?


SVG not supported 7:26pm Wed 9th Oct, ANONYMOUS

I'm having some difficulties grasping a few ideas and want some clarifications on them if possible. So, lets say the contents of in.txt are, "0 1 1 1 1 2 2 2 2 3 3 3 0", you'd end up with the first 0 being evicted without another page from process 0 ...


SVG not supported 6:30pm Wed 9th Oct, ANONYMOUS

This input is on the project sheet 0 2 1 3 3 2 2 0 2 1 0 2 3 0 at t 7, the RAM should look like this right? 0 2 1 3 3 2 2 0 then at t 13 the RAM would look like this right, since local LRU means that the next page replaces ...


SVG not supported 4:47pm Wed 9th Oct, Joshua N.

ANONYMOUS wrote If you are ignoring the input the time stamp wouldn't increase since you aren't loading it into RAM. I'm not sure how project 2 will be marked. You would have to ask Amitava to know for certain. Projects are usually automatically marke...


SVG not supported 4:43pm Wed 9th Oct, Joshua N.

Yes, if you're assuming you can load the same process twice.


SVG not supported 2:25pm Wed 9th Oct, ANONYMOUS

Will our submissions be manually marked, or will the output.txt be automatically marked against a reference solution? Under clarification 1 we are allowed to either ignore a process id if all of the pages are in RAM or we can bring in the 0th page. Th...


SVG not supported 1:07pm Wed 9th Oct, Samay G.

But we will have to change the time step of the page which is already there and also been requested next. otherwise we will not be able to know the least recently one


SVG not supported 6:40am Wed 9th Oct, Joshua N.

Yes, Virtual Memory doesn't change. We are just moving pointers in and out of RAM (and updating the page table to keep record of where the pages are in RAM). np


SVG not supported 6:37am Wed 9th Oct, Joshua N.

Simulations are a model or abstraction of the "real world", they do not 100 match what is done in practice. How much a simulation matches the real world depends on the level of detail necessary (as per the specification). With all simulations you ne...


SVG not supported 1:20am Wed 9th Oct, Raed R.

Hi, based on the current implementation, once every process has at least one page in RAM and the RAM is full, the number of pages for each process effectively gets "locked in" because the local LRU will prioritize evicting a page from the same proce...


SVG not supported 9:23pm Tue 8th Oct, ANONYMOUS

I see So when we remove it from RAM we just remove the pointer to it in the RAM while the pointer in the Virtual Memory never changes? And yes, I was asking if they were separate arrays. Thanks for the help Joshua


SVG not supported 4:21pm Tue 8th Oct, Joshua N.

ANONYMOUS wrote Answered here https secure.csse.uwa.edu.au run help2002?p np opt U564 Their contents are not disjoint (e.g. for the example you gave, after the first-time step the pointer for page 0, process 0 will be in both RAM and Virtual Memory)...


SVG not supported 3:53pm Tue 8th Oct, ANONYMOUS

Hi there Just a few questions to clarify if I'm understanding correctly 1. From an earlier forum question it is stated that https secure.csse.uwa.edu.au run help2002?p np opt U557 in.txt 0 1 2 3 0 1 2 3 0 1 2 3 out.txt 99, 4, 0, 99 99, 5, 1, 99 99, 6, 2, ...


SVG not supported 2:08pm Tue 8th Oct, Joshua N.

There will be a maximum of 8 pages in RAM. It does make sense. You can identify a specific page by its process id and page number. Why will there need to be 2 different processes in RAM? Technically a page from each process can be in RAM. Unless you ar...


SVG not supported 11:39am Tue 8th Oct, Kristiaan M.

before receiving input the project specifications say "We have a computer whose RAM is an array of size 16. It is an array of pointers. There are 8 page frames in the RAM, each consisting of two contiguous locations in the array. Hence, the page size o...


SVG not supported 7:05am Tue 8th Oct, Joshua N.

ANONYMOUS wrote It can be initialized sequentially. So long as the disk starts with all the process pages inside. So, 0-3 pages for each of the 0-3 processes. Yes, as the spec states if a page of a process isn't in RAM its entry in the page table is 9...


SVG not supported 1:49am Tue 8th Oct, ANONYMOUS

Question 1 In terms of disk initialization when saving all the 32 locations, should the pages be initialized in random order, or is it expected that the process pages will be initialized sequentially? For example, starting with process 0, page 0, pag...


SVG not supported 7:13pm Mon 7th Oct, Joshua N.

Occurs when RAM is full and you are trying to load a new page into memory. E.g. If page 0 of process zero is in memory and RAM is full and you are trying to load the next page of process 0, then you evict the least recently loaded page of process 0 (...


SVG not supported 6:11pm Mon 7th Oct, Chenjun H.

Hi, Just 2 questions about the assignment, With the global least recently used eviction policy, does this only occur when we try to add a page already in the memory to the memory? Also, since the output is only interested in the ram, what is the purpos...


SVG not supported 2:01pm Mon 7th Oct, Joshua N.

This is really hard to read and hard to know what question you are asking. I mean for one, your output doesn't print empty slots. It also doesn't print the same slot twice. The structure for some reason has 99 in it? 99 should only be used in the page...


SVG not supported 1:54pm Mon 7th Oct, Joshua N.

RAM starts empty. You only load processes based on the file. At instruction 0, there is no process to evict. Since the RAM is empty. Amitava said a process can only be loaded once. So, the fifth 0 would be ignored. I think that was a mistake on Amitava...


SVG not supported 1:50pm Mon 7th Oct, Joshua N.

ANONYMOUS wrote You would just ignore all lines except the first. However, best practice is to stop processing the file if you detect multiple lines since you would assume the file was corrupted.


SVG not supported 1:44pm Mon 7th Oct, Joshua N.

ANONYMOUS wrote Cyclically, so it would be Page 3. Amitava said you can only load the process once, so there would be no next page. Yes.


SVG not supported 1:35pm Mon 7th Oct, Joshua N.

ANONYMOUS wrote If Amitava said to only do it once then follow what he said.


SVG not supported 1:34pm Mon 7th Oct, Joshua N.

ANONYMOUS wrote That is the spec unless Amitava changes it. The output doesn't really "show" the default time anyway. Since you only print the times of pages that are loaded onto RAM.


SVG not supported 1:31pm Mon 7th Oct, Joshua N.

ANONYMOUS wrote Yes. I believe you still have to print "Empty" unless Amitava clarifies. I wouldn't say so since the spec states to print the contents of RAM, which would include the empty slots.


SVG not supported 12:25pm Mon 7th Oct, Kristiaan M.

page process id,page num,time before input RAM pages 0,0,0 , 0,1,0 , 0,2,0 , 0,3,0 , 1,4,0 , 1,5,0 , 1,6,0 , 1,7,0 DISC pages 0,99,0 , 0,99,0 , 0,99,0 , 0,99,0 , 1,99,0 , 1,99,0 , 1,99,0 , 1,99,0 , 2,99,0 , 2,99,0 , 2,99,0 , 2,99,0 , 3,99,0 , 3...


SVG not supported 10:37am Mon 7th Oct, Kristiaan M.

the way I understand the project is that it starts loaded in with the first 2 processes (page numbers 0-7) but because there are 16 pages in disc there is also a copy of process 0 and 1 in disc so instruction 0 bring in least recently used page into R...


SVG not supported 10:05am Mon 7th Oct, ANONYMOUS

Hello, I know this quesiton has been answered but I dont fully understand it. If the input is 0 0 0 0 0 0 Would it load the first 4 pages into RAM then reload the first page then reload the second page, with the reloaded pages having new time stamps? A...


 UWA week 40 (2nd semester, week 10) ↓
SVG not supported 10:56pm Sun 6th Oct, ANONYMOUS

Because of the line "The simulation starts by reading a file where there is a single line of integers separated by blanks" do we need to error check for multiple lines or will it just be assumed we wont be provided with more than one line in the in.tx...


SVG not supported 2:27pm Sun 6th Oct, ANONYMOUS

The default time for pages is 0 The simulation starts at time 0 If I access the first page, I will set its time to 0, and update the simulation time to 1. Which kinda makes it look likes its done nothing. The default time for pages could be changed to -1...


SVG not supported 10:00pm Sat 5th Oct, Sean G.

Hey, I'm also not sure what to do in this case. Say the input string was 0 0 0 0 0 0 0 0. Do we load process 0 into RAM twice, and effectively load its 4 pages twice? Or should allow a process to be completely loaded into RAM only once?


SVG not supported 4:16pm Sat 5th Oct, ANONYMOUS

Hello, I've seen a few posts already saying that if the input file tells us to bring the next page of process 0 to RAM, but all pages of process 0 are already in RAM, then we should update the last accessed time of the 0th page of process 0 to the new...


SVG not supported 2:50pm Sat 5th Oct, Samay G.

Thanks for the guidance, Appreciate it


SVG not supported 7:39pm Fri 4th Oct, ANONYMOUS

Are pages loaded into RAM cyclically, or on a lowest-index basis? For example, if the page table of process 0 looks like this 99, 2, 4, 99 , this means that page 0 and 3 are in disk while 1 and 2 are in RAM. his may happen if pages 0,1,2 were loaded...


SVG not supported 3:29pm Fri 4th Oct, Songwen Y.

Sorry I was referring to the outdated project description. the newer one has says "If there is no page of the process whose page you want to bring in, use a global LRU policy, evict the page that is least recently used among all pages in the RAM." Ne...


SVG not supported 2:59pm Fri 4th Oct, Songwen Y.

Hello guys What if a page of a process has already been loaded to RAM, shall I just ignore it or update its last access time?


SVG not supported 1:40pm Fri 4th Oct, Joshua N.

ANONYMOUS wrote Answered here https secure.csse.uwa.edu.au run help2002?p np opt U545


SVG not supported 1:36pm Fri 4th Oct, ANONYMOUS

Should our program account for any errors such as incorrect inputs being passed into the command line or incorrect data type or if an integer like 4 is located inside in.txt?


SVG not supported 7:39am Fri 4th Oct, Joshua N.

Correct


SVG not supported 10:13pm Thu 3rd Oct, ANONYMOUS

Could I clarify my out.txt results as I am not sure if what I have done is correct. in.txt 0 1 2 3 0 1 2 3 0 1 2 3 out.txt 99, 4, 0, 99 99, 5, 1, 99 99, 6, 2, 99 99, 7, 3, 99 RAM Contents 0,2,8; 0,2,8; 1,2,9; 1,2,9; 2,2,10; 2,2,10; 3,2,11; 3,2,11; 0,1,4; 0,1...


SVG not supported 6:50pm Thu 3rd Oct, Joshua N.

Actually the best practice is to never call "exit" because it doesn't end the program "gracefully". The best practice is to return EXIT FAILURE (1) in main. If you are interested.


SVG not supported 6:47pm Thu 3rd Oct, Joshua N.

If you encountered a number outside of 0-3 then you would assume the file is corrupted and you shouldn't continue reading. So best practice is to print an error message then call exit(EXIT FAILURE).


SVG not supported 6:46pm Thu 3rd Oct, Joshua N.

If you countered a number outside of 0-3 then you would assume the file is corrupted and you shouldn't continue reading. So best practice is to print an error message then call exit(EXIT FAILURE).


SVG not supported 6:15pm Thu 3rd Oct, Samay G.

So, if any process request comes other than 0 to 3 in the input string, I am skipping that process and processing rest of the processes as required without printing any error


SVG not supported 2:42pm Thu 3rd Oct, Joshua N.

Yes that seems right. just remember that Disk has all 16 pages in it (4 for each process) and disk is never changed. Also RAM has frames 0-7. Processes have pages 0-3.


SVG not supported 11:05am Thu 3rd Oct, Kristiaan M.

so if the RAM has page numbers 0-7 from processes 0 and 1 all initially time step 0, and the disc has processes 2-3, and we receive the instruction '0' there is nothing to move in from the disc as all of process 0 is in RAM. We need to evict the first...


SVG not supported 8:18pm Wed 2nd Oct, Joshua N.

I've answered this question here https secure.csse.uwa.edu.au run help2002?p np opt U516


SVG not supported 8:16pm Wed 2nd Oct, Joshua N.

You need to make your own tests and see if your program produces what you expect given the project specification. I've given one example here https secure.csse.uwa.edu.au run help2002?p np opt U525


SVG not supported 8:15pm Wed 2nd Oct, Joshua N.

I'll just change the output to avoid confusion. Shame there is no edit option on the forum 0 99 99 99 1 99 99 99 2 99 99 99 3 99 99 99 0,0,0;0,0,0;1,0,1;1,0,1;2,0,2;2,0,2;3,0,3;3,0,3;Empty;Empty;Empty;Empty;Empty;Empty;Empty;Empty;


SVG not supported 8:13pm Wed 2nd Oct, Joshua N.

I think this is meant to be a simple project. So, I don't think input sanitization is necessary, but it is good practice.


SVG not supported 4:09pm Wed 2nd Oct, Liam H.

Will we be expected to sanitise or validate the input file? For example, if the input file requests the next page for process 9 (obviously doesn't exist), should we print an error? Or perhaps shoudl we catch any potential invalid inputs and skip them...


SVG not supported 11:56am Wed 2nd Oct, Kristiaan M.

yes that's the page table, with corrected indexes it looks like this process 0 0,1,2,3 process 1; 4,5,6,7 process 2 99,99,99,99 process 3 99,99,99,99 process 0 and 1 are loaded into ram with values 0-7 but now there is a new issue with instruction '0' '...


SVG not supported 11:38am Wed 2nd Oct, Leran P.

Yes, i mean how do we check our output if it is correct or not?


SVG not supported 6:28am Wed 2nd Oct, Joshua N.

Isn't this your page table? process 1 0,1,2,3 process 2 4,5,6,7 process 3 99,99,99,99 process 4 99,99,99,99 It's hard to follow what you are doing to RAM and disk because it doesn't provide information as to which page of which process is in RAM. RAM ...


SVG not supported 1:23am Wed 2nd Oct, Kristiaan M.

Ok that makes sense, RAM and DISC are the values of the page table of the currently loaded processes so RAM 0,1,2,3,4,5,6,7 DISK 99,99,99,99,99,99,99,99 instruction 3 RAM 0- 99 (evicting process 1 (value 0) and replacing with process 3 (value 99)),1,2,...


SVG not supported 12:13am Wed 2nd Oct, Samuel L.

If you're having issues tracking down the source of the segfault, I would recommend taking a look at Valgrind, I've found it quite helpful in the past.


SVG not supported 8:28pm Tue 1st Oct, Joshua N.

When constructing your array of pointers to structures did you make sure to malloc memory to them before accessing their contents? Segfault means you are going out of bounds in memory. If malloc wasn't used the pointer points to nothing (no memory) s...


SVG not supported 8:26pm Tue 1st Oct, Joshua N.

Are you asking if there are any pages in RAM when the simulation starts? The RAM is empty there are no pages in RAM.


SVG not supported 8:22pm Tue 1st Oct, Joshua N.

I'm not sure what your question is about. Are you asking what happens if RAM is full and we are bringing in another process which isn't in RAM? In that case you would evict the page of any process with the lowest "last accessed" time. Also, not sure ...


SVG not supported 8:05pm Tue 1st Oct, Joshua N.

ANONYMOUS wrote Also, I should mention the contents of RAM I did was incorrect. The first digit should represent the process and the second should represent the page but I accidently did it the wrong way around.


SVG not supported 8:03pm Tue 1st Oct, Joshua N.

ANONYMOUS wrote There is a specific format. Pretty much the one I provided. Except for the empty sections of the RAM because it isn't specified in the spec what should be printed if RAM is empty. Amitava would have to clarify.


SVG not supported 2:30pm Tue 1st Oct, ANONYMOUS

Hi, if there are only 5 integers in the in.txt, should I set my last 6 entries in out.txt to something like Empty? Also, is the format of out.txt defined? Or can I stylize it anyway I want? Eg in.txt 0 1 2 3 0 out.txt Process 0 0, 4, 99, 99 Process 1 1...


SVG not supported 1:36pm Tue 1st Oct, Kristiaan M.

Hi, if we load the page frames in sorted by page num the memory looks like this process 1 0,1,2,3 process 2 4,5,6,7 process 3 99,99,99,99 process 4 99,99,99,99 RAM 0,1,2,3,4,5,6,7 DISK 99,99,99,99,99,99,99 but if we get the instruction '3' there is no...


SVG not supported 12:54pm Tue 1st Oct, Seoyoung P.

Hi, In Project 1, we were instructed to specify the operating system we used, but there is no mention of this in the Project 2 instructions. Should we still indicate which OS we are working on, such as macOS or Linux? Additionally, my partner and I are...


SVG not supported 8:13am Tue 1st Oct, Joshua N.

I forgot Amitava changed the spec, should be 0 99 99 99 1 99 99 99 2 99 99 99 3 99 99 99 0,0,0;0,0,0;0,1,1;0,1,1;0,2,2;0,2,2;0,3,3;0,3,3;0,0,0;0,0,0;0,0,0;0,0,0;0,0,0;0,0,0;0,0,0;0,0,0;


SVG not supported 8:12am Tue 1st Oct, Joshua N.

ANONYMOUS wrote The updated page table and RAM. 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0,0,0;0,0,0;0,1,1;0,1,1;0,2,2;0,2,2;0,3,3;0,3,3;0,0,0;0,0,0;0,0,0;0,0,0;0,0,0;0,0,0;0,0,0;0,0,0; See here https secure.csse.uwa.edu.au run help2002?p np opt U515


SVG not supported 10:42pm Mon 30th Sep, ANONYMOUS

Hi, will we be getting any samples similar to project 1? For example, if in.txt contains 0 1 2 3 What should I expect from out.txt?


SVG not supported 9:24pm Mon 30th Sep, Joshua N.

ANONYMOUS wrote You should have 4 pages in RAM. I'm not sure if I understand your question but if you exceed the number of pages for a process you likely would need to evict the first loaded page for that process and replace it with the new process. I...


SVG not supported 9:18pm Mon 30th Sep, Joshua N.

Hi Leran, I'm sorry but I think you need to make your own. You can use the example given in the project specification as a guide.


SVG not supported 9:16pm Mon 30th Sep, Joshua N.

Each process has exactly 4 pages in VMEM which can be loaded to RAM. Memory of struct pointers. When you store the pointers in VMEM you are storing the structs there also. From the in.txt file you know the process to load onto RAM. You load the ne...


 UWA week 39 (2nd semester, week 9) ↓
SVG not supported 6:02pm Fri 27th Sep, Samuel L.

Hi, Q1. In the project briefing, it mentions each proces can have 4 pages Does that mean that each process can have up to 4 pages, or exactly 4 pages. Q2. Is the Virtual Memory an array of memory structs, or an array of memory struct pointers. I'm a...


SVG not supported 7:53pm Wed 25th Sep, Leran P.

Can I ask a sample for project 2 to verify my solution?


SVG not supported 2:03pm Wed 25th Sep, Joshua N.

I C what you mean. I think it's a typo, I think it is just 4 processes. Otherwise, the size of virtual memory wouldn't be enough to store all the processes. To be certain Amitava would need to clarify.


SVG not supported 2:01pm Wed 25th Sep, Joshua N.

ANONYMOUS wrote Hi, I assume so, since that's what the project sheet said. np.


SVG not supported 2:00pm Wed 25th Sep, Joshua N.

ANONYMOUS wrote The project sheet states you "can" work as a group. So, I'm assuming that means it's fine if you work alone. Project is definitely small enough to do on your own.


SVG not supported 11:01pm Tue 24th Sep, Leran P.

same question as above.


SVG not supported 4:03pm Tue 24th Sep, ANONYMOUS

The project sheet said the project can be done in a group of two, but I would like to do it alone. Just wondering if is it allowed to do that. Or it's a requirement to work in a group?


SVG not supported 1:39pm Tue 24th Sep, ANONYMOUS

Hi, For Project 2, are we only submitting ONE C file, which is simulation.c? Thanks


SVG not supported 12:45pm Tue 24th Sep, Liam vdM.

In the project description it says there will be 4 processes, then a bit later it says they will be numbered 0...4 which is 5 processes. Which one is it?

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy