---
# System prepended metadata

title: Mini Project 2 Questions

---

1. I wasn't allowed to ```Sync fork``` due to some merge conflicts that I couldn't make sense of, is it fine if i delete the folder and use the official xv6-riscv MIT repo instead?

2. Is picking up code from online sources allowed? Any citation rules?
3. If I tell AI the exact logic and working of the code but tell it to write it, cuz I dont wanna manually write 20-30 lines of simple if else conditionals or for loops, does that count as LLM-Generated code?

4. In WireShark task 1.1, its mentioned that the user should be able to select an interface to monitor, and the example output was provided. but in task 1.2, its mentioned "For this phase, you only need to implement the first option."
so do we need to show all those 10 options given in the task 1.1 example ouput or not, or just show wlan0
as the only option of interface to select?

5. In Part C, should the input be read from a file or via CLI? Since it is not mentioned in the submission Format.

6. In Part B, task 2.3, can we assume no extension header handling needed for obtaining L4 when IPv6 is the protocol?

7. Can we make Part C modular with .h files and Makefile? Or one single .c file without a Makefile. How is the input for part C taken. should output be redirected somewhere for checking?

8. in phase 2, what if we do ctrl c while we are in the main menu?

9. what should be the error message if there are no interfaces found?
10. just to confirm, for all the interface option if selected the same menu option is provided right? or only for option 1?

11. In part C, will inputs be sorted according to timestamp?

12. In part C, it is mentioned that a customer cannot enter the bakery if it is at capacity, but there is no mention of whether that user waits or just leaves without waiting. What to assume?

13. In Part A, can the script "usertests" be used for testing our xv6 Demand Paging logic, or does it work in a way that wont work for the changed logic?

14. In Part B, For Inspect last session do we only have to store the last session packets or like we also have to print them or can some other operations be also asked?

15. C-Shark, Phase 4
    1. Suppose I `sudo ./cshark`, capture some packets, then ctrl-D it(exit).
    2. Now I `sudo ./cshark` again, and `3. Inspect Last Session`.
    What should happen?
    a. I should display an error message
    b. I should display the packets captured in 1.
    
16. In Part C, could you confirm if a sofa seat remains reserved for a customer until they finish payment or whether it is freed when that customer is taken for baking.

17. should we continue to take input from terminal after eof and the tasks are completed (only exit on ctrl c), or it should be terminated immediately after eof and output for it is given?

18. should there be any time between the customer taking a seat and requesting for cake(consider a chef is free)
        
19. In part B, if I press ctrl + c after choosing the interface (not during packet capture but while choosing from the main menu), should it again show the main menu or should it terminate the program?

20. For Ctrl+C implementation in Part B, do we have to stop immediately or can we stop after the timeout of pcap_dispatch function?

21. when the customer pays, does he take 1second, and then the chef takes 2sec to accept the payment or overall payment is 2sec only?

22. Are we expected to explain our approach in the ```README.md``` files for Part B and Part C?
23. In part-B (C-Shark) what should be the maximum size of the character array/buffer to store the name of the interface chosen by the user?

24. Are we supposed to hande ctrl-D even while the packets are being recieved ? Are we supposed to exit the program completely on ctrl-D when packets are being recieved or we can ignore that ?

25. How do we handle the case where the memory is full and a new process creates a page fault? We can't replace any page in the memory as none of them belongs to that process.

26. In part B, should the user be able to enter commands while sniffing?

27. Part C,
    1. Does a chef start baking a cake only after a customer does getcake()?
    2. If chef_j started baking a cake after customer_i did getcake(), but some other chef had finished a cake before that, then does the customer wait for chef_j or does the customer take the first cake available to him anf leave? That is, is a particular customer associated with a particular chef?

28. Part B, can we safely assume that the macro __FAVOR_BSD is defined, because the struct definition of tcp and udp headers depend on it

29. Suppose I run an HTTP sniffing session , then I run an ARP sniffing session and suppose ARP doesn't capture any packets , then when I run inspect last sniffing session , should it give me error or it should consider HTTP sniffing session inspection?

30. For Part1, there is no mkfs, but its mentioned in the submission format, are we supposed to create it?

31. As far as I understand the demand paging, ELF pages are loaded only when first used, so a few extra pages are allocated during execution. As a result, the free memory count at the end can differ slightly from the start, causing usertests to report lost pages. Upon checking free memory explicitly after usertests had terminated I found that all pages were available. So is this expected?

32. The  xv6 file limit is only 274kb, the assignment specs expects max swap capacity of 4MB, is this a flaw, or are we expected to modify xv6's file system to support larger files or use multiple swap files or smtg?

33. In Part-A the assignment specifies that clean pages are to be discarded on eviction and swap slots must be freed on reloading. So, in case of a stack or heap page that has not been modified since last reloading from memory (i.e a clean page), if we are to evict it and so discard it are we not losing pages then. Should we handle these cases differently and write back to the swap space even though it is a clean page ?
34. In part C , if a customer invokes bakecake , should the chef start baking it at the same time instant or 1 second later ? also same for invoking payment after recieving the cake ?


36. In part A, can we assume all pages are mapped read only at the start and every time there is a write, page fault is triggered, and permission is changed? Without that there is no inbuilt mechanism to detect dirty bits, so fault is not triggered and dirty bit would not be set. 


