m12: Than I don't really know why you wrote that comment (about assuming too much) in the first place ... But let's head back to the topic.
I have re-written the function from scratch and now I have been wondering (before I post the hex dump), does calling E820h always return the same size in CL register? (Just so I do not implement any complex mechanism for storing each CL as well ... )
(hardware) reserved memory & GDT question
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: (hardware) reserved memory & GDT question
Assumption is the mother of all (...)makuc9 wrote:does always
Re: (hardware) reserved memory & GDT question
Hi,
Cheers,
Adam
Why is storing CL complex?makuc9 wrote:Just so I do not implement any complex mechanism for storing each CL as well ...
Cheers,
Adam
Re: (hardware) reserved memory & GDT question
Well, storing each returned CL and associating it with entry it was returned with can be (altough not necessarily, but I could start complicating things without any real purpose and discovering an easier method later...). That's why I was asking. Is there any point in saving every CL (MM entry size) I get returned? (if not, don't you think that would be pointless memory loss?)
One CL would be saved anyway...
One CL would be saved anyway...
Re: (hardware) reserved memory & GDT question
If you provided 24 bytes zero for it, there are 5 possibilities:
1. return ECX < 20, something is seriously wrong with the BIOS
2. return ECX=20, the last 4 bytes is not touch and you automatically have zero for the supposed ACPI field.
3. ECX=21,22,23. something is seriously wrong with the BIOS
4. ECX=24, good, check if acpi bit is set, clear the field if otherwise
5. ECX>24, something is seriously wrong with the BIOS
I don't see why you need to store CL (or ECX)
1. return ECX < 20, something is seriously wrong with the BIOS
2. return ECX=20, the last 4 bytes is not touch and you automatically have zero for the supposed ACPI field.
3. ECX=21,22,23. something is seriously wrong with the BIOS
4. ECX=24, good, check if acpi bit is set, clear the field if otherwise
5. ECX>24, something is seriously wrong with the BIOS
I don't see why you need to store CL (or ECX)
Re: (hardware) reserved memory & GDT question
Thank you, bluemoon. That helped.
And now, here is the (i guess) correct memory map (presented hex-dump):
So, is it correct this time? (i am still working on function to display it better properly, but for some reason it is never the same as reversed this by hand ...). I will update this post once I finish. Last for bytes are trash (uncleaned memory, since function only returns 20 bytes. It would notify me if it is 24 or give error if anything else. I made all the tests as bluemoon said there should be).
And now, here is the (i guess) correct memory map (presented hex-dump):
So, is it correct this time? (i am still working on function to display it better properly, but for some reason it is never the same as reversed this by hand ...). I will update this post once I finish. Last for bytes are trash (uncleaned memory, since function only returns 20 bytes. It would notify me if it is 24 or give error if anything else. I made all the tests as bluemoon said there should be).
Re: (hardware) reserved memory & GDT question
Other than that, the map looks better now.bluemoon wrote: you provided 24 bytes zero for it
4. ECX=24, good, check if acpi bit is set, clear the field if otherwise
Learn to read.
Re: (hardware) reserved memory & GDT question
Thank you for your feedback. Will be fixing this little issue shortly and afterwards finally move forward.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: (hardware) reserved memory & GDT question
And if you do provide garbage, some bioses will refuse to clear it up and leave the garbage where you'd expect zeroes.bluemoon wrote:If you provided 24 bytes zero for it
In other words, zeroing the destination memory is mandatory.