Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: XMS Memory Manager. #245

Open
maximilien-noal opened this issue Jan 19, 2023 · 7 comments
Open

Feature request: XMS Memory Manager. #245

maximilien-noal opened this issue Jan 19, 2023 · 7 comments
Labels
callback Related to assembly callbacks into the emulator compatibility Emulator compatibility with DOS apps low priority Fixing this is not urgent, or would take too much manpower for too little gain memory Emulator memory access mode and layout

Comments

@maximilien-noal
Copy link
Member

branch: feature/xms

@maximilien-noal maximilien-noal added compatibility Emulator compatibility with DOS apps memory Emulator memory access mode and layout labels Jan 19, 2023
@maximilien-noal
Copy link
Member Author

maximilien-noal commented Jan 20, 2023

http://www2.ift.ulaval.ca/~marchand/ift17583/dosints.pdf

A game using XMS will first call "INT 2F, AX=4310" and DOS will return in ES:BX the XMS driver entry point, meaning the address in memory where the dispatch code is located.

Spice86 needs to inject some ASM into memory when installing the XMS driver:
https://fd.lod.bz/rbil/interrup/memory/2f4310.html

Example from Aeon:
https://github.com/gregdivis/Aeon/blob/594bb5bd70ccc1fa97d4b95487737627bc4d1516/src/Aeon.Emulator/Memory/PhysicalMemory.cs#L873

0000:0000 EB06                            JMP 0008
0000:0002 90                              NOP
0000:0003 90                              NOP
0000:0004 90                              NOP
0000:0005 90                              NOP
0000:0006 90                              NOP
0000:0007 90                              NOP
0000:0008 CDFF                            INT FF
0000:000A CB                              RETF

A method like the one below could do it:
https://github.com/OpenRakis/Spice86/blob/master/src/Spice86.Core/Emulator/VM/Machine.cs#L232

@maximilien-noal maximilien-noal linked a pull request Jan 20, 2023 that will close this issue
@maximilien-noal maximilien-noal added the callback Related to assembly callbacks into the emulator label Feb 11, 2023
@maximilien-noal
Copy link
Member Author

A good game to test this with is Lands of Lore, which requires it.

@maximilien-noal
Copy link
Member Author

@maximilien-noal
Copy link
Member Author

XMS should enable the A20 gate if enabled.

@maximilien-noal
Copy link
Member Author

old HIMEM source code for reference: https://github.com/MikeyG/himem

@maximilien-noal
Copy link
Member Author

FreeDOS implementation: https://github.com/Baron-von-Riedesel/HimemX

@maximilien-noal maximilien-noal added the low priority Fixing this is not urgent, or would take too much manpower for too little gain label Jan 8, 2024
@maximilien-noal
Copy link
Member Author

Needs protected mode. Low priority, and not needed at all by Dune (which only optionally uses it, and it's only the bios legacy function "COPY EXTENDED MEMORY")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
callback Related to assembly callbacks into the emulator compatibility Emulator compatibility with DOS apps low priority Fixing this is not urgent, or would take too much manpower for too little gain memory Emulator memory access mode and layout
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant