Page code seems to be correct however, info_mem Page Disabled.
Not easy, Henry helped us. The first syntax error is that all my bits in the struct are flipped since the least significant bit should be on top and the most significant bit should be at the bottom.
Second main issue is that even though our struct is created, there is nothing in it. So the kernel do not know what to do with them. So we need to initialize the struct. The 4MB is for kernel. The video memory one is another bug in this.
After init IDT, it will cause double fault
Need to initialize PIC before enable interrupt. PIC code is also buggy.
Keyboard can puts all characters and numbers, including ctrl and shift. But when trying to add the input to the buffer, it will output page fault exception.
easy. use puts instead of puc
Cursor position is not at thte correct location afte enter/backspace.
medium, write out own function of kbd_putc to handle kbd input. But the putc is fixed after that.
read dentry by name and read dentry by index causing page fault
easy, there are a lots of pointer type casting and pointer manipulations going on. So there might be a situation where the program read an invalid address or reaching a null pointer, causing page fault exception. To fix the bug, we re-examine all the pointer type casting and pointer manipulation part of the function, and change all unmatching pointer type to the expected pointer type
Page fault exception fired when dentry struct global variable is used
easy, when initializing global variables, compiler initializes all the global and static variable to 0 (for pointer type, the pointer variable is initialized to NULL). Since the global dentry struct we used at the first time is a struct pointer, the program fires page fault exception when we tries to dereferencing it.
file read only works for some specific files. not all valid files can be read.
For example, frame0.txt can be read but frame1.txt cannot
easy, to fix the bug we rewrote the function that is used to find the data blocks.
Not able to print new line for "ls"
Not too difficult. In our terminal write, we will terminates the buffer with a null at index 32, then we will break. However, this implementation will not allow "ls" program to insert "/n". So we basically comment taht line our.
After execute, there will be page fault. We find that when we try to return from halt, our parent esp and parent ebp is not working correctly.
Easy. Since it is after execute, so we have a pretty good idea that it is in the halt.
Difficult. We did not understand our execute with parent process and child process correctly. So Henry helped us to debug and clarify what's going on. So when halting child process, the child should return to child execute first before return to parent halt/process.
In our shell terminal, when we do backspace, we could even delete "391OS> ".
Easy. Since we know this is definitely from our keyboard function.
Easy. In our terminal.c:handle_backspace, we need to make sure that when the buffer is empty, we cannot do backspace.
Whenever we do something, our terminal will print multiple times.
Easy. Since we know this is definitely from our keyboard function.
Medium. Henry pointed the error location. The fix took awhile since we need to implement a way to prevent multiple press due to human interaction time and CPU respond time.
When switching terminals, the terminals will be able to open, but the keyboard is freezing and we cannot type
Hard. We initially fail to find where the problem is. We discuss with other students, and we figure out that we need to send eoi when switching terminals.
Easy. Just add a line of endeoi when switching terminals.
Open terminal will page fault immediately
Hard. We asked for help from both Okan and Edward. Okan helped us greatly by guessing and checking. Then we were able to identify the bug.
Open second, and third terminal will page fault immediately
Our teammate Dongming was able to fix the second page fault, but we still have the third terminal that has page fault.
Terminal one runs pingpong. Open terminal two next. When switching back to terminal one, pingpong stops and outputs page fault. Then, terminal one runs pingpong again, and we switches to terminal three. When we switches back from terminal three to terminal one, pingpong in terminal one stops and outputs general protection fault
It is hard to step through the entire program to see which part causes the exception. This only happened when all the terminals are not opened
To fix this, we need to set up esp and ebp before executing new shells
Printing has a glitch when constantly switching between terminals
Hard to find. The display terminal index and scheduled terminal index are not change correctly
Re-map the scheduling video cursor after the display memory finishes changing