OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 6:27 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: [Solved] Is UEFI supposed to reserve AHCI memory regions?
PostPosted: Sun Apr 10, 2022 4:48 pm 
Offline
Member
Member

Joined: Fri May 20, 2016 2:29 pm
Posts: 77
Location: Paris, France
Hi!

I see that an AHCI descriptor block's location is given by the corresponding PCI device's BAR. However, I do not see this same memory range being reserved in the UEFI memory map (in QEMU).

Since UEFI performs some initialization of SATA drives, I would have hoped that it would reserve the appropriate memory regions. I haven't found the documentation declaring whether this is UEFI's remit, but perhaps I've missed it in the UEFI spec.

If I am intended to preserve this memory region, I am concerned that I am clobbering other device's memory without realizing. I am also concerned that my driver might not come up fast enough to prevent this memory being handed out, though this seems like a theoretical worry only for the moment.

If anyone could shed info or insight, I would be grateful. Thanks!

_________________
www.github.com/codyd51/axle.git


Last edited by codyd51 on Mon Apr 11, 2022 12:05 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Is UEFI supposed to reserve AHCI memory regions?
PostPosted: Sun Apr 10, 2022 5:35 pm 
Offline
Member
Member

Joined: Sun Jun 23, 2019 5:36 pm
Posts: 618
Location: North Dakota, United States
I assume your writing a UEFI driver. In that case, the driver itself will reserve the memory so long as exitBootServices has not been called. I'm not sure though how that affects the memory map -- I'd assume such memory would be marked as reserved if you acquire the memory map *before* you call ExitBootServices.


Top
 Profile  
 
 Post subject: Re: Is UEFI supposed to reserve AHCI memory regions?
PostPosted: Sun Apr 10, 2022 6:43 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
Are you talking about the HBA memory registers, or are you talking about the RAM used by the UEFI AHCI driver?

If you're talking about the HBA memory registers, those aren't in the memory map at all.

If you're talking about the RAM used by the UEFI AHCI driver, that's not supposed to be reserved because your AHCI driver must allocate its own memory instead of trying to reuse the same memory as the UEFI AHCI driver.


Top
 Profile  
 
 Post subject: Re: Is UEFI supposed to reserve AHCI memory regions?
PostPosted: Mon Apr 11, 2022 12:05 am 
Offline
Member
Member

Joined: Fri May 20, 2016 2:29 pm
Posts: 77
Location: Paris, France
Thanks, both. I'll mark this post as [Solved].

Octocontrabass wrote:
Are you talking about the HBA memory registers, or are you talking about the RAM used by the UEFI AHCI driver?


I was talking about the HBA memory registers.

_________________
www.github.com/codyd51/axle.git


Top
 Profile  
 
 Post subject: Re: [Solved] Is UEFI supposed to reserve AHCI memory regions
PostPosted: Mon Apr 11, 2022 5:21 pm 
Offline
Member
Member

Joined: Sun Jun 23, 2019 5:36 pm
Posts: 618
Location: North Dakota, United States
Oh, I thought you were talking about the driver that TianoCore/EDK2/<insert UEFI implementation here> uses. In that case no, those definitely won't appear in the memory map -- they're not supposed to. They would most likely show up as a huge block of free memory or MMIO RAM. I suspect that it'd be marked as free RAM though.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 54 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