I am trying to implement lottery scheduling in xv6, and I seem to face an error. I need help with the debugging directions. Here is my code:
In proc.c
I modified function void scheduler and added a new function for random number generation:
unsigned long next=1;
int randomGen(int rand_max){
next = next * 1103515245 + 12345;
int rand=((unsigned)(next/65536) % 32768);
//above are the default implemenation of random generator with random max value 32768
//need to map it to the
int result =rand % rand_max+1;
return result;
}
When I trying booting the emulator and kernel using qemu, after I press continue, I get this error:
panic: init exiting 80104478 80106210 80105461 80106729 8010651d 0 0 0 0 0
It seems to be coming from log.c