Re: Undefined Array Triple Fault
Posted: Tue Jul 18, 2017 1:43 am
OS/2.LtG wrote:What is this favorite OS? Btw, I'm sure you've made the distinction of having an OO OS as opposed to creating an OS in an OOP language.
The Place to Start for Operating System Developers
http://f.osdev.org/
OS/2.LtG wrote:What is this favorite OS? Btw, I'm sure you've made the distinction of having an OO OS as opposed to creating an OS in an OOP language.
Definitely, these are your constructors after all.Octacone wrote:Is that my fault anyhow?dozniak wrote:Looks like one of your ctors simply overwrites Multiboot_Info memory.
I actually did that once, but I quickly realized it was not going to work.LtG wrote:Are we supposed to know/guess what _all_ of your constructors do?Octacone wrote:Is that my fault anyhow?dozniak wrote:Looks like one of your ctors simply overwrites Multiboot_Info memory.
Btw, do you make any allocations (new/malloc) in any of your constructors?
So I can't blame the compiler, such a shame.dozniak wrote:Definitely, these are your constructors after all.Octacone wrote:Is that my fault anyhow?dozniak wrote:Looks like one of your ctors simply overwrites Multiboot_Info memory.
Couldn't agree more.iansjack wrote:C++ is, indeed, a very capable language. But using it doesn't automatically make a person a very capable programmer.
Is your interrupt handler corrupting your memory?Octacone wrote:Edit: I removed my previous post, it is not fixed.
Actually GRUB memory issue was fixed, but the main issue is still there.
Now -O2 and no -O2 have switched their places.
-O2 = triple fault
-No -O2 = everything is okay
When I disabled the interrupts/paging it doesn't crash.
The longer this thread goes on the clearer it becomes that you don't seem to have the basic fundamental understanding required:Octacone wrote:It looks like all the battles have been lost. Since I cannot debug anymore, GDB doesn't work with optimizations enabled.
The only way I can stop this "bug" from happening is to disable paging or interrupts.
So >> No shell array, kernel works just fine, everything is okay, paging works. But still page_directory->physical_page_tables returns 0x0. Why does compile put that at 0x0.
@LtG about what you asked earlier:
virtual page tables* ----> pages and their flags //allocations needed
physical page tables ----> address of above page tables and their flags //allocation not needed, compiler placed
That is very very very wrong. I do have everything needed to work on a project like this. I do have a basic (more than that obviously) understanding of C/C++ and pointers. I've been programming in .NET languages for years working on small and casual projects.LtG wrote:The longer this thread goes on the clearer it becomes that you don't seem to have the basic fundamental understanding required:Octacone wrote:It looks like all the battles have been lost. Since I cannot debug anymore, GDB doesn't work with optimizations enabled.
The only way I can stop this "bug" from happening is to disable paging or interrupts.
So >> No shell array, kernel works just fine, everything is okay, paging works. But still page_directory->physical_page_tables returns 0x0. Why does compile put that at 0x0.
@LtG about what you asked earlier:
virtual page tables* ----> pages and their flags //allocations needed
physical page tables ----> address of above page tables and their flags //allocation not needed, compiler placed
- C/C++
- Pointers in languages like C/C++
- Paging
You seem to be under the illusion that once you find and fix the next bug it's going to work, when in fact you should actually learn the basic concepts and then either start from scratch or go thru all of your code and fixing all of it.
Not sure if it's just me, but I've actually thought that you're a troll based on your replies in this thread... Not really any specific reply but rather the whole thread itself..
Good, it shouldn't.Octacone wrote: A simple bug is not going to stop me for working on my dream project. Right now I am going trough all of my code fixing everything I can see, also the bug has gone away.
As I said, based on the replies in _this_ thread. It might as well be because of lack of experience. Trolls often employ techniques such as:Octacone wrote: Why would you think I'd be trolling? That is such nonsense.
It might seem at first like I have no clue what is going on, I don't quite have a clue when it comes to this specific case, but generally speaking I do indeed.
Unless you do extreme unit testing, a debugger (gdb or something else) is your best friend. Even if you ignore all the fancy stuff, the very basic feature of being able to check register contents and single-stepping is all you really need, and that doesn't require gdb knowledge. Of course you will very quickly get tired of single-stepping which is where break points come in, but still no gdb knowledge required.Octacone wrote: My debugging skill are not as good as yours but I am trying, this is actually the first time I've used GDB, ever.
None of us have seen all of your code, so are you suggesting none of us should have responded?Octacone wrote: It seems like you don't understand how paging works either, because you are questioning my design choices without even ever taking a look at it fully.
Trial and error is not a good way to solve anything, especially when done in this manner. From my perspective it seemed like you wanted to try _anything_ that might work, and you shouldn't. You should try to understand the problem and then fix it. Often we think trying random things is easier/faster, but in reality it's often (almost always) more beneficial to stop, learn, then fix. But we tend to think the learning will take too long and thus want to skip it.Octacone wrote: Sorry if this thread looks "dumb" to you, but that is how trial and error looks like.
Probably a good idea to drop this thread, allows the next to start fresh at a specific problem.. As for PM, I usually avoid those as they don't contribute as much to the public knowledge base.. Similar to in some cases people reply to their own threads: "I solved it!", which is incredibly annoying two years later for the next guy who now believes a solution exists but doesn't get to know what it is =)Octacone wrote: Since I fixed the bug by properly allocating strings (bunch of them actually) I mark this topic closed. @LtG if you have any further question feel free to PM me.
In my experience, people who post "I solved it" rarely have done so. At least not the real problem. Making a bug, apparently, go away without understanding why is not a solution. It's another problem waiting to rear its ugly head.LtG wrote:Probably a good idea to drop this thread, allows the next to start fresh at a specific problem....Similar to in some cases people reply to their own threads: "I solved it!", which is incredibly annoying two years later for the next guy who now believes a solution exists but doesn't get to know what it is =)Octacone wrote: Since I fixed the bug by properly allocating strings (bunch of them actually) I mark this topic closed. @LtG if you have any further question feel free to PM me.