VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

Does the BIU work with logical or physical addresses when fetching a byte/word/dword from a random memort location? I imagine problems when fetching a dword spanning two memory pages(e.g. at logical address 4094, being a unaligned dword read from two pages)? Currently, my BIU works with physical addresses only, but when such an access occurs, it'll actually fetch the top half from a different page than it's supposed to?

Of course that's only the case for normal read/write accesses(not prefetch, which runs at a segmented addressing layer).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 1 of 2, by vladstamate

User metadata
Rank Oldbie
Rank
Oldbie

I like to think of the BIU as operating on logical addresses. It really depends what is BIU for you. According to this 386 diagram: https://en.wikipedia.org/wiki/Intel_80386#/me … 0386DX_arch.png for me EA is the Segmentation Unit, MMU is the Paging Unit and BIU is the stuff at the bottom (prefetcher). For me BIU is the part of the emulator that gets all the requests for read and write to memory and talk to the memory. But to do that it needs to translate linear addresses in physical addresses. So the input address are linear addresses.

If BIU does something else for you, it could operate with physical memory address (like the part to the right of the picture).

YouTube channel: https://www.youtube.com/channel/UC7HbC_nq8t1S9l7qGYL0mTA
Collection: http://www.digiloguemuseum.com/index.html
Emulator: https://sites.google.com/site/capex86/
Raytracer: https://sites.google.com/site/opaqueraytracer/

Reply 2 of 2, by superfury

User metadata
Rank l33t++
Rank
l33t++

Currently that's the case in UniPCemu as well(except the EA unit is a part of the EU instruction fetching in my emulation). Except that the BIU operates on both logical(also support for physical) on the request side(for communicating with the EU) and segmented addresses(segmented addresses being used in the case of the prefetch unit emulation). Although both are called from the same function(CPU_tickBIU) and are handled in parallel with the EU(which either requests through the BIU interface for logical/physical addresses, while the prefetch when no memory requests are pending uses the segmentation on top of that(mainly to provide 8086 support, which requires IP rollover, which is segmented)).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io