No Idea How To Debug This
Posted: Sat Dec 29, 2018 7:26 pm
Hello first post here!
Full disclosure, this is for a class. I am having a bit of a problem with my OS.
Everything works within the kernel, however when I try to run a program outside
the kernel (the shell), I seem to experience a plethora of undefined behavior.
I defined a custom service routine for interrupt 21, and it works fine in the kernel,
however it seems to cause a processor panic when called from the shell. Loops seem
to cause undefined behavior in the shell as well. I tried to get help with another programmer
with this, and although he couldn't figure this out either he seemed to get a processor panic
when he tried to do a loop in the shell (however I did not). Other interrupts seem to work
fine though for the most part. I think this has something to do with the IVT, and more
specifically interrupt 21, however I am unsure about this as when the ISR for interrupt 21 is not
initialized and not called similar problems can still arise. Even if it does have something to do with the IVT
I do not know how I would go about debugging it (tried looking through the memory view on the emulator
but I am unsure if I was looking in the right place), and if its not the IVT I have no idea what it is.
I have been stuck on this issue for quite a while and need to move on in the assignment,
(professor is unavailable) if anyone can help me figure out how to debug this or figure out
what the problem is it would be very helpful, here is the os https://nofile.io/f/0ewTS042E9Y/OS.zip
and this is the emulator its meant to target: https://github.com/mdblack/simulator
The compiler is bcc (Bruce's C Compiler), all the build scripts included should work on linux and there are debug.bat and
build.bat for Windows Subsystem for Linux.
Thank you
- cgbsu
P.s For some reason it needs memcpy, even though I dont call it, there is no c standard library linked
and I dont call it, but this seems to be some sort of optimization or something, so I implemented it, if
anyone knows how to get bcc to stop doing this, please let me know. Iv wondered if it has something to do with this.
Full disclosure, this is for a class. I am having a bit of a problem with my OS.
Everything works within the kernel, however when I try to run a program outside
the kernel (the shell), I seem to experience a plethora of undefined behavior.
I defined a custom service routine for interrupt 21, and it works fine in the kernel,
however it seems to cause a processor panic when called from the shell. Loops seem
to cause undefined behavior in the shell as well. I tried to get help with another programmer
with this, and although he couldn't figure this out either he seemed to get a processor panic
when he tried to do a loop in the shell (however I did not). Other interrupts seem to work
fine though for the most part. I think this has something to do with the IVT, and more
specifically interrupt 21, however I am unsure about this as when the ISR for interrupt 21 is not
initialized and not called similar problems can still arise. Even if it does have something to do with the IVT
I do not know how I would go about debugging it (tried looking through the memory view on the emulator
but I am unsure if I was looking in the right place), and if its not the IVT I have no idea what it is.
I have been stuck on this issue for quite a while and need to move on in the assignment,
(professor is unavailable) if anyone can help me figure out how to debug this or figure out
what the problem is it would be very helpful, here is the os https://nofile.io/f/0ewTS042E9Y/OS.zip
and this is the emulator its meant to target: https://github.com/mdblack/simulator
The compiler is bcc (Bruce's C Compiler), all the build scripts included should work on linux and there are debug.bat and
build.bat for Windows Subsystem for Linux.
Thank you
- cgbsu
P.s For some reason it needs memcpy, even though I dont call it, there is no c standard library linked
and I dont call it, but this seems to be some sort of optimization or something, so I implemented it, if
anyone knows how to get bcc to stop doing this, please let me know. Iv wondered if it has something to do with this.