Indeed. And it's not just the interrupt numbers that are different; the parameters you pass vary too. In DOS, for instance, you put 9 in AX to print a string, whereas in Linux you put 4 in AX.
And to make things more complex, the calling convention differs between UNIX flavours! In Linux, you store int 80h
call parameters in registers (EAX, EBX etc.) whereas in FreeBSD you push the parameters onto the stack before calling int 80h
As your your second question: in a non-protected mode OS like DOS, you can access the hardware directly if need be. For instance, you can mov
data into the video RAM if you want direct access. So you can avoid interrupts and the IVT, and go directly to hardware devices if need be.
Under Linux, though, that's not possible -- normal programs can't access memory outside of their segments, so a user program can't suddenly start writing data to the video memory. Hence why the X server needs to be run as root. It's a security and stability measure but limits what your code can do.
I like your idea of a POSIX for interrupts