
What is a shell and how does it work? - luu
http://experiments.oskarth.com/unix01/
======
101914
The shell I use on x86 returns the value in ax as the shell variable $?.

I have always thought about the idea of a shell that could return values from
other registers.

I guess there are reasons this would be a stupid experiment. Or maybe I am the
only one could see the utility of it.

Did anyone see Bourne's keynote at BSDCan about how sh was developed? I only
looked at the slides.

Meanwhile I use a debgger for asm programs called ald to trace register
values. I found a nasty bug in this program but I am not aware of any similar
debuggers aimed at asm (cf. C).

~~~
simplicio
I think eax is the only register guaranteed to have its value preserved by the
ABI. So the other registers might end up with junk loaded during the exit()
syscall.

Plus IMHO, the added confusion of having extra output channels doesn't seem
worth it.

------
gosukiwi
Great post. Not beeing a systems dev though it kinda lost me when he talks
about pipes. Pretty great overall though, I learnt some stuff :)

~~~
oskarth
Author here. Glad that you liked it and that you learned some new things!
Would you mind elaborating on what you found confusing about the explanation
of pipes?

