Friday Feb 15, 2008
I just came across an extensive article titled "Why Develop on the Solaris OS?" by Janice J. Heiss.
In case you have been looking for a reason to start working on the Solaris Platform, this article will provide you with many.
Friday Feb 01, 2008
We were able to conducts two sessions in our college this week.
The first one was an Introduction to Java Programming conducted by Rahul Mathur, a member of Sun Club on 28th Jan. You can find the presentation here and the pics here.
The second one was a Hands on Lab session which I conducted and showed people some of the internal working of Solaris including the bootloader(GRUB), How commands run, the shell and its variables and configuration and also from where to download softwares for Solaris (Blastwave.org). You can find the pics here.
Wednesday Jan 02, 2008
Well I have recently started with learning DTrace. DTrace is one of the most talked about feature in Solaris. This is how this feature is defined at OpenSolaris.org:
DTrace is a comprehensive dynamic tracing framework for the Solaris™ Operating Environment. DTrace provides a powerful infrastructure to permit administrators, developers, and service personnel to concisely answer arbitrary questions about the behavior of the operating system and user programs.
Apple has also introduced DTrace in its new operating system Mac OS 10.5 (Leopard). This is how it is described at apple.com/macosx:
DTrace is a low-level debugging and profiling facility for detailed monitoring of virtually any aspect of an application. Based on the Solaris Open Source project, this technology has been integrated by Apple into the Darwin kernel. In addition, Java, Ruby, Python, and Perl have been extended to support DTrace, providing unprecedented access for monitoring the performance characteristics of those languages.
Thus while learning DTrace I tried to compare both of them. Of course to use DTrace you need root privileges on the shell.
Here are the two screenshots (one on each os) with the most basic commands:
Solaris:
Mac OS 10.5:
So its quite evident that Solaris is far ahead with as many as 84997 (in build 72) probes as against 23300 in Leopard.
Sunday Dec 30, 2007
Are you using Solaris on VMware Fusion? And are getting irritated staring at a black screen (sometimes with a single cursor), waiting for Solaris to start booting right after the GRUB menu? Well, there is a work around.
I have been facing the same thing for a pretty long time, till I found out the reason at Jim Laurent's blog. Ok, so the actual elaborated reason is this. There is some kind of bug in Fusion that would cause it to hang for 3-4 minutes at the early boot process (ie just after you select the boot option from the GRUB) when a 64-bit kernel tried to load. So you stare at the blank screen cursing Fusion and Solaris and other associated things that comes to your mind (I did that everytime I booted the VM before switching to do some other things while the VM revives from its "hanged state"). So then what I did was removed the old VM and created a new 32 bit VM. Even then the same thing would repeat. Now why should such a thing happen when you have created a 32 bit processor for the VM. Its because Solaris by default first checks if the booting system is 64 bit capable and even if you create a VM for Solaris 32-bit, it doesn’t disable the 64-bit, long-word instruction support. I found the reason here and it further on leads to this page that contains a solution.
So you have to simply add one line to the configuration file (.vmx) of your virtual machine.
monitor_control.disable_longmode = 1
Yes this does it. But somehow I was not satisfied by just this much. So I decided to change the behavior of Solaris ie force it to boot in 32 bit mode everytime.
So while searching for a work around this one I reached this page. In this documentation Sun has clearly explained the booting process of Solaris 10, which of course is very similar to that of OpenSolaris. At Solaris installation time, a set of default values are chosen for the system and stored in /boot/solaris/bootenv.rc.
We can change the settings by editing the GRUB menu or modifying the bootenv.rc file indirectly via the eeprom command. Needless to say, you'll need root privileges for these operations.
Forcing Solaris to load 32 bit kernel
So firstly the longer method ie editing the GRUB menu youself. In case you dont want to get into the technicalities, look below for the second option:
The GRUB menu settings are stored in a /boot/grub/menu.lst. In case you have not made changes, the menu.lst file is well commented to explain each property. The lines which begin with a # are comments. menu.lst on a single partition, single HDD system, by default will look like this:
#pragma ident "@(#)menu.lst 1.2 07/01/10 SMI"
#
# default menu entry to boot
default 0
#
# menu timeout in second before default OS is booted
# set to -1 to wait for user input
timeout 10
#
# To enable grub serial console to ttya uncomment the following lines
# and comment out the splashimage line below
# WARNING: don't enable grub serial console when BIOS console serial
# redirection is active!!!
# serial --unit=0 --speed=9600
# terminal serial
#
# Uncomment the following line to enable GRUB splashimage on console
splashimage /boot/grub/splash.xpm.gz
#
# To chainload another OS
#
# title Another OS
# root (hd<disk no>,<partition no>)
# chainloader +1
#
# To chainload a Solaris release not based on grub
#
# title Solaris 9
# root (hd<disk no>,<partition no>)
# chainloader +1
# makeactive
#
# To load a Solaris instance based on grub
# If GRUB determines if the booting system is 64-bit capable,
# the kernel$ and module$ commands expand $ISADIR to "amd64"
#
# title Solaris <version>
# root (hd<disk no>,<partition no>,x) --x = Solaris root slice
# kernel$ /platform/i86pc/kernel/$ISADIR/unix
# module$ /platform/i86pc/$ISADIR/boot_archive
#
# To override Solaris boot args (see kernel(1M)), console device and
# properties set via eeprom(1M) edit the "kernel" line to:
#
# kernel /platform/i86pc/kernel/unix <boot-args> -B prop1=val1,prop2=val2,...
#
#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title Solaris Express Community Edition snv_72 X86
kernel$ /platform/i86pc/kernel/$ISADIR/unix
module$ /platform/i86pc/$ISADIR/boot_archive
#---------------------END BOOTADM--------------------
#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title Solaris failsafe
kernel /boot/platform/i86pc/kernel/unix -s
module /boot/x86.miniroot-safe
#---------------------END BOOTADM--------------------
If you look closely, the kernel and module path in the menu item titled Solaris Express Community Edition snv_72 X86 contains a variable $ISADIR, which is actually expanded to a value "amd64", if Solaris finds that the system is 64 bit capable. Thus, when ever a 64 bit capable system boots, the kernel that is loaded is /platform/i86pc/kernel/amd64/unix. The 32 bit kernel is actually located at /platform/i86pc/kernel/unix.
So we have to simply modify two lines. Replace
kernel$ /platform/i86pc/kernel/$ISADIR/unix
module$ /platform/i86pc/$ISADIR/boot_archive
by
kernel$ /platform/i86pc/kernel/unix
module$ /platform/i86pc/boot_archive
You can use any editor to make this modification. I used the vi editor. So save it, once you have made the changes and then reboot your VM.
The second method is a lot quicker. Just run the following command in the terminal
eeprom boot-file="kernel/unix"
Thats it. Just reboot your system and you'll see a new option in the GRUB menu, that would be highlighted and is the new default: Solaris bootenv rc
Actually this new menu will load the 32 bit kernel, while the previous default option ie Solaris Express Community Edition snv_72 X86 (build may be different) still boots into the 64 bit kernel
When you come down to what changes it has made, it has just made one extra entry to the GRUB menu:
#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title Solaris bootenv rc
root (hd0,0,a)
kernel /platform/i86pc/kernel/unix
module /platform/i86pc/boot_archive
#---------------------END BOOTADM--------------------
#BOOTADM RC SAVED DEFAULT: 0
....and made it the default option.
Chalo enjoy playing with the GRUB and switching the kernel mode. And more importantly no need to stare at that black screen in VMware.
Thanks alot! I finally fixed it on my FreeBSD serv...