Saturday, October 13, 2007

To the Monthly Book Sale in Palo Alto

This Morning my son Nick was kind enough to give me a ride to Cubberley Community Center in Sylvieland to go to the book sale. I picked up another Bach Motet in modern clefs and two O'reilly books on Linux: Running Linux and Understanding the Linux Kernel for just $1.50, less than the cup of coffee I had later. Even though I returned some CDs to Palo Alto Main and listened to Bach all day I got engrossed in the kernel book once I sat down for coffee at the University Cafe. I realized that I really knew more about the kernel than I thought because many of the functions in the Standard C Library are really calls to system calls implemented in the kernel.

When I got home, I looked at how my kernel boots, in dmesg, and then looked at system calls, or things like them in Section 3 of the manual. So I decided to write some little C (gcc) programs using the exit() call. I was able to get the shell (bash) to do something with the exit status. The program was a stupid count-up loop that exited nonzero when a negative counter got positive, nothing too sophistocated.

The line of bash that gets exit(1) and says something is:

hello1 || echo Returned nonzero status

I actually had two C programs one that exit(0) and one guarenteed to exit(1). The line of bash does the right thing in each case.

Linux Distros are all different

Little things DO matter, alot! I have my favorite programs, CQview for looking at images, and I am hooked on FreeCell. Mandriva doesn't have the former and Slackware doesn't have the latter. Fortunately, it is relatively easy to get binaries for such applications off the Internet, but unfortunately, this machine isn't connected to the Internet at the moment. I might find that I have the packages on ome of my DVDs and can install it from there. But I rediscovered same, a tetris-like game with colored balls that got me engrossed on Slack.

Free Web Hosting