skiselev / 8088_bios

BIOS for Intel 8088 based computers
GNU General Public License v3.0
513 stars 61 forks source link

Check for STI in io_wait_latch #58

Closed skiselev closed 7 months ago

skiselev commented 8 months ago

io_wait_latch in delay.inc disables interrupts but doesn't enable them back

Reported by batus74@meta.ua

640-KB commented 7 months ago

Are you certain about this? The pushf saves the caller's interrupt flag state, disables interrupts while reading the latched bytes and then restores IF to the previous state with popf. So if interrupts were off previously, it will return with them off and if they were on, it will return with them on again.

https://github.com/skiselev/8088_bios/blob/a03b60b6cef69a64ec2384f07534d3943a0d3775/src/delay.inc#L105-L115

Is this causing issues with something?

skiselev commented 7 months ago

@640-KB thank you for checking on this! Doesn't seem to be a bug, POPF will restore the flags at the end of the routine