flat assembler
Message board for the users of flat assembler.
Index
> DOS > Unreal Mode |
Author |
|
Tomasz Grysztar 18 Jul 2004, 09:08
fasm for DOS uses it (see the MODES.INC file)
|
|||
18 Jul 2004, 09:08 |
|
vid 18 Jul 2004, 10:59
you just enable 32bit code in CR0, and install interrupt handlers (on all interrupts) that work for both 16it and 32bit code, in 32bit code they switch to 16bit and execute original handler. Example is in modes.inc
|
|||
18 Jul 2004, 10:59 |
|
madmatt 18 Jul 2004, 11:41
Ok, thanks, I'll have a look.
|
|||
18 Jul 2004, 11:41 |
|
Tomasz Grysztar 18 Jul 2004, 13:06
The first approach I've used to achieve such mode was a bit different from current - it had universal interrupts handlers, that (thanks to some opcode-tricks) were able to detect whether they are executed as 16-bit or 32-bit code and jump to appropriate code. In current version I the IDTR is different for the 32-bit code, and so there is separate interrupt table for this mode. I've invented this solution after I realized that on all processors I could test the IDT base can be altered even for real mode, and it seems to be much more stable in my tests.
|
|||
18 Jul 2004, 13:06 |
|
vid 18 Jul 2004, 20:40
wasn't previous versions (with universal handlers) stable?
|
|||
18 Jul 2004, 20:40 |
|
Tomasz Grysztar 18 Jul 2004, 22:03
Some BIOSes use few of the interrupt vectors in real mode IDT (at address 0) as a pointers to some data structures instead of true interrupt handlers. I had to put code for skipping interrupt numbers that were the most frequently used this way when making wrappers for all the interrupts - because if a wrapper was made, the pointer to data was of course broken and it was causing various errors (on BIOS disk access, for instance). But even with this fix such code could not be sure for all systems.
Also the IDT-base-changing version makes some of things much simpler - there is no need to check whether we are in 16-bit or 32-bit mode when interrupt occurs, if it's 16-bit mode, just the original 16-bit handler is invoked, and if it's 32-bit the wrapper from additional IDT is called. |
|||
18 Jul 2004, 22:03 |
|
vid 19 Jul 2004, 18:17
oh, that, i forgot. Seems I haven't been using DOS for a long time.
|
|||
19 Jul 2004, 18:17 |
|
Adam Kachwalla 15 Sep 2006, 11:30
I heard from Wikipedia that you can do Unreal Mode on a 286. I am writing a device driver and I was wondering if that's a good idea.
|
|||
15 Sep 2006, 11:30 |
|
Tomasz Grysztar 15 Sep 2006, 15:11
Perhaps someone got it confused. All kinds of unreal modes require 386 at least. 286 introduced the protected mode, but this without 32-bit addressing is not enough.
|
|||
15 Sep 2006, 15:11 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.