Brokenthorn's Known Bugs

From OSDev.wiki
Revision as of 15:59, 13 April 2020 by osdev>Octocontrabass (https://forum.osdev.org/viewtopic.php?f=1&t=36677)
Jump to navigation Jump to search

Wrong description of CR0.PE

In OSDev8, CR0.PE (bit 0) is incorrectly described as setting the processor to 32-bit mode. Setting bit 0 of CR0 does not put the processor in 32-bit mode. Performing a far jump to a 32-bit code segment puts the processor in 32-bit mode. The far jump itself will still be executed in 16-bit mode.

iret using inline ASM

In OSDev15, the provided ISR handler uses inline asm to iretd from a C function:

void int_handler_5 () {
 
	_asm add esp, 12
	_asm pushad
 
	// do whatever...
 
	_asm popad
	_asm iretd
}

This makes assumptions about the calling conventions used, and isn't a good idea in general. Better options may be found here.