Protected mode, heh, simply put: it's not about protecting your program from being damaged, but about protecting the system from being damaged by your program. The real 32-bit protected mode was only realized after the 80386.
You didn't understand my meaning. The BIOS and DOS code are all code in real mode, while dos4gw, cwsdpmi or other various DPMI servers all run completely in protected mode. If the runtime library or the program calls BIOS or DOS interrupts, the DPMI server will switch the program from protected mode to real mode (I think there is also v86 mode?), but if the program doesn't call anything in real mode, then it's pure protected mode code.
In new operating systems (such as Windows NT kernel and Linux), after the system is loaded, it will take over all BIOS interrupts and make the system truly run in pure protected mode. Of course, what I need is not that complicated, just part of it. For example, is there a possibility to bypass BIOS and DOS for the I/O part? The only difficulty is that this implementation may rely heavily on hardware, and we don't have that much ability. But simple functions like screen output can completely be implemented by directly writing the buffer, thus avoiding mode switching. Of course, some functions may be difficult to complete. As for the input part, I don't have any idea yet.