x86 BIU vs paging?

Emulation of old PCs, PC hardware, or PC peripherals.

x86 BIU vs paging?

Postby superfury » 2018-8-11 @ 08:30

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).
superfury
l33t
 
Posts: 2615
Joined: 2014-3-08 @ 11:25
Location: Netherlands

Re: x86 BIU vs paging?

Postby vladstamate » 2018-8-16 @ 14:37

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_803 ... X_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).
User avatar
vladstamate
Oldbie
 
Posts: 856
Joined: 2015-8-23 @ 01:43

Re: x86 BIU vs paging?

Postby superfury » 2018-8-16 @ 18:31

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)).
superfury
l33t
 
Posts: 2615
Joined: 2014-3-08 @ 11:25
Location: Netherlands


Return to PC Emulation

Who is online

Users browsing this forum: No registered users and 1 guest