Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 image text in transcribed

Here is the result running in the qemu

image text in transcribed

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 proc

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analytics Systems Engineering Cybersecurity Project Management

Authors: Christopher Greco

1st Edition

168392648X, 978-1683926481

More Books

Students also viewed these Databases questions

Question

I am paid fairly for the work I do.

Answered: 1 week ago

Question

I receive the training I need to do my job well.

Answered: 1 week ago