Description
Good afternoon! While working through Lesson 23, I encountered an issue when running the code. After compiling and starting the machine, I invoked PAGE(kmalloc() in kernel) and observed that the console began endlessly displaying error messages:
received interrupt: 6
Invalid Opcode
Steps to Reproduce
- Compile the code from Lesson 23.
- Start the machine.
- Call
PAGE.
Issue
The console floods with the above error messages without stopping.
Debugging Attempts
I tried debugging with gdb, but it didn’t help. Upon reviewing and modifying the code manually, I found the cause of the issue: the variables char page_str[16] and char phys_str[16] were initialized with empty strings, which triggered this problem.
Solution
After removing the empty string initialization, the issue was resolved. I suggest modifying the following lines in the code:
// kernel/kernel.c
void user_input(char *input) {
// Change this:
char page_str[16] = "";
char phys_str[16] = "";
// To this:
char page_str[16];
char phys_str[16];
}
Description
Good afternoon! While working through Lesson 23, I encountered an issue when running the code. After compiling and starting the machine, I invoked
PAGE(kmalloc() in kernel) and observed that the console began endlessly displaying error messages:received interrupt: 6
Invalid Opcode
Steps to Reproduce
PAGE.Issue
The console floods with the above error messages without stopping.
Debugging Attempts
I tried debugging with
gdb, but it didn’t help. Upon reviewing and modifying the code manually, I found the cause of the issue: the variableschar page_str[16]andchar phys_str[16]were initialized with empty strings, which triggered this problem.Solution
After removing the empty string initialization, the issue was resolved. I suggest modifying the following lines in the code: