OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 19, 2024 7:45 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 39 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Re: (hardware) reserved memory & GDT question
PostPosted: Wed Apr 24, 2013 9:43 am 
Offline
Member
Member

Joined: Sun Mar 03, 2013 3:27 pm
Posts: 33
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 ... :D )


Top
 Profile  
 
 Post subject: Re: (hardware) reserved memory & GDT question
PostPosted: Wed Apr 24, 2013 9:45 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
makuc9 wrote:
does always
Assumption is the mother of all (...)

_________________
"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 ]


Top
 Profile  
 
 Post subject: Re: (hardware) reserved memory & GDT question
PostPosted: Wed Apr 24, 2013 10:13 am 
Offline
Member
Member
User avatar

Joined: Sun Oct 22, 2006 7:01 am
Posts: 2646
Location: Devon, UK
Hi,

makuc9 wrote:
Just so I do not implement any complex mechanism for storing each CL as well ...

Why is storing CL complex?

Cheers,
Adam


Top
 Profile  
 
 Post subject: Re: (hardware) reserved memory & GDT question
PostPosted: Wed Apr 24, 2013 10:32 am 
Offline
Member
Member

Joined: Sun Mar 03, 2013 3:27 pm
Posts: 33
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...


Top
 Profile  
 
 Post subject: Re: (hardware) reserved memory & GDT question
PostPosted: Wed Apr 24, 2013 10:44 am 
Offline
Member
Member
User avatar

Joined: Wed Dec 01, 2010 3:41 am
Posts: 1761
Location: Hong Kong
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)


Top
 Profile  
 
 Post subject: Re: (hardware) reserved memory & GDT question
PostPosted: Wed Apr 24, 2013 1:11 pm 
Offline
Member
Member

Joined: Sun Mar 03, 2013 3:27 pm
Posts: 33
Thank you, bluemoon. That helped.
And now, here is the (i guess) correct memory map (presented hex-dump):
Image
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).


Top
 Profile  
 
 Post subject: Re: (hardware) reserved memory & GDT question
PostPosted: Wed Apr 24, 2013 1:34 pm 
Offline
Member
Member
User avatar

Joined: Thu Jul 12, 2012 7:29 am
Posts: 723
Location: Tallinn, Estonia
bluemoon wrote:
you provided 24 bytes zero for it
4. ECX=24, good, check if acpi bit is set, clear the field if otherwise


Other than that, the map looks better now.

_________________
Learn to read.


Top
 Profile  
 
 Post subject: Re: (hardware) reserved memory & GDT question
PostPosted: Wed Apr 24, 2013 2:04 pm 
Offline
Member
Member

Joined: Sun Mar 03, 2013 3:27 pm
Posts: 33
Thank you for your feedback. Will be fixing this little issue shortly and afterwards finally move forward. :D


Top
 Profile  
 
 Post subject: Re: (hardware) reserved memory & GDT question
PostPosted: Wed Apr 24, 2013 2:14 pm 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
bluemoon wrote:
If you provided 24 bytes zero for it
And if you do provide garbage, some bioses will refuse to clear it up and leave the garbage where you'd expect zeroes.

In other words, zeroing the destination memory is mandatory.

_________________
"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 ]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 39 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 81 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group