Thursday, March 25, 2010

Sponsorship for college fests

Hello all ,

When I took the task as marketing head of my college's cultural festival I did a lot of searching for it but to no avail so I decided that I am gonna share my experience after the fest. So here it is.

First thing first, I am writing this more specifically for a cultural fest but I am sure same applies to technical fest's too. So the first thing is to, start as early as possible may be about 4-5 months prior to the event. First make a list of tentative events and stats which you plan to have during your event.

Now make a comprehensive proposal. It must be very targeted as small as possible, as people do not generally have a lot of time to spare. Better make 2 proposals one a summary kind and the other a little detailed (still a little detailed :) ). In the proposal give an intro of your college, the event, its past success, the number of participants and number of colleges participating etc. Expected gathering this time, then describe some mega events (not more than 1 line for each event and not more than 5-6 events). Then jump straight to the point. Do mention previous media associations etc, (getting media partners is easy ..you offer them publicity during your fest and they publicize your fest in return.They might charge you little bit also say about INR 10,000).

What you are offering, how you will publicize the sponsor (say by putting up canopies, banners, logo's on posters and publicity material and merchandise of the event, video adds played in between the events, publicity by media partners, news paper adds that you will give about your event etc). Do make a tabular summary at the end of the proposal of the offerings, do mention the sizes and the number of the banners, adds, logo size etc explicitly.

After this analyze what you might expect from a company depending upon the company and site that as the expected investment. Be very sure not to put large sum or you may scare away people. And also remember that what you site you will always get about 1/4 of the amount . For example at out cultural fest at NIT Jalandhar with starts as Master Saleem, Gurpreet ghuggi, Christopher James etc. we got the title sponsorship amount of Rs 1.5 lacs, but you may expect it to be about 2.5 lacs.

Before sending the proposal always tailor it for the company you are sending to. Give offering as fashion partner or style partner or energy partner etc, this creates more impact. You don't need to make many changes to the proposal though.

You can also prepare a PPT but people generally do not see that so concentrate more on your PDF proposal.
The next step is to select the prospective companies, do think at what time of the year your event is and what products may need publicity at that time. Say if its in the start of summer send apparel companies a proposal stating that their investment in your fest can help push their summer launches etc. Look around in news papers and TV and see which companies are putting more money for marketing, analyze which company might find college students as its target audience. Remember the 80:20 principle, put your energy in just 20% of the companies and they will give you 80% of the money. Let the task of tackling not so prospective companies distributed among the juniors, you concentrate more on the prospective companies.

The next task is to get the contacts of the companies. Send your team to local outlets of the company and ask them to get the phone number of the highest possible person in the company, call him take the number of marketing manager from him, you might have to call 5-6 people before you reach the right person and this is worth the trouble, I reiterate "Getting the right person can make that difference to get the deal done or not".

Now you have the contact of the marketing personnel call him tell him about your college fest and ask him how to proceed or suggest him that you will mail the proposal and he can check it, do not just mail first call the person then mail him otherwise people will delete your mail even without reading, after you mail him call him next day and tell him that you have mailed the proposal and if he needs any further info you will be happy to send that too (this is just to remind him that he may read your mail), he might ask for some time so call him after 2 days again, please keep in constant touch else he will forget about you. He might say their is a long time to your fest and we can talk about it then, don't let that happen, later he will say there isn't much time left to finalize things or even he might forget you completely, say you need to start publicity or you need to confirm guest so you would like to get the deal done as soon as possible. Sometimes when u call he might not take your phone, be prepared for that call him again after an hour, send him messages if he doesn't take your phone, mail him etc, you must make yourself visible to him but be cautious you should not piss him off if he really is busy and this you have to decide according to the person, no one call guide you here.

One final note, if you have joined sponsorship team be prepared to get many rejections, only 1 out of 10 companies you try might fetch you something if at all but by the end of the day you would accumulated a lot of experience ...so go tiger give it a try ..best of luck.

I have written a follow up to this post, with the experiences I accumulated while working for corporate companies post college. 

Thursday, March 4, 2010

LINUX KERNEL BOOTUP PROCESS:

Did you ever wondered what actually happens between the time we power on our PC to the time a login prompt is displayed? This time is the so called “booting process”or “bootstrapping”. You might have heard of that term before but here we are going to see in details what actually happens during bootstrapping.

Before we start with the booting process it is necessary to understand a few terms. The first of them is Real and Protected mode of the CPU. Early computers( Intel 8086) with 20 bit addresses where able to access only 1MB (2^20) of physical RAM. They used Intel's segmented memory addressing with 16-bit registers where each register can by itself refer to just 64KB of memory. The 20-bit memory address can be accessed only by using a segment register and offset register together . This is called real mode segmented memory model with only 1MB of addressable memory.
With 32-bit CPU's (starting Intel's 80386) memory address became 32-bit (total of 4GB of memory) long and the registers inside the CPU also became 32-bit so that each register can (but not allowed) by themselves refer to any 32-bit memory location. But here the registers are not allowed to directly refer to any memory addresses to enforce protection of memory. This is called protected mode flat model of memory with 4GB of addressable memory.

