:x86:
Apart from the drawing boards at Intel when the 80286 was designed, can anyone find any evidence or have first-hand experience that rings 1 and 2 were ever used in any specific commercial purpose? (I haven't heard or seen of it.) 286 protected mode was generally a flop (outside of OS/2), while 386 protected mode was significantly better. The LDTR (-> LDT) and hardware task switching (reloading TR) aren't typically used. GDTR (-> GDT), TR (->TSS) and IDTR (->IDT) setup are essential.
The TSS includes where to find the 6-7 stacks, and for a permissions mask for port I/O.
Double fault handler (in the IDT -> INT 8) is typically what leads to a colorful screen of death. When the double fault handler fails (or the IDT or was overwritten), a triple fault happens and the CPU halts or the virtual machine does it own impression of a colorful screen of death without (usually) actually killing the host machine.
An invalid opcode handler permits handling CPU-unknown opcodes in the OS such as using emulation or other hardware.
Note that generally most PCs prior to UEFI/EFI booted in real mode with 1 core running, so writing a parallel and concurrent OS typically involves setting up protected mode structures, switching to protected mode, and then talking to the APIC for every other core.
Resources:
https://sandpile.org
http://ref.x86asm.net/geek64.html
https://cdrdv2.intel.com/v1/dl/getContent/671200
https://www.intel.com/content/www/us/en/docs/intrinsics-guid...
https://www.amd.com/en/support/tech-docs/amd64-architecture-...
SVGA/VGA/EGA
https://wiki.osdev.org/Expanded_Main_Page
http://www.osdever.net/FreeVGA/home.htm
https://archive.org/details/gpbb20/
https://archive.org/details/programmersguidetotheegavgaandsu...
System management
https://wiki.osdev.org/Symmetric_Multiprocessing
https://pdos.csail.mit.edu/6.828/2018/readings/i386/s09_08.h... https://ctyme.com/rbrown.htm
https://wiki.osdev.org/UEFI
USB
https://beyondlogic.org/usbnutshell/usb1.shtml
Emulators
https://www.qemu.org (qemu-system-x86_64 or qemu-system-i386 for very retro)
You'll usually want to create an ELF32x64 binary kernel image that's a bit of real mode, ia32 and then switches to 64-bit registers mostly (ia32e [amd64/x86_64]).