Servant or Nanny: The Geek’s Version

Last time I was talking about the choice between a servant or nanny. It was concluded that people tend to fall in favor of a nanny OS. This is even true for geeks, who work with servants based on a nanny framework.

This time, I will examine more into the details of system calls.

Andrew S. Tanenbaum wrote that exec() is "the most complicated system call in Linux" (second paragraph, pp. 740, Modern Operating Systems, 3rd).

By the way, exec() is a system call family. A member of that family typically allocates a new address space, loading a program, thus creating a new process. The syntax of execl() is loading a program, thus creating a new process. The syntax of execl() is

int execl(const char *path, const char *arg0,
const char *arg1, const char *arg2, ...
const char *argn, (const char*) 0);

It is amazing to Windows geeks, since the (not exactly) equivalent system call NtCreateProcess has the following syntax:

NTSYSAPI NTSTATUS NTAPI
NtCreateProcess(
OUT PHANDLE ProcessHandle,
IN ACCESS_MASK DesiredAccess,
IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
IN HANDLE ParentProcess,
IN HANDLE ExceptionPort OPTIONAL
);

Putting aside the fancy arguments, you have to get familiar with dreaded object types before taking any further move. To become a decent Windows geek, you still have to know concepts such as handle, object manager etc. In *nix, you don’t have to suffer from such a misery. The clearness and simplicity in the system calls of *nix lie in the fact that C language is tailored for *nix, as it was designed to do so. The concepts of C language work just in concert with the OS architecture of *nix.

And NtCreateProcess() is far from the most complicated system call in Windows. Now the way to become a Windows geek is much more bumpy than that to become a *nix geek. This is true for me, as it takes me less than half an hour before writing my first program of a new *nix system call, and several hours of a Windows work.

So what is my point?

To program in Windows spares a lot more effort than in *nix. The former is a nanny, and the latter is a servant.

A stereotypical nanny is an old aunt-aged female who takes excessive care of you. Sometimes you may just get annoyed because you want more of your freedom. Yet a nanny has to work as hard (if not harder) as a servant. She may spare a lot effort, but seldom expect any rewards.


Advertisements

Servant or nanny

In his book Modern Operating Systems, Andrew S. Tanenbaum writes that operating system design follows the need of its users. The reason why a research system (UNIX) cannot behave like a commercial system (Windows) is that professionals need a servant, not a nanny.

But he may not be aware that even professional people would not sit before a UNIX workstation. Rather, they would use a Windows workstation to connect to UNIX. He himself demonstrates this point:

"[What computer do you use?] It is multiboot with MINIX 3, Ubuntu, and Windows XP on it. I actually use it as an X Terminal though logged into a Solaris server […]" – from his website

Is it an indication that people tend to rely on a nanny who takes care of everything of their lives?