protected_mode()

This assembly call switches the x86 processor into protected mode. The function is for non-BIOS systems.

Upon return, the DS and ES registers will be set to selectors that can access the entire 4 GB address space. This code is designed to be completely position-independent.

This routine must be called with a pointer to a 16-byte area of memory that's used to store the GDT. The pointer is in ds:ax.

The following selectors are defined:

8
Data selector for 0-4 GB.
16
Code selector for 0-4 GB.