1 .global vm86_call_bios_start, vm86_interrupt_hook, vm86_call_bios_end
3 vm86_call_bios_start: // This is where our VM86 task's entry point is. We
4 .code16 // tell GAS that now we are in 16-bit/real mode.
5 //... // Here we could add instructions.
6 vm86_interrupt_hook: // This label tells the kernel about where the operand
7 int $0x00 // $0x00 is in memory, therefore it can be set dynamically.
8 //... // Here we could add instructions.
9 vm86_call_bios_end: // This is the task's last byte of code (the kernel copies
10 int $0x3 // the code up to this byte). The int $0x3 signals the
11 // kernel to terminate a VM86 task - it consists of only
12 // one byte, otherwise the label would be incorrect!
13 .code32 // Finally, we switch back to 32-bit/protected mode code.
15 // To make your own VM86 task, use the following structure:
18 // // your 16-bit code
22 // Note that this code must be position independent (no jumps / addresses)!
23 // This is a huge limitation, but not needed for our purposes (calling the BIOS).