Then you will need to create a link somewhere in your document. Like so:

<a href="javascript: openpopup('http://www.google.com')"> Click here to open the page in a new window. </a>

And vola! You are now able to open links in a new browser window! Now, this solution will also work for local html documents, but I believe it is always better practice to put the full URLs in anyways. Hope this solution works for you and enjoy!

The example shown here was derived in Ubuntu 9.04 using the Jaunty Jackalope Kernel Version: 2.6.28-11.

Okay, so first question what exactly is POSIX Message passing and why should I use it?

Well, POSIX stands for “Portable Operating System Interface for Unix” and it is a collection of standards governed by the IEEE.

Message passing is all about processes being able to communicate and synchronize with one another. Why do process need to communicate with one another? Well sometimes processes hold data that other processes may need. This doesn’t just hold true for process though, think about the World Wide Web. Computers need to be able to communicate with one another all the time, so wouldn’t it be nice to have some kind of mechanism in place that demonstrates that functionality? Yeah, I thought so too.

Well here is an example of processes communication utilizing the POSIX API. Think of it as like a client – server relationship; if that helps…

Overview:

Basically four external process will be communicating with a central process relaying temperature data back and forth. The goal here is to get all the processes to have the same temperature. Once that happens the central process will send a message indicating the system is stable and the processes can print out their final temp and end. Until the system is stable the external and central processes will continue to calculate new temperatures and relay them back and forth. [NOTE]: The four external processes are only aware of the central process, but the central process is aware of all the processes.

This starts by utilizing msgget(); This function will request a message queue ID using the mailbox name provided or create one if not existent previously.

Then use msgsnd(); to relay a message to a particular mailbox and use msgrcv(); the get a message from a mailbox.

Now, I opted to add this to /usr/src/linux/kernel/sys.c. However, you can always create your own file and add it to the kernel’s makefile. If you decide to go down this route you are also going to need to #include <linux/kernel.h> to the code above; the file kernel/sys.c already includes that package.

Lets explain what’s going on here a little shall we?

asmlinkage: thats there to indicate the code is written in ‘C’ as oppose to C++

printk: is used to print out kernel log messages. These messages are stored in /var/log/syslog.

KERN_EMERG: is used for logging emergency messages; these usually happen before a crash. The Kernel has 8 different types of log levels, a few others are- KERN_DEBUG, KERN_ALERT, KERN_ERR

Alright, now that we have our system call we need to let the kernel know its there and can be used.

To do this we will have to modify a few files.

Modify /usr/src/linux/arch/x86/include/asm/unistd_32.h and add:

#define __NR_helloworld 333

to the list of system call numbers. This is the system calls unique identification number.

Modify /usr/src/linux/arch/x86/include/asm/syscalls.h and add:

/* X86_32 only */
/* kernel/sys.c */
asmlinkage int sys_helloworld();

under the “/* X86_32 only */” comment. This registers the system call.

Modify /usr/src/linux/arch/x86/kernel/syscall_table_32.h and add:

.long sys_helloworld /* 333 */

to the bottom of the list. This also registers the system call.

Alright, now build your new modified kernel..this is going to take a while…

…

OK, SO 2 hours later…Install the new kernel and reboot.

Now we have to build a little c-program to use that shiny new system call right? *How Exciting!*

Exactly what we expected. Our program returned ‘0’ from the system call execution AND we have the output in the logs. YAY!

[NOTE]: Now, you may have issues with flushing the buffer at this step so you may have to trigger an event on the system like reset your wifi connection to actually see the print out in the log. However, having the newline at the end of the message is supposed to guarantee the flush.

Congratulations you just made your very own system call in your very own custom kernel. Mom would be so proud, if only she knew what a kernel or a system call was!

Then we are going to make a clean package using the current configuration of the current kernel since it already figured everything out for you.

sudo make-kpkg clean
sudo cp /boot/config-`uname -r` ./.config

Make any changes you want to the kernel here:

sudo make menuconfig

sudo fakeroot make-kpkg --initrd --append-to-version=-lml kernel_image kernel_headers[NOTE]: “–append-to-version” will append a string to the version number; here I am using my initials “lml”. You’re going to want to do this to distinguish your kernel builds apart.

This will give us the header and image output in /usr/src. Issuing these commands will install your new custom kernel:

So, today I am working on understanding how processes communicate in the Linux OS. This code example is written in C and compiled in Ubuntu 9.04 using the Jaunty Jackalope Kernel version 2.6.28-11.

This code specifically prints out the Fibonacci sequence.

The parent process creates and attaches a shared memory segment, forks a child process (remember the child process shares the resources of the parent) , waits for the child to finish, prints out the contents of the shared memory, and finally detaches and removes the shared memory segment.

The child process runs through the Fibonacci algorithm, inserts the resultant into the next available space in shared memory and prints out the resultant to standard output.

This example accepts input from the command line with basic error checking. You know, make sure two args have been provided, they are between the min and max limits of the program; the BASICS.