Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
I been working on expanding BareMetal OS, starting with installing ISR's for the built-in functions that come with BareMetal (like screen output, string length, etc). I decide to use interrupt 0x90 (sounds like a good number) and the service routines are working fine, but I cannot find an efficient way to call the correct function based on the function number:
This, but make sure you test to see if RAX is in the valid range for ISR functions.
So, if you have five functions, with RAX being 0-4, do a cmp rax, 4 ; ja .out_of_range (or something like that) so you don't execute garbage if someone calls your ISR with RAX being, say, 5.
Well, not really. It's probably more flexible if applications can use interrupts instead of depending on an exact address (in case things need to be moved in the future) to call system functions, however it works great either way. I just thought it would be fun to write ISRs, as im not quite at the full-fledged multitasking OS level yet.
I have to say, BareMetal is great! It's well comented and a great learning tool.