OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 2:53 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Handling 64bit MMIO BAR in 32bit OS
PostPosted: Sun Nov 27, 2022 4:01 am 
Offline
Member
Member
User avatar

Joined: Sat Oct 23, 2004 11:00 pm
Posts: 154
Hi,

For my OS dev, I use QEMU and TianoCore OVMF (both 32bit & 64bit - downloaded from sourceforge. On QEMU, my OS works fine with both 32bit OVMF and 64bit OVMF while my OS itself is a 32bit protected mode OS (developed for x86 platform)

I recently decided to locally build and use the latest stable tag of OVMF from: https://github.com/tianocore/edk2.git

I was able to build 3 different variants - OvmfIa32, Ovmf3264 and OvmfX64

My OS works fine when using OvmfIa32, however when using Ovmf3264, the XHCI controller initialization in my OS fails because the BAR address is a 64 bit address while I can only map 32bit address

Is it correct for the firmware to assign 64bit BAR to a PCI device while loading a 32bit OS ? If so, how to handle this scenario ? (b/w the problem doesn't happen on my laptop that runs on i7 processor)

Thanks
Prajwal

_________________
complexity is the core of simplicity


Top
 Profile  
 
 Post subject: Re: Handling 64bit MMIO BAR in 32bit OS
PostPosted: Sun Nov 27, 2022 6:01 am 
Offline
Member
Member

Joined: Sun Apr 05, 2020 1:01 pm
Posts: 182
prajwal wrote:
Hi,

For my OS dev, I use QEMU and TianoCore OVMF (both 32bit & 64bit - downloaded from sourceforge. On QEMU, my OS works fine with both 32bit OVMF and 64bit OVMF while my OS itself is a 32bit protected mode OS (developed for x86 platform)

I recently decided to locally build and use the latest stable tag of OVMF from: https://github.com/tianocore/edk2.git

I was able to build 3 different variants - OvmfIa32, Ovmf3264 and OvmfX64

My OS works fine when using OvmfIa32, however when using Ovmf3264, the XHCI controller initialization in my OS fails because the BAR address is a 64 bit address while I can only map 32bit address

Is it correct for the firmware to assign 64bit BAR to a PCI device while loading a 32bit OS ? If so, how to handle this scenario ? (b/w the problem doesn't happen on my laptop that runs on i7 processor)

Thanks
Prajwal

Simple, don't support non-PAE 32 bit. Problem solved. This is only < 2000 hardware anyways.


Top
 Profile  
 
 Post subject: Re: Handling 64bit MMIO BAR in 32bit OS
PostPosted: Sun Nov 27, 2022 6:37 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
Exactly. A computer that is 32-bit only won't have a 64-bit UEFI.


Top
 Profile  
 
 Post subject: Re: Handling 64bit MMIO BAR in 32bit OS
PostPosted: Sun Nov 27, 2022 6:40 am 
Offline
Member
Member
User avatar

Joined: Sat Oct 23, 2004 11:00 pm
Posts: 154
Is there way to configure OVMF to assign only 32bit BAR to PCI devices ? Wouldn't it be correct for OVMF to do that by default to make it compatible for both 32bit and 64bit OS to run - particularly when it is built with config to support both IA32 and X64 ARCH.

_________________
complexity is the core of simplicity


Top
 Profile  
 
 Post subject: Re: Handling 64bit MMIO BAR in 32bit OS
PostPosted: Sun Nov 27, 2022 8:41 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
If you are using the 64 bit OVMF you must have a 64-bit capable processor. So, even if your OS is 32-bit, you can use PAE to access 64-bit addresses.


Top
 Profile  
 
 Post subject: Re: Handling 64bit MMIO BAR in 32bit OS
PostPosted: Mon Nov 28, 2022 5:12 am 
Offline
Member
Member
User avatar

Joined: Sat Oct 23, 2004 11:00 pm
Posts: 154
Got it! Thanks for clarifying.

_________________
complexity is the core of simplicity


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot], nullplan and 49 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