Question
I have been working on a xv6 / vscode program that will take a file and count the u and d in a file and
I have been working on a xv6 / vscode program that will take a file and count the u and d in a file and all the other letters go to standard error. The program works fine when the command is in the terminal but when I call 'make qemu' and then call countUD in the qemu I get this error:
pid 3 countud: trap 14 err 5 on cpu 0 eip 0xffffffff addr 0xffffffff--kill proc
I do not fully understand this error and how I would troubleshoot it. Here is my code in the xv6 in c.
#include "types.h" #include "stat.h" #include "user.h"
int main(int argc, const char *argv[]){ int UDcount = 0; int otherCount = 0;
for(int i = 1; i fd){ printf(1,"opening to: %d ",2); }else{ char buffer[1] = {0}; int status = 0; status = read(fd,buffer,0); do{ if((*buffer == 'U' )| (*buffer == 'u' )| (*buffer == 'D' )| (*buffer == 'd')){ UDcount++; } else{ otherCount++; } status = read(fd,buffer,0); }while(0
Here is the code running the terminal fine
Here is the result running in the qemu
I would like to know how I would read this error and fix the error.
Thank you.
osboxes@osboxes /xv6 (master) $ countUD cat.c the UD count: 20 The no UD count: 569 countUD cat.c pening to: 2 'he UD count: The no UD count: id 3 countuD: trap 14 err 5 on cpu 0 eip Oxffffffff addr Oxffffffff--kill procStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started