Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

OS/2 extender (Developers)

posted by Ringding, 12.09.2025, 17:20

> Secondly, so long as I have privilege, there is nothing preventing me from
> switching from PM32 to LM64.
>
> You could argue that when I return to PM32, everything will blow up because
> I've messed everything up.
>
> But I believe everything can be restored to how it was before.
>
> So long as I only touch memory above 4 GiB, OS/2 won't even be aware that
> anything has happened. The most it could possibly detect - if it tried hard
> - was that interrupts were disabled for "quite a while".

It is an interesting thought experiment, but ultimately completely useless. In theory, it might just work. You just don't gain the privilege to switch modes so easily. I assume you would need a ring 0 kernel driver for this.

I envision the architecture like this: For every 64 bit task to run, there is a small, normal 32-bit OS/2 part that connects to and communicates with the kernel mode driver. It will continuously ask the kernel mode driver to run the 64 bit task until it exits, similar to how virtualized tasks are run today.

Long mode would have to have its separate set of page tables and interrupt descriptors. The kernel driver would have to act as a kernel for the 64 bit task and handle its synchronous interrupts like invalid instruction or arithmetic exception as well as syscalls. Youl would need to come up with some kind of syscall and API thunking scheme. There would also need to be some kind of communication buffer that both the 32 bit and the 64 bit part can access. This could be allocated by the kernel driver in a way so that it will not be moved around by OS/2. Then it could be mapped into the 64 bit address space.

Whenever a hardware interrupt comes in that is intended for OS/2, it would need to quickly save the state of the 64 bit task, switch back to legacy mode and deliver the interrupt to OS/2 by manually interpreting its IDT. Or maybe you could get away with disabling interrupts, but you would need to have a way to interrupt the running 64 bit task anyway to prevent it from stalling the OS indefinitely. I could think of using a timer for this, but this would have to be stolen from OS/2 and put back into the state that OS/2 expects it to be in before returning control -- quite a mess!

 

Complete thread:

Back to the forum
Board view  Mix view
22632 Postings in 2109 Threads, 402 registered users, 338 users online (2 registered, 336 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum