So I was chatting with a friend who said he was getting some weird file permissions when trying to create a file, so we ran the following code on our respective outputs and ended up with different file permissions
include fcntl.h
include unistd....
I read in Jacob's post that if a subdirectory is empty, we do not create it in the other directories to be synced. E.g. if we are syncing bettwen dirA and dirB, and there is an empty subdirectory dirA dirsub then dirB dirsub won't be created ...
I do agree that empty subdirectories should be created in the other directories as it does make sense to make the directories to be synced exactly the same (in terms of structure and file contents). This is also what happens in cloud syncing. Also, I...
Haven't used this forum much this project haha but now I finally found a question (kinda) to bother you with.
Before I read the post titled Macro Definitions, I was searching up the maximum path names in Linux systems. I stumbled across MAX PATH whic...
Thanks for pointing this out, I was just about to ask about this. As mkdir is a utility program that is called in the command line, how is it possible to use it in the C program? Could you highlight an exmaple of each in case I end up doing something...
Although it is true that MAX RUNNING PROCESSES is the total number of processes in all the queues, I believe it is perfectly acceptable to define the length of the queues as this value. This is because all the processes may be in a single queue, espe...
The command file you provided is perfectly valid. As you are reading from terminal, the read speed is only 10Bps, meaning reading just 5B will take 0.5 usecs which is 500 000 usecs I am assuming you are running the verbose output of the sample solut...
Yes... This how it should run. As stated in the project sheet (and in the many clarifications that followed), we only spawn the first command in the commands file. If that command does not call spawn, then that is the only command that will ever run....
My brother in Christ you have 6 days left to do this project...
And yes, an array of structures to store the commands with a nested array of structures for the syscalls will work just fine. Although the system calls have different values, they have a...
Hi there, I did some testing and it looks like the sample solution just increments the time after unblocking a process, and then uses that time as the point of reference to check if the next process can be unblocked. E.g. in the example below, the R ...
As stated in the project sheet, the simulation should only spawn the first command in the file. If that command does not call spawn, then that command is the only one that is run in the entire simulation. You should of course read all the commands in...
Never mind, I think its because the command file has 12 commands, when the max is only 10. Don't know how my program doesn't crash, as I haven't added any file content checking
I was doing some extensive testing of my program, and noticed that in the sample solution, unused commands seemed to be affecting the output in some larger command files. I tried downsizing the commands file to see if I could replicate the issue but ...
Got this answer from a lab fac The acquisition of the data bus does not require the OS to be on the CPU. It happens in parallel to everything else. I believe it is because it is the device that acquires the data bus, not the CPU.
If a process has any child processes, it will go to RUNNING- BLOCKED instead of RUNNING- READY. It only gets unblocked when all child processes has terminated. Try
Shell
5usecs spawn second
6usecs wait
7usecs exit
second
20usecs exit
with a...
I expect that the sample solution will be fixed on Thursday when Chris comes back. Would you like my discord? Email me at 237 9 5 t d n . w . d . u o u e i a t t e d m i c r e e
Multiplying the size by 1000 000 then dividing by the speed should give the time, but for some reason I keep getting errors. I got floating point error when trying to store in a long int?
Yeah, I did use mod, I did try multiplying the size in bytes by 1 000 000 first, but it didn't seem to work properly. Now i realised my dumbass forgot to use long long ints. Thanks for reminding me.
Hmmm, at the moment i'm just dividing the R W speed by 1 000 000, do the calculation, then store the time in an int which truncates it. I know that floats are inaccurate but i've done some testing and everything is calculating fine.
I found a much easier way and that is just to use mod. Check if there is a remainder to the division, and if there is, then it means that we must add 1usec to the R W operation time as it takes a fraction of a usec. I'm not even sure if we're allowed...
Yeah at the moment I just added 1usec before a syscall occurs. So I increment normally to simulate each usec, but then I have to increment again when syscall happens. I'm trying to change the structure of the main loop at the moment so that the incre...
Yes, I do agree on this, just a bit confused after this post, as the 2 sleep processes wouldn't come close to unblocking at the exact same time
Just to clarify this section
If multiple processes can be unblocked at any time, they are unblocked (adde...
1. The read write processes in the sample solution seem to be mostly fixed, however, the time to complete the read write operation seems to be off by a multiple of 10. In the screenshot below, I am reading 10 Bytes from terminal which has a read spee...
Thanks, it makes much more sense how a system call cannot occur at the end of its time quantum. However, I still have some concerns about the timing of a system call. For example, with a TQ of 2usecs and the following command file
shell
1usec exit...
I was comparing outputs of my solution and the sample solution (after changing how time quantum worked and adding an extra usec before a syscall was executed) and somehow caused the sample solution to end up hanging in IDLE state. My solution produce...
Thanks for the clarification, it made things much clearer for me. Still have 2 questions though
1. When time quantum time of system call. At this point I am assuming it is intentional, that is, to move the process off running and run the system cal...