Hello everyone, this is my first post on this board
Tell me, on the x86 architecture, can a program (operating system kernel, application, machine virtualiser, whatever else...) keep a another piece of code from calling the BIOS and deal with this attempted call and call some other function instead?
for example, a virtual machine runs a program which wants to find out how much memory is available. It calls INT 12 which puts this info into AX. But the virtualiser doesn't want to devote all the RAM to this vm, so how can it prevent this from happening?
May BIOS calls be intercepted?
-
- Posts: 8
- Joined: Mon Mar 24, 2008 6:58 pm
May BIOS calls be intercepted?
I take my tea with milk
Re: May BIOS calls be intercepted?
Hi,
Typically you'd do the same to reserve yourself some memory - for e.g. replace the BIOS's "get memory size" functions with your own functions that only report what you don't use.
However, for a true virtualiser you'd use virtual8086 mode and virtualise everything, so that you can have 2 or more virtual programs running at the same time without stuffing each other up. This could/would include your own virtual BIOS running inside the virtual machine.
Cheers,
Brendan
This is fairly simple - you replace the BIOS's IVT vector (for which-ever interrupts matter to you) with your own IVT vector, and then you can handle the interrupt/s yourself or jmp to the original interrupt handler (or both, e.g. depending on the value in AX).wilsonsamm wrote:for example, a virtual machine runs a program which wants to find out how much memory is available. It calls INT 12 which puts this info into AX. But the virtualiser doesn't want to devote all the RAM to this vm, so how can it prevent this from happening?
Typically you'd do the same to reserve yourself some memory - for e.g. replace the BIOS's "get memory size" functions with your own functions that only report what you don't use.
However, for a true virtualiser you'd use virtual8086 mode and virtualise everything, so that you can have 2 or more virtual programs running at the same time without stuffing each other up. This could/would include your own virtual BIOS running inside the virtual machine.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
-
- Posts: 8
- Joined: Mon Mar 24, 2008 6:58 pm
-
- Member
- Posts: 62
- Joined: Fri Jun 29, 2007 8:36 pm
in RMode, on bootup it is located at that address, yes (though it can be moved), but it doesnt use 32 bit addresses, its a 16:16 segment:offset pair, as is customary in RModewilsonsamm wrote:And by this you mean the area of memory between absolute zero and 0x03FF?
That's simpler than I thôt. I'm guessing each entry here contains a 32-bit absolute address pointer to a handler?
but as brendan said, its even better (though slightly more complicated) to use VMode
this is, of course, assuming your talking about compatibility with older RMode programs
if your talking about new programs written for your OS, PMode is the way to go, and that automatically restricts the user applications in more ways than just that