Friday 8 May 2015

Building a Sugar Desktop Environment

Clone the sugar-build repository from git
git clone git://github.com/sugarlabs/sugar-build.git

Enter in the directory and pull the latest source code
cd sugar-build
./osbuild pull

Build the source code
./osbuild shell
build

Finally run the Sugar environment
run

You will get your Sugar environment open if there is no error.


snapshot2.png



Type Shift-Alt-Q inside sugar to exit.

Friday 6 February 2015

Sugar for Children


Sugar IDE
Sugar is an interactive and easy to learn platform for kids. And now, coming to what is Sugar? Sugar is a free and open source desktop environment designed for interactive learning for children. It started as a part of One Laptop per Child project (OLPC) as its default desktop environment. The mission of OLPC is to develop low cost laptops and provide children around the world with new opportunities. Sugar is a free software developed under Sugar Labs, which is a non-profit organization where developers and educationists work together for the development of the software. Sugar Labs is a community that supports and promotes Sugar learning platform.

Sugar is an attractive and colorful desktop environment created with an aim of quality education for children. Sugar does not use desktop, folder or window as its user interface objects. Instead, it uses a full screen view which helps children to concentrate on one job at a time. It is developed in Python language and runs on GNU/Linux. It is released under GNU General Public License and is available in 25 languages. Most applications in Sugar are the forks of existing applications in GNOME. It is available as USB-Bootable Linux distribution and Live CDs.

Why Sugar is interesting? 
Sugar supports sharing and collaboration for users. It does not contain applications like other desktop environments. Learner applications in Sugar are called Activities. It includes activities like Pippy(introductory environment to learn Python), Journals(object and activity browsing), Distance(measure the distance between two laptops) etc which are exclusively designed for easy use for kids. In the Sugar Neighborhood view, children see their connected friends; they can join each other’s activities.

Sugar teaches you through three experiences:

Sharing, which shows the presence of others involved in the activity by sharing ideas.

Reflecting, where Sugar uses journals to record each activity of the user which helps in progress assessment.

Discovering, where users of different levels of skills join together in a single platform and go deeper and deeper with no restrictions.

Sugar provides children with the opportunity to explore, express and experiment themselves. 

References 








 


Friday 9 January 2015

Writing a simple Linux Device Driver

          A device driver is a program that controls a particular type of device that is attached to your computer. There are device drivers for printers, displays, CD-ROM readers, diskette drives, and so on.
Now let us write a simple Hello World driver code.
Create a directory anywhere in your home folder and navigate into that directory.
mkdir hello
cd hello
Create two files hello.c and Makefile
You can use any editor as you wish. Here I use Kate.
kate hello.c
Type the following code

#include <linux/init.h>
#include <linux/module.h>
static int __init hello_init (void) {
printk(KERN_ALERT "Hello World!!!");
return 0;
}
static int __exit hello_exit(void) {
printk(KERN_ALERT "Goodbye World!!!");
return 0;
}
module_init(hello_init);
module_exit(hello_exit);

Here, the hello_init() function runs when the module is loaded and hello_exit() funtion runs when the module is unloaded. Save the code.
Next we can create the Makefile.
kate Makefile
Type the follwing code in it. Make sure that you intent the code perfectly.


ifneq ($(KERNELRELEASE),)
obj-m := hello.o
else
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
    $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
clean:
    rm -rf *.o *.ko *.mod.*
endif


When you are done till here, we need to build the module. For that type,
make
It hardly takes half a minute. When the module is successflly built, you get a bunch of object files in the hello directory. Thus the Hello World module is ready.
Now let's see the working of the module by loading it into the kernel. Type,
sudo insmod hello.ko
This will load the module into the kernel which we can check by typing ,
lsmod
You get a list of module on top you get your hello module. To see whether the module is running in you kernel or not, type
dmesg
The Hello World message will be printed that we wrote in hello.c file
To remove the module type the following instruction in the terminal
sudo rmmod hello
Here the exit function that we typed in hello.c is run. To check the output type,
dmesg