Bootstrapping includes loading of kernel image into RAM, initializing kernel data structures, executing the kernel and passing control to it.
Here for explanation we use the IBM PC with Intel X386 CPU and try to boot a Linux 2.2 kernel from a hard drive.

When we press the power on button a hardware circuit sets the RESET pin of the CPU , which causes some predefined values to be put in CS and EIP registers causing CPU to start executing the code present at 0xfffffff0. This address is mapped by the hardware to a ROM containing what is called BIOS (basic i/o system) which contain low-level procedures to interact with various devices like hard disk, display etc. BIOS is run in real mode where each memory address is a pair represented as segment:offset.
BIOS first performs a number of test (called POST, Power-On-Self-Test ) to probe which devices are present in the system. After POST it initializes various hardware devices thus found. Then it searches for operating system to boot depending upon the setting it starts with floppy , CDROM or hard disk.
Each hard drive in its first sector called master boot record (MBR) has a partition table and a small program that can load the first sector of the partition that contains the operating system to be booted.

A boot loader is a program that can load the kernel image of the OS to the RAM (may be from hard disk or CDROM) and prepare it for execution. For Linux on Intel system the most famous is LILO (LInux Loader) others include GRUB (GRand Unified Boot loader). LILO boot loader is a two-part program with the first part replacing the small program of MBR. The BIOS loads the small program of MBR ( here first part of LILIO) starting at 0x000070c00 and jumps at it. This program moves itself at 0x0009a000 , sets up the real mode stack and loads the second part of LILO starting at 0x0009b000.
This program searches all the operating systems present in the hard drive and provides a user options to boot into the available OS's.
Assuming Linux is to be booted , LILO will display the “Loading...” message using the BIOS routines, calls a BIOS routine to load the setup() code from the kernel image at 0x00090200. Invokes BIOS routines to load the rest of the kernel starting at either low address 0x00010000 for small kernel image (zImage) or high address 0x00100000 for big kernel image (bImage). Then it jumps to the setup() code.

Setup() function reinitializes all devices in the system even though they where previously initialized by BIOS as Linux does not rely on BIOS functions. Setup() finds out the amount of RAM available (using a BIOS function) , sets keyboard delay rate , initializes video adapter. If the kernel image was loaded low in the RAM ,then it moves it to 0x00001000. Sets up Global Descriptor Table (GTD) and Local DT ( LDT) (used for protected mode memory addressing) , sets up Interrupt Descriptor Table (IDT).
Switches the CPU from real mode to protected mode by setting a bit (PE) in the CPU status register (cr0).Jumps to a assembly language function startup_32(), in the source code hierarchy coded in the file arch/i386/boot/compressed/head.S.

