Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
00015055744i[CPU0 ] 0x0000000000008121>> jmpf 0x0008:058e : EA8E050800
00015055744e[CPU0 ] exception(): 3rd (13) exception with no resolution, shutdown status is 00h, resetting
ok i found the problem :
i forgot to set es:bx to 0x0000:0x0500 so the program wasnt loaded there it was loaded to 0x07c0:0x0500 .. i could be so stupid
Realtime wrote:ok i found the problem :
i forgot to set es:bx to 0x0000:0x0500 so the program wasnt loaded there it was loaded to 0x07c0:0x0500 .. i could be so stupid
I wouldn't feel too bad. I'm pretty sure this exact bug has happened to every single OS (or at least Boot Loader) developer on this site...
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Realtime wrote:ok i found the problem :
i forgot to set es:bx to 0x0000:0x0500 so the program wasnt loaded there it was loaded to 0x07c0:0x0500 .. i could be so stupid
I wouldn't feel too bad. I'm pretty sure this exact bug has happened to every single OS (or at least Boot Loader) developer on this site...
What about this .. im getting another bug -.- .. kernel doesnt seem to be doing anything after that far jump .. nothing happens no matter what i write there
You can step through it in Bochs (one instruction at a time) and see where your code is going, and what it is executing. That should give you a clue.
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
I do see that your stack (as per your first post) is located in reserved memory, and that you are trashing in BIOS space
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Later in protected mode he follows the assignment to the SS selector with an assignment to ES and then the assignment to ESP, again not likely to be helpful.
ok, first your initial stack setup is in the wrong part of memory:
you are setting the stack to 9000:FFFF -- this area is usually reserved for the BIOS, so that it can use this memory -- check the memory usage map using the BIOS functions or place it in an area that is not likely to be used
also, you should always set eSP to an even number -- for example, instead of setting it to 0xFFFF set it to 0 (the CPU will subtract before pushing, so the first value pushed will actually be located at 0xFFFE -- which is probably what you wanted anyway)
the second problem is with your PMode stack setting (although this isn't really a problem)
always set ESP immediately after setting SS... the CPU automatically prevents interrupts for 1 instruction after setting SS to give you time to set eSP also, but you are setting another register in between, which means, you set SS, interrupts are disabled while you set ES, then they are enabled again before you set ESP -- and still have an invalid stack (this really isn't an issue right now, since you don't have a valid IDT set up you will triple-fault anyway, but its good practice)
JAAman wrote:ok, first your initial stack setup is in the wrong part of memory:
you are setting the stack to 9000:FFFF -- this area is usually reserved for the BIOS, so that it can use this memory -- check the memory usage map using the BIOS functions or place it in an area that is not likely to be used
also, you should always set eSP to an even number -- for example, instead of setting it to 0xFFFF set it to 0 (the CPU will subtract before pushing, so the first value pushed will actually be located at 0xFFFE -- which is probably what you wanted anyway)
the second problem is with your PMode stack setting (although this isn't really a problem)
always set ESP immediately after setting SS... the CPU automatically prevents interrupts for 1 instruction after setting SS to give you time to set eSP also, but you are setting another register in between, which means, you set SS, interrupts are disabled while you set ES, then they are enabled again before you set ESP -- and still have an invalid stack (this really isn't an issue right now, since you don't have a valid IDT set up you will triple-fault anyway, but its good practice)
seems complicated .. i guess its better if i start with an existing bootsloader , and do my own after i learn ..
you just need to make sure you don't put your stack in unavailable memory -- just like you wouldn't put it in ROM, or in the IDT, you can't put it in space already being used by another program -- you can ask the BIOS where available memory is, or (simpler) just use an area of memory that you know isn't already being used (most people place it directly below the boot sector at 0:7C00)
you just need to make sure you don't put your stack in unavailable memory -- just like you wouldn't put it in ROM, or in the IDT, you can't put it in space already being used by another program -- you can ask the BIOS where available memory is, or (simpler) just use an area of memory that you know isn't already being used (most people place it directly below the boot sector at 0:7C00)
well i started to understand thacks to brokenthorn (osdev is also helpful however its more of based on advanced things rather than teaching beginners) .. i think i can make my own soon ..
the reason i want to use my own is cuz i got great fs ideas .. most orginal one is called MOFS .. tho i dont think ill use that as its bad