3 ms·
That is still how syscalls work today, you only have a limited number of interrupts but possibly many more system calls so what Linux used to do is use 0x80 for
by revelation 10y ago
That is still how syscalls work today, you only have a limited number of interrupts but possibly many more system calls so what Linux used to do is use 0x80 for the syscall interrupt and then you just specify in a register the index (or function number) of what syscall you actually wanted to invoke.
Nowadays processors have a dedicated "syscall" instruction but it has no operands so you still pass the actual index of the syscall you want in a register.
- JoeAltmaier 10y agoI worked on an OS that did it differently. On the 8086, addresses were constructed by adding the segment and offset (shifted by 4 bits). SO there were 4096 combinations that resolved to the same location. We used those combinations to call into the OS app entry point. The particular combination indicated which function. The stack used the normal calling convention. So no icky trap entry points to code around - just call the OS directly! It was slick.
- EvanAnderson 10y agoThat's pretty ingenious. Can you share any other details about the OS?
- JoeAltmaier 10y agoIt was called, unimaginatively, 'CTOS' for "Convergent Technologies OS". When the 286 came along the original syscall trick quit working, so we invented another one. We simply used an invalid segment and trapped; the offset became the function number. Otherwise it worked identically. CTOS was message-passing. All system calls were for timers, memory or message manipulation. The messages were a tiny header including a 'request code', some scalar arguments and a set of buffers. OpenFile, Read, everything. On the top of the OS were Services that received messages. There was an OS message dispatch mechanism where Services registered for particular message codes. So the client Sending a message didn't know where their message would end up. The original feature that made money was the 'diskless workstation'. The file system codes were dispatched to Client Agent that simply packaged them up and sent them to a designated Server. Brought down the client workstation cost dramatically.
- EvanAnderson 10y agoVery interesting! I worked around a number of CTOS-based machines in a Unisys-based financial environment in the late 90s. I was responsible for the "PC" portion of the network. The CTOS-systems all fell on the "Unisys-side", where we plebeian non-Unisys vendors weren't permitted to work! I was always interested in the CTOS machines but never got a chance to mess around with any of them. Sounds like it might have been a lot of fun.
- JoeAltmaier 10y agoYeah, Unisys bought Convergent. The Financial environment was strong. Also government and military. Anybody who used total-cost-of-ownership as a metric found CTOS to be attractive. The network was self-configuring so you saved a network admin right off the top.