ReturnInfinity / BareMetal-OS-legacy

BareMetal is a 64-bit OS for x86-64 based computers. The OS is written entirely in Assembly while applications can be written in Assembly, C/C++, and Rust.
1.74k stars 302 forks source link

Direction flag with input/output functions #32

Open IanSeyler opened 11 years ago

IanSeyler commented 11 years ago

Some functions will break if the direction flag is set.

Should this be left to the app programmer to verify? Or should the OS save/restore the state of the flag on all calls?

Roxxik commented 9 years ago

This will lead to some difficult to track down problems if the OS crashes when you have a flag set while making a syscall, while this behaviour is not documented

I'd recommend to clear the direction flag on the functions that would break and declare in the API that no assumptions about the direction flag have to be made after using said functions

or alternatively if the direction flag has a deterministic state after making a syscall we can just document it