Hi,
I have all up and running (user layer, vm86. Even multitask...)
But now, how to be able to use 16bits ints??? (since all goes trough the IDT??)
VM86
Re: VM86
If you mean how to simulate 16-bit ints (like DOS & BIOS software interrupts), it is simple. You set the IDT gate to kernel-only access, and then you emulate the function so the application cannot see the difference.
I have a device-driver that does all this to provide DOS and DOS-extender support in my OS, but it is rather obsolete at this point.
I have a device-driver that does all this to provide DOS and DOS-extender support in my OS, but it is rather obsolete at this point.
Re: VM86
Obsolete, huh?rdos wrote:If you mean how to simulate 16-bit ints (like DOS & BIOS software interrupts), it is simple. You set the IDT gate to kernel-only access, and then you emulate the function so the application cannot see the difference.
I have a device-driver that does all this to provide DOS and DOS-extender support in my OS, but it is rather obsolete at this point.
Then, how do you enable graphics mode, sir?
Re: VM86
Not all people use Graphics mode. Some are happy with the VGA, while other feel comfortable with the text mode. A few rare people are smart enough to use native video drivers.Nessphoro wrote:Then, how do you enable graphics mode, sir?
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
Re: VM86
The easiest way is to do it before you start the kernel (in real-mode). The hardest way is to do it in V86-mode, since then you need to setup the needed fault-handlers because the BIOS will use instructions that are not allowed in V86-mode. In either case, you use int 0x10 in real-mode / V86 mode to change video-mode.Nessphoro wrote:Obsolete, huh?rdos wrote:If you mean how to simulate 16-bit ints (like DOS & BIOS software interrupts), it is simple. You set the IDT gate to kernel-only access, and then you emulate the function so the application cannot see the difference.
I have a device-driver that does all this to provide DOS and DOS-extender support in my OS, but it is rather obsolete at this point.
Then, how do you enable graphics mode, sir?
It also depends on if the processor supports V86 extensions. If it does, there is no need for an instruction emulator, and the generated faults are simple to handle. If there is no support for V86 extensions, I need to load the emulator module (the above DOS & DOS extender device-driver). I have support for switching between video-modes in my OS, and especially between graphics mode and text-mode. I have hot keys to be able to switch between consoles / processes that might use different video-modes.
-
- Member
- Posts: 76
- Joined: Mon Aug 18, 2008 6:17 am
Re: VM86
thanks ,
so, suppose your about to create a VM86 that will call INT 0xXX.
it will generate the INT, the kernel will catch through IDT (with a task gate (another vm86???), somehow this task should put it self in real-mode (while in interrupt-handler-time) and jump to interrupt address SSSS:OOOO (from IVT)??????
Or I'm missing something??
so, suppose your about to create a VM86 that will call INT 0xXX.
it will generate the INT, the kernel will catch through IDT (with a task gate (another vm86???), somehow this task should put it self in real-mode (while in interrupt-handler-time) and jump to interrupt address SSSS:OOOO (from IVT)??????
Or I'm missing something??
Re: VM86
You start a V86 task by doing an iretd from kernel. The stack should have the register content suitable for V86, most importantly EFLAGS VM bit should be set. The INT 0xXX itself is easiest simulated by loading CS:IP with the real-mode IVT entry before doing the call. Then you need to be able to get back to your kernel. You can do this by putting an invalid instruction in real-mode space, and then catch it. Before the call, you setup the real-mode stack so it contains CS:IP of the invalid instruction.InsightSoft wrote:thanks ,
so, suppose your about to create a VM86 that will call INT 0xXX.
V86-mode need its own IVT. It cannot use your protected mode IVT (different format). You need to simulate int x instructions.InsightSoft wrote:it will generate the INT, the kernel will catch through IDT (with a task gate (another vm86???), somehow this task should put it self in real-mode (while in interrupt-handler-time) and jump to interrupt address SSSS:OOOO (from IVT)??????
Or I'm missing something??
-
- Member
- Posts: 76
- Joined: Mon Aug 18, 2008 6:17 am
Re: VM86
How? you are at multi-task environment. And even in vm86 all goes trough IDT... (I'm stuck!)The INT 0xXX itself is easiest simulated by loading CS:IP with the real-mode IVT entry before doing the call
simulate... How exactly?V86-mode need its own IVT. It cannot use your protected mode IVT (different format). You need to simulate int x instructions.
I mean, there's a lot (and dirty) ways to do that. But, wich one, is the correct one? How you guys, are doing?