I am using int 15h, E820h to get the total memory from my computer. I have noticed that this piece of code I wrote works perfectly on BOCHS but when I goto test it on my pc, it bombs (nothing is printed to the screen, cursor flashes for a while and then it reboots).
I wonder if it might be my computer considering its very old and outdated. Is this memory detection routine like when you try to enable the A20 gate. On some computers one method wont work. Could this be the case?
Let me know if you need to look at the code.
Thanks in advance.
problem with detecting memory
Re:problem with detecting memory
e820 isn't available on earlier BIOS, however all BIOS should set the carry flag if it isn't. Drop back to e801 if e820 isn't available, e801 is fairly universal.
Re:problem with detecting memory
update on problem:
For some reason not one of the three methods for detecting memory works except direct probing. I notice after I test lets say, int 15h, e802h, It bombs (cursor flashes, then reboots with nothing printed on the screen). I then commented out the code I wrote and then try to test with a simple print message and I get the same result.
If I completely get rid of the code by using my old copies of code, it will boot up fine. IT will then bomb again if I try to add the memory detecting code.
Does anybody know what could be wrong? Am I somehow overwiting something like reserved memory areas?
For some reason not one of the three methods for detecting memory works except direct probing. I notice after I test lets say, int 15h, e802h, It bombs (cursor flashes, then reboots with nothing printed on the screen). I then commented out the code I wrote and then try to test with a simple print message and I get the same result.
If I completely get rid of the code by using my old copies of code, it will boot up fine. IT will then bomb again if I try to add the memory detecting code.
Does anybody know what could be wrong? Am I somehow overwiting something like reserved memory areas?
Re:problem with detecting memory
Hmm.
I had a similar problem a while back. For me it turned out that I had loaded one sector too few from the disk, so once I reached a certain point in my kernel it started trying to run random code.
Another fun one was crossing a 64k boundary and overwriting the start of the kernel with the end of the kernel which also made things go bang in amusing ways.
Perhaps you've got something similar happening.
I had a similar problem a while back. For me it turned out that I had loaded one sector too few from the disk, so once I reached a certain point in my kernel it started trying to run random code.
Another fun one was crossing a 64k boundary and overwriting the start of the kernel with the end of the kernel which also made things go bang in amusing ways.
Perhaps you've got something similar happening.
Re:problem with detecting memory
Thanks for the help curufir. This was exactly my problem. I was only loading one sector too few.I had a similar problem a while back. For me it turned out that I had loaded one sector too few from the disk, so once I reached a certain point in my kernel it started trying to run random code.
How could I check for this?Another fun one was crossing a 64k boundary and overwriting the start of the kernel with the end of the kernel which also made things go bang in amusing ways.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:problem with detecting memory
Make sure the 'load address' for your kernel is 64KB-alignedbeyondsociety wrote:How could I check for this?Another fun one was crossing a 64k boundary and overwriting the start of the kernel with the end of the kernel which also made things go bang in amusing ways.
