This is purely academic, out of date, out of curiosity. Let's go back to the 1990s, before Windows, when real-mode DOS programs were common.
The BIOS assigned the INT 08H+ for their own interrupt handlers, for instance, int 10H for VGA MODE switch, int 13H for hard driverdrive services. (Table of software-interrupt numbers)
But, as we can see in Intel® 64 and IA-32 Architectures Software Developer Manuals, we know that there are also many real-address exceptions that can trigger interrupts. For example, #DE (divide exception) raising interrupt vector 0h, or x87 FPU raising 10h (https://wiki.osdev.org/IVT)
If a programmer intentionally or unintentionally makes the CPU raise those exceptions on its own, by running instructions like bound that can trigger a BOUND Range Exceeded exception, how does the BIOS or anything else distinguish that from an INT 5 software interrupt to make a PRINT SCREEN call, for instance? It's the same IVT entry, so the same interrupt handler will be invoked in either case.
What's more, the default IRQ configuration makes it so that if you want to use the keyboard, you can't trigger those interrupts. (OSdev IRQ assignments table)
As so many of Intel's interrupt slots have been reused by the BIOS, things became unreasonable.
(This was originally asked on Stack Overflow).
Additionally: My question is not only focused on how the BIOS/DOS distinguished the clashing interrupts from hard/soft sources, but also, and equally importantly, I want to know the historical reason why the BIOS manufacturers arbitrarily violated Intel's manual, which specifically said that interrupts 0–31 are ‘Intel reserved. Do not use.’
After the first such clash, the INT 5clash clash BUG became widely known, even documented in The MS-DOS Encyclopedia, they should have realized that what they are doing would likely cause more and more clashes in the foreseeable future if Intel continued to add more instructions and internal exceptions in future processors. Then the cost would be much and much higher because the IVT function can't be easily changed due to backward compatibility.
So I think all the BIOS should have abandoned their default IVT configuration at the time the INT5 clash bug first happened, and followed Intel's manual to correct their fault immediately, don't use the reserved interrupt anymore, in order to avoid more interrupt clashes in the future. But obviously, they didn't.
It is absolutely impossible that I am cleverer than all the engineers of the past decades, so I was curious what exactly did the engineers think about this and did the BIOS exception handler really have to check each time on each interrupt with both internal and external, after all, there are so many clash, do they have to check each time? Would the cost be too high?
Fortunately, the Windows operating system became popular, so most computers are running in protected mode. If Windows hadn't evolved to what it was, MS-DOS continued to be widely used for many years, and Intel continued to roll out new real-mode exception codes, would they be facing this conflict all the time?
There are no ifs in history, and it seems that their willful actions did not cause more serious consequences seems to be just the blessing of God. Of course, the above is just my guess, which is why I want to find some people who have lived through that era to discuss this unimportant issue. I was born after 1990, I don't know anything about what happened before, it's all my speculation.