Wiki editing discussion

Page 30/35
23 | 24 | 25 | 26 | 27 | 28 | 29 | | 31 | 32 | 33 | 34 | 35

By Grauw

Enlighted (7893)

Grauw's picture

21-01-2019, 10:36

gdx wrote:

I do not understand when you say: "pages describe a logical address, and banks/slots/segments a physical address". Physical addresses are the ones the CPU can see directly, is not it?

The physical addresses space is the actual addresses on the RAM / ROM chips. So for a 256K ROM, covered by A0-A17. The logical (or virtual) address space is what the CPU sees, mapped by an MMU (mapper) of sorts because the address space can’t fit all physical addresses.

https://en.wikipedia.org/wiki/Logical_address

Quote:

In computing, a logical address is the address at which an item (memory cell, storage element, network host) appears to reside from the perspective of an executing application program.

A logical address may be different from the physical address due to the operation of an address translator or mapping function. Such mapping functions may be, in the case of a computer memory architecture, a memory management unit (MMU) between the CPU and the memory bus.

And: https://en.wikipedia.org/wiki/Page_%28computer_memory%29

Quote:

A page, memory page, or virtual page is a fixed-length contiguous block of virtual memory, described by a single entry in the page table. It is the smallest unit of data for memory management in a virtual memory operating system. Similarly, a page frame is the smallest fixed-length contiguous block of physical memory into which memory pages are mapped by the operating system.

Here they introduce yet another term "page frame" synonymous with bank, segment and slot :).

gdx wrote:

Wikipédia says "A memory bank is a logical unit" as I use in wiki (because I say that the RAM is divided in 4 banks in which we can switch the pages of the slots or the segments of the Mapper).

That should be phrased:

"The RAM is divided in 4 pages in which we can switch slots and mapper segments".

(Putting aside for a bit that we’re actually talking about two MMU systems layered on top of each other, and that the slots system is overly complex.)

More examples of use in documentation:

http://map.grauw.nl/resources/dos2_environment.php#c2_5

Quote:

When a transient program is loaded, the mapper RAM slot will be enabled in all four pages and the four RAM segments which make up the basic 64k will be paged in. [...] Pages 0, 1 and 2 can contain any slot when doing a function call and will be preserved. [...] Any RAM segments can be selected in pages 0, 1 and 2

https://translate.google.nl/translate?sl=ja&tl=en&u=http%3A%...

Quote:

By switching slots, it is good to be able to handle memory exceeding 64 kilobytes, but at that time it is inconvenient to switch the entire memory at the same time. Therefore, in MSX, it is thought that the memory is divided into "pages" and handled. 16 kilobytes from 0000H to 3FFFH of memory to page 0, page 16 from 4000H to 8000H page 1 page 1. Similarly, from 8000H to BFFFH, page 2, C000H to FFFFH to page 3, and so on. For each page with 16 kilobytes as one block, you can select every slot. For example, when BASIC's disk I / O-related instructions are being processed, page 0 is switched to the main ROM of the BASIC interpreter, page 1 to the disk interface ROM, and pages 2 and 3 to main RAM (see Figure 2.3)

http://map.grauw.nl/resources/system/msxtech.pdf § 1.7.1

Quote:

Allocate slot 0 for page 1

By Manuel

Ascended (15190)

Manuel's picture

21-01-2019, 10:28

Indeed, as I see it, on MSX, the term pages only refers to the 4 16kB areas of Z80 address space, and nothing else.

By gdx

Prophet (2612)

gdx's picture

21-01-2019, 10:45

I do not think it's relevant to talk about virtual memory. This is to manage a mix of different types of storage. There is only talk of RAM and ROM interconnected by a switching system.

By Grauw

Enlighted (7893)

Grauw's picture

21-01-2019, 10:46

Manuel wrote:

Indeed, as I see it, on MSX, the term pages only refers to the 4 16kB areas of Z80 address space, and nothing else.

Fair enough, so in the example I posted earlier:

Grauw wrote:

