DirectoryComputersBlog Details for "My World! - Jasjeet Chawla's Blog"

My World! - Jasjeet Chawla's Blog

My World! - Jasjeet Chawla's Blog
This blog provides relevant information on various Operating systems, different flavors of Linux and softwares. A must visit

Articles

Using I/O ports in C programs
2007-12-14 15:53:00
Routines for accessing I/O ports are in /usr/include/asm/io.h (or linux/include/asm-i386/io.h in the kernel source distribution). The routines there are inline macros, so it is enough to #include ; you do not need any additional libraries.PermissionsBefore you access any ports, you must give your program permission to do so by calling the ioperm() function (declared in unistd.h) before any I/O port accesses. The syntax is ioperm(from, num, turn_on), where from is the first port number to give access to, and num the number of consecutive ports to give access to. The last argument is a Boolean value specifying whether to give access to the program to the ports (true (1)) or to remove access (false (0)). ioperm() can only give access to ports 0x000 through 0x3ff; for higher ports, you need to use iopl() (which gives you access to all ports at once).Accessing the portsTo input a byte (8 bits) from a port, call inb(port), it returns the byte it got. To output a byte, call outb(value, por...
More About: Programs , Ports
Character Device Drivers
2007-12-09 15:50:00
Device drivers are mainly categorized in four different categories namely character drivers, block drivers, terminal drivers and streams. Character drivers transmit information from the user to the device (or vice versa) byte per byte. The following figure will make it easy to understand this class of drivers: The file_operations Structure The file_operations structure is defined in linux/fs.h, and holds pointers to functions defined by the driver that perform various operations on the device. Each field of the structure corresponds to the address of some function defined by the driver to handle a requested operation. The file structure Each device is represented in the kernel by a file structure, which is defined in linux/fs.h. It's not the same thing as a FILE, which is defined by glibc and would never appear in a kernel space function. It represents an abstract open `file' which is represented by a structure named inode. Registering A Device Adding a driver to your sys...
More About: Drivers , Device
Compiling a Device Driver Module
2007-11-23 16:59:00
In many cases drivers compiled for similar kernel versions will work. Pre-compiled modules in the form of RPMS for popular distributions are frequently available. If a pre-compiled module is not available; you'll have to compile one from the driver source code, or the source code RPM (SRPM). * Verify that the source code for your current kernel version is installed. * If you don't have a /usr/include/linux/version.h file, do cd /usr/src/linux; make include/linux/version.h * Copy the driver source code to a source directory * Compile the file using the compile-command at the bottom of the driver source file. If a compile-command is not there use the following compile command:gcc -DMODULE -D__KERNEL__ -O6 -c driver.c* As 'root', test the module by doing "insmod driver.o". * Install the driver module in the proper location for your distribution. This is usually /lib/modules/kernel-version/net/driver.o. The command to do this isinstall -m 644 driver.o /lib/modules/`uname -r`/net/Tes...
More About: Driver , Device , Module
OpenSuSE 10.3 REVIEW
2007-11-16 12:07:00
I switch operating systems like any other guy switches his underpants. If today I write/review FreeBSD, tomorrow I might write about Ubuntu. I am an OS lover, so it was very important for me to find an operating system which I can love and develop at the same time! Thanks to Novell's brilliant effort: OpenSuSE (pronounced as Open SooSaa).My memory with Novell goes back to the time when I first installed SuSE 9(Enterprise Desktop) on my Desktop with minimal requirements. Now I work on my Lenovo 3000 N100 laptop. I have tried several flavors of linux on my notebook but none satisfied my needs so far. I began with Red Hat 9. It was sort of old so I shifted to Fedora Project. I installed Fedora core 4 but again my sound card and the network card was creating dubious issues. After fedora I switched to Mandrake. Mandrake 10.1 was enticing with a nice KDE and GNOME env, but again, it didn't recognize my Wireless card Intel Pro 802.11 a/b/g. I switched to RHEL4 (Red Hat Enterprise Linux) ...
More About: Review
Task Scheduling in Operating System Kernel
2007-10-26 01:42:00
Its quite important for all of us to clean up our systems just like we clean our houses in a 'house-keeping' job. A process carries out any task which is placed in the crontab file . The same task can be carried out by a kernel module in two different ways: 1) In first way, the process is put in the crontab file which wakes up the module by a system call, for example by accessing a file or writing to a file. I personally don't refer this mode, however -- we run a new process off of crontab, read a new executable to memory, and all this just to wake up a kernel module which is in memory anyway.2) The other way would be to create a function that which can be called once for every interrupt. The way we can do this is by creating a task initially held in a struct tq_struct, which holds a pointer to the function. Then, we can use queue_task to put that task on a 'task list' called tq_timer, which is the list of tasks that are to be executed on the next interrupt. Because we want the...
More About: System , Operating System , Operating , Kernel , Task
OS concepts: Thread vs. Task
2007-10-22 08:07:00
I am sure many of us have confused these two terms together. I remember preparing my assignment once in OS, found the copy in cupboard which is like 3 semesters old :D....would like to share it with you all.A thread is a point of control flow in a task. A taskexists to provide resources for the threads it contains. This split is made to providefor parallelism and resource sharing.A threadis a point of control flow in a task.has access to all of the elements of the containing task. executes (potentially) in parallel with other threads, even threads within the same task.has minimal state information for low overhead.A taskis a collection of system resources. These resources, with the exception of the address space, are referenced by ports. These resources may be shared with other tasks if rights to the ports are so distributed. provides a large, potentially sparse address space, referenced by virtual address.Portions of this space may be shared through inheritance or external memory m...
More About: Concepts , Thread , Task
VoIP (Voice over internet protocol)
2007-10-19 14:43:00
Day before yesterday, I was called up in our HoD's office. He asked me to present a paper for university level Tech. fest organised by Chandigarh Engg. College.I agreed as I couldn't talk myself out of that. The topic list included several enticing topics but the one that fascinated me the most was VoIP.here's a glimpse of the abstract I prepared....VoIP (Voice over Internet Protocol ) Author: - Jasjeet Chawla Student, I.E.T. BHADDAL ABSTRACT: Voice over Internet Protocol (VoIP) allows you to make telephone calls using an Internet connection instead of a regular telephone line. One of the most important things to point out is that VoIP is not limited to voice communication. In fact, a number of efforts have been made to change this popular marketing te...
More About: Voip
Now from here to Where?
2007-10-16 09:52:00
Well, enough has been said and done about device drivers in linux! I'd love to add something of my own as this is my key field of interest. I have been working with device drivers and kernel modules since early 2k6(my 5th semester).I personally feel that kernel programming is the next step after you have strong concepts in C programming. 'We must believe in order to acheive.' Yeah that should be the driving phrase if you want to dedicated yourself to kernel programming and OpenSource developer community!I could have written a lot on Kernel Programming and starting off with device drivers. But due to scarcity of time I have to wind up quickly today on a note that I'll be back with more.Meanwhile, you all kernelHEADS can go through this article which provides with the basics of Writing Device Drivers.Sorry for the small post. I'll surely be back with more. Take care. Ciao!
What exactly happens when u boot!
2007-10-14 12:50:00
In the case of Linux, the following steps are performed to boot the kernel: 1) The boot loader program (e.g. lilo or grub) starts by loading the vmlinuz from disk into memory, then starts the code executing. 2) After the kernel image is decompressed, the actual kernel is started. This part of the code was produced from assembler source; it is totally machine specific. Technically at this point the kernel is running. This is the first process (0) and is called swapper. Swapper does some low level checks on the processor, memory and FPU availability, then places the system into protected mode. Paging is enabled. 3) Interrupts are disabled (every one) though the interrupt table is set up for later use. The entire kernel is realigned in memory (post paging) and some of the basic memory management structures are created. 4) At this point, a function called start_kernel is called. start_kernel is physically located in /usr/src/linux-2.4.18-27.7.x/init/main.c and is really the core kernel ...
More About: Boot
Today's assignment: Makefiles for Kernel Modules
2007-10-13 04:18:00
Lets get straight to the point why I created this blog for. I am not your teacher to take you through the basics of Kernel /C programming under linux. ;) and I consider that people reading my blog have a prior knowledge of programming in C. (sorry if this is a jump from beginner's level to Novice...This post is for people who want to stop reading and start coding straightaway. Although I will touch on how things are done in the kernel in several places, that is not my purpose. There are enough good sources which do a better job than I could have done!) A kernel module is not an independent executable, but an object file which will be linked into the kernel in runtime. As a result, they should be compiled with the -c flag. Also, all kernel modules have to be compiled with certain symbols defined. __KERNEL__ -- This tells the header files that this code will be run in kernel mode, not as part of a user process. MODULE -- This tells the header files to give the appropr...
Understanding the Kernel: basics!
2007-10-11 14:21:00
Several online definitions can be found on proprietary websites viz. Wiki, about....etc. The one that appeals to me the most defines the Kernel of an OS as the part of the operating system that loads first, and in the main memory. Because it stays in memory, it is important for the kernel to be as small as possible while still providing all the essential services required by other parts of the operating system and applications.To me, a simple definition would do : Kernel is the core or the crux of the operating system! It is the only link between the hardware and the software. Seems simple to understand, no?? Well....look at this diagram of the Linux kernel, and you'll be able to adjudicate for yourself. ;)Diagram of the linux kernel. (click to view and enlarge)The kernel's primary purpose is to manage the computer's resources and allow other programs to run and use these resources, these resources include the CPU, the main Memory (RAM), and the I/O devices. Typically, the kernel...
More About: Basics , Understanding
Introduction
2007-10-10 12:27:00
Its been a long time that my friends and colleagues have been asking me to write. I always had something or the other to say. Well, come on, anyone is not so busy to invest 5 minutes on a blog entry daily. So, finally I am here posting my first entry. As you all might have guessed, yes, I am a final year student of Computer Science & Engineering. This one's for you folks. I intend to be regular with my posting, on everything I know or have known so far, about technology, life and other determinant aspects. My special thanks to several people who have inspired me to write either by direct word of mouth or by their successful blogs/sites : Puneet Chawla, Nitin , Ankur . I have been working on the linux kernel for about an year now. Written couple of device drivers and tweaked plenty of modules in MINIX OS.Will write more about everything related to the mysterious OS and its Kernel in the upcoming posts.Have a great day ;)
More About: Introduction
40969 blogs in the directory.
Statistics resets every week.


Contact | About
© Blog Toplist 2008 - SEO by FeWorks
eXTReMe Tracker