Startup_32() function initializes segmentation registers and the uninitialized data area of the kernel executable ,it then executes the function decompress_kernel() which prints the message “Uncompressing Linux...” and the decompressed kernel is placed at the address 0x00100000. It then jumps to that address.
The address 0x00100000 is the executable code of another startup_32() function which is coded in the file arch/i386/kernel/head.S. This startup_32() function sets up the kernel mode stack , loads the registers gdtr and ldtr with the address of GDT and LDT. It then jumps to start_kernel() function.

Finally all kernel components are initialized by this start_kernel() routine. It initializes page tables ( call to paging_init() ), IDT by calling trap_init() and init_IRQ(), creates kernel thread for process 1 by calling kernel_thread() which in turn executes /sbin/init program . At the end the login prompt is displayed and by that time Linux kernel is up and running. Here the “bootstrapping” process is complete.
Now go play with your PC !!!

Mohan Gupta
CSE Final Year
NIT Jalandhar

READING THE LINUX KERNEL SOURCE CODE

Linux kernel is of the most stable and widely used kernel available and also the most rapidly changing one (as per the rate of change of lines of code). With over 1.7 million lines of code , some assembly and mostly C code, the obvious question is where to start reading it. This is what we are going to talk about here.


GETTING THE KERNEL SOURCES:
Linux kernel is distributed in versions ,the latest being version 2.6, each version further have many releases like 2.6.23.1-42. You can get the source code of all the releases at www.kernel.org as a .tar.bz2(or any other format) compressed image. To decompress XXX.tar.bz2 file using something like .

# tar -cjf XXX.tar.bz2 DIR_TO_STORE/

Decompressing the file creates a directory structure with a number of sub-directories.
Here we used an older version of Linux (other version also have almost identical structure) and downloaded the file Linux-2.2.0.tar.bz2. which is 10.1MB in size. Its decompression resulted in the creation of a directory Linux-2.2 with the following important sub-directories :

arch- It has a directory for each architecture supported( alpha, i386 etc) and contains all the architecture specific code. It means it contains all the low level code that define the underlying architecture.

boot- It contains two very important assembly language code files boot.S and head.S( though in the newer versions these have been moved inside the arch/XXX/kernel/ sub-directory, where XXX is the architecture name ). These files contain code for the initial booting of the kernel.

Documentation- The Linux kernel documentation.

fs- code files related to file system.

drivers- code for drivers for various devices supported like pci,usb, IDE, acpi, CDrom etc.

init- this is where the first process is started by the kernel.

kernel- files relating to system calls , kernel synchronization , timing etc.

mm- memory management code files.

ipc- inter-process communication code.

include- all the .h header files used in various .c files in the kernel .


Where to start:
The best place to start with should be the place where init process is created by the kernel in the file SOURCE_CODE_DIR/init/main.c. Here is where usermode operation of the system starts after successful boot. You would also like to have a look at the head.S and boot.S start up files to see what actually happens at startup. When the kernel boots up all the messages printed out by the kernel to the display is done by a kernel space function printk(), kernel cannot use the traditional C function printf() because printf() itself ultimately depends upon the kernel system calls to perform its functions. All this messages produced during startup are saved in a kernel buffer and can be viewed by the command dmesg even after bootup is complete.

# dmesg

Now you can search for these strings along with the printk() to find there location in the kernel sources to find where actually these events happen like say you can search for "printk(" Calibrating delay loop...") " in the sources to find that it is printed in the file inti/main.c.

You can visit http://lxr.linux.no which hosts code of all the versions Linux and can cross-reference the code there. It provides hyperlinked network between various keywords in the code, say you have a function call xyz() in a file , if you click on xyz() it will take you to the location in the file where xyz() is defined.

You can have a look at a nice article on where to start reading Linux kernel source code at http://en.wikiversity.org/wiki/Reading_the_Linux_Kernel_Sources.

Happy reading kernel!!

Mohan Gupta
CSE Final Year
NIT Jalandhar