“you select slot 2-1 in page 1”, “you select segment 11 in page 2” or “you select bank 7 in the 8000H-9FFFH page”.

For the last one it’s better to say “you select bank 7 in the 8000H-9FFFH area of the memory”.

By Grauw

Enlighted (7893)

Grauw's picture

21-01-2019, 10:58

gdx wrote:

I do not think it's relevant to talk about virtual memory. This is to manage a mix of different types of storage. There is only talk of RAM and ROM interconnected by a switching system.

Virtual address space is just a synonym for logical address space, an antonym to physical address space, in this context it has nothing to do with virtual memory as-in writing out parts of memory to disk.

https://en.wikipedia.org/wiki/Physical_address

Quote:

In a computer supporting virtual memory, the term physical address is used mostly to differentiate from a virtual address. In particular, in computers utilizing a memory management unit (MMU) to translate memory addresses, the virtual and physical addresses refer to an address before and after translation performed by the MMU, respectively.

https://en.wikipedia.org/wiki/Address_space

Quote:

An iconic example of virtual-to-physical address translation is virtual memory, where different pages of virtual address space map either to page file or to main memory physical address space. It is possible that several numerically different virtual addresses all refer to one physical address and hence to the same physical byte of RAM. It is also possible that a single virtual address maps to zero, one, or more than one physical address.

The terms physical / logical are also used in the same way in the context of disk partitions and network addresses. There is a mapping, with a logical address on the one end and a physical address on the other.

Anyway this is not the topic of my comment, merely meant to illustrate the difference between page and bank / slot / segment, and why it’s not correct to use the term "bank" to refer to a logical address range.

By gdx

Prophet (2612)

gdx's picture

21-01-2019, 11:08

People often say that English is one of the most ambiguous language in the world. They are probably right. Apparently that does not seem to have any alternative to be clearer, too bad, so it remains only to use page. The guy who chose this term should have done another job.

By Grauw

Enlighted (7893)

Grauw's picture

21-01-2019, 11:16

gdx wrote:

The guy who chose this term should have done another job.

Yup, that’s the core of it. It’s just not something we can change. Thanks for listening to my arguments Smile.

gdx wrote:

About "bank", the term "page" can only bring confusion. "Bank" does not seem to fit some people. We can replace it with "area" if you prefer although I find this term a bit too general.

As I replied to Manuel and you earlier, I think the most important thing (what stood out to me) is to not use "bank" to refer to a logical memory area. Then, about what to use instead, I think "page" is most appropriate when talking about the 4 16K divisions of the 64K TPA, but for other cases I agree with you it may be more explicit to simply talk about areas of the (logical) memory. So maybe there we have some compromise.

The least ambiguous terms are "logical memory area" and "physical memory area", however those are a mouthful and rather technical, so I think there’s still merit to using the terms page and bank / slot / segment in places, also for the sake of recognising terminology in other documentation. However maybe alongside those words we can refer to logical / physical memory area in a few places to make clear what they are about.

By gdx

Prophet (2612)

gdx's picture

21-01-2019, 13:12

In this wiki page, "Bank" seems to be what is called "Slot" on MSX.

https://en.wikipedia.org/wiki/Bank_switching

So I would prefer we said this "The RAM is divided in 4 pages in which we can switch slots and mapper segments". That is what is used in several docs.

By Grauw

Enlighted (7893)

Grauw's picture

21-01-2019, 13:39

Agreement.

Complicating factor is that the memory mapper MMU is layered on top of the slots MMU, so technically one should say "the RAM is divided in 4 pages in which we can switch slots in which we can select mapper segments", however that’s a rather complicated thing to say. I think better to state what you said first as the simple explanation, and then elaborate on the layering in a later paragraph.

By gdx

Prophet (2612)

gdx's picture

22-01-2019, 10:11

I revised wiki page for slots. Check it please, and you can modify what does not fit. Program using direct accesses may need fine tuning.

https://www.msx.org/wiki/Slots

Page 30/35
23 | 24 | 25 | 26 | 27 | 28 | 29 | | 31 | 32 | 33 | 34 | 35
My MSX profile