38. If chef 1 baked the cake for customer 1, then can any other chef, eg chef 2 accept payment for customer 1
Below is mentioned on the website
**When a customer’s cake is finished, any chef can accept payment**, but because there is only one cash register, payment is accepted for one customer at a time.
Below is from example 1
    >12 Customer 1 requests cake
    ..
    13 Chef 2 bakes for Customer 1
    ...
    15 Customer 1 pays
    ...
    16 Chef 2 accepts payment for Customer 1

As shown above, all the examples show that the same chef baking the cake and accepting payment


37. > Once inside, the customer takes a seat on the sofa or stands if the sofa is filled. When a chef is free, the customer that has been on the sofa the longest is served and, if there are any standing customers, the one that has been in the shop the longest takes a seat on the sofa. 

    This seems to imply that only a customer that is sitting on the sofa is served, while the standing customers are served only after taking a seat. The example 2 is contradictory.
    
    >...
    27 Customer 5123 requests cake
    27 Chef 1 accepts payment for Customer 1245
    27 Customer 2356 pays
    27 Chef 4 bakes for Customer 4890
    28 Customer 6382 requests cake
    28 Customer 3157 pays
    29 Customer 1245 leaves
    29 Customer 5123 sits
    ...

    Here, Customer 5123 requests for cake before sitting on the sofa, illegal.
    
38. Can you clarify the payment process
In example 2, we see 2 customers payment interleaved together
>27 Customer 2356 pays
...
28 Customer 3157 pays
...
29 Chef 2 accepts payment for Customer 2356
...
31 Chef 3 accepts payment for Customer 3157

The website says below
When a customer’s cake is finished, any chef can accept payment, but because **there is only one cash register**, **payment is accepted for one customer at a time**.
So how can customer 3157 pay before chef 3 has accepted payment for customer 2356, shouldn't register be locked until the chef accepts the payment

39. In Part-A, Part-1: Demand Paging,
    `At process startup (exec), do not pre-allocate or load all program pages. [10 Marks]`
    This means I can allocate SOME (not all) pages right? So can I pre-allocate some stack frames that are used during process startup?


40. In Part-C example 2:
`23 Customer 1245 requests cake`
`24 Chef 1 bakes for Customer 1245`
Here, Chef 1 bakes after 1 second

`30 Customer 5123 requests cake`
`30 Chef 1 bakes for Customer 5123`
here, chef 1 starts baking at the same timestamp. How?

41. For Part-C, can we write assumptions in README? Can we assume that customers always arrive one by one as shown in the examples?

42. For Part-C, can a customer request a cake before sitting on sofa? Or do they have to sit on sofa to request for cake?

43. For Part-C, is it necessary that the flow be sorted by timestamp? Also, is it necessary to implement threading explicitly, or can we use our own logic so long as the output is correct?

44. in phase3 should sniffing packet means should have to do all things which are done upto phase 2

45. In phase -3 filtering , does the numbering of the filtered packets matter? Can we number the packets 1,2,3,... or do they have to correspond to the index of the sniffed packet (say for http , cshark snifs packets 3 and 8 ... can it number them as 1,2 or 3,8 like wireshark does)

46. In Part-A, the specs document does not specify what has to be done on forking a child process ? Are we supposed to decide that by ourselves ?

47. In Part-A, we are specified to create swapfile during exec. So, assuming this, what do we do for a process that is forked from a parent process and not passed into exec?

48. In part-A page replacement `Replacement is triggered only when kalloc() fails (system out of frames).`, So to keep track of currently allocated pages in RAM, do we need to have maximum of 128MB / 4KB entries or we can just define some arbitary number as MAX_RESIDENT_PAGES.

49. In usertests, is it necessary for it to pass lazyalloc test as well, as ig that function tries to allocate beyond the max disk space. I am getting failed message like swap full due to disk limitations, and it shows failed test? is this acceptable?

50. in Part B, is it necessary to write cross-platform compatible code? Can I assume I'll run the code on Ubuntu/Linux?

51.`struct proc_mem_stat {
  int pid;
  int num_pages_total;     
  int num_resident_pages; 
  int num_swapped_pages;   
  int next_fifo_seq;       
  struct page_stat pages[MAX_PAGES_INFO];
};`  In this num_pages_total should include trampoline or not as it is shared between all processes.

52. If I choose the interface as bluetooth-monitor (Bluetooth Linux Monitor), and filter dns or http packets, I am not able to get any packets, ig cause interfaces like bluetooth0, bluetooth-monitor don't use standard Ethernet framing.for such cases, I am printing, Couldn't parse filter udp port 53: Bluetooth Linux Monitor link-layer type filtering not implemented. Is this fine, or is my understanding incorrect?

53. For part C, does it take 1 sec for the customer to enter and stand as well, thats not mentioned in the examples.

54. ig the usertests memory size limit is 1GB, due to which lazyalloc is not working, It's an xv6 file system limitation that prevents swap files from growing beyond ~70KB (or ~8MB with double-indirect blocks), can we ignore that testcase.

55. In part B, phase 4, do we need to store the first 10000 packets in the history or the latest 10000 packets?

56. In part C, what should be the input and output format? Do we output on file or terminal