Posted: Mon Jan 06, 2003 3:49 pm
Garth,
All I meant was that I expected (wrongly) to examine the B flag (not the I flag) to determine whether BRK was the cause of interrupt.
That was precisely my point! Somewhere (I forgot where) I saw NMI handler code that attempted to get around the "skipped BRK on NMI" bug in the 6502 by examining the opcode at the saved PC minus 2. I was hoping that someone reading this might not make that mistake if they didn't think about it.
Agreed. I think the main problem is the lengthy swap times to harddisk. Windows is always messing around with the harddisk, making any application execution indeterminant. Nonetheless, I read somewhere that DOS is the most popular embedded operating system by volume. Scary.
An operating system can of course include a number of features which either complicate it or simplify it. It depends on your needs. If you write your own OS, naturally you have the most flexibility.
I forgot about that. I was thinking that a timer event might signal a task switch in the middle of an OS call, thus possibly reentering the same OS call. However, BRK doesn't just happen anywhere, so already we have control of it causing reentrancy problems. Also, if you're not using preemption, it's not an issue anyway.
Me too. On my little SBC project I have a "panic" button attached to NMI, whose handler basically drops into a monitor prompt, enabling interrupts to do I/O. Until the monitor returns to the interrupted program, the NMI-triggered monitor prompt can be thought of as one long ISR. Thanks for the correction. I was trying to illustrate that in a multitasking OS, you probably likewise want to disable (hardware) interrupts because they cause a context switch, when your OS may already be in the middle of switching tasks.
Nope. Again an interesting discussion.
Quote:
> In defense of myself I must say that normally one does check the flags from an
> actual status register to determine the source of an interrupt...
BRK does not respect the interrupt-disable flag.
> actual status register to determine the source of an interrupt...
BRK does not respect the interrupt-disable flag.
Quote:
If I'm understanding you right, this sounds like really bad programming!
Quote:
..PC and Windoze are very unsuitable for real-time applications because the interrupt latency is so nondeterminate...
Quote:
there are only certain places where it offers the system the option of switching to another task
Quote:
But BRK can be entered endlessly without exiting
Quote:
I can think of plenty of situations where you would want to re-enable
interrupts during an ISR
interrupts during an ISR
Quote:
I hope none of this is taken to be combative and argumentative.