::SHE+ILA::'s VM86 Monitor continued [$5E]

Elegant Women in Purple Velvet Gowns with Technology
37
0
  • Squishy Plushie's avatar Artist
    Squishy Pl...
  • Prompt
    Read prompt
  • DDG Model
    DaVinci2
  • Access
    Public
  • Created
    7h ago
  • Try

More about ::SHE+ILA::'s VM86 Monitor continued [$5E]

As previously described, ::SHE+ILA::'s Kernel runs in Protected mode in order to access the full RAM address space. In order to access the video, hard disk, keyboard, and timer, we have a number of VM86 tasks, which call the remapped BIOS entry points via a modified IDT (Interrupt Descriptor Table). Unlike the Real Mode IDT, which has 4 bytes (offset:16, segment:16) per entry, the Protected Mode IDT has the following structure :
{=
256 DUP (offset:16, SELECTOR:16, zeroes:8, GATETYPE:4, zero:1, DPL:2, PRESENCE:1, HiOffset:16)
=};
This is switched to by means of the LIDT (Load Interrupt Descriptor Table) opcode, which takes (size:16, offset:32, zeros:16, BlehLol:32) as a parameter. Addresses are linear, not segment+offset :)
We must remap INT $13 (disk API) to INT $4E, and INT $10 (VGA API) to INT $45. The APIC chip must be reprogrammed to remap INTs $08_$0F to INTs $78_$7F, in order to avoid clashing with protected mode CPU exceptions $08 through $1F (IBM messed this up , LOL).
We then set up the GDT (global descriptor table, like our GHOST), and fiddle with CPU register CR0 to switch to protected mode. We also need to plant place-holders for INT $6D (VGA), INT $4A (alarm), INT $40_$46 (Floppy), and INT $33 (Mouse API), etc. Lollity :)
The Kernel runs in Ring 0 (kernel mode), and the Device Driver Tasks run in Ring 3 (user mode, in order to use seg/off addressing). Ring 1 (executive) and Ring 2 (supervisor) are currently not used (yay!) :)

Comments


Loading Dream Comments...

Discover more dreams from this artist