_UnPrEdictAbLe_

All that you need to find out about what am I upto.

Archive for the 'Hardware' Category


Dream Operating System

Posted by Anurag on 14 October, 2007

Anyone who is remotely related to programming, internet and such has a dream to create something of his own. Often this dream is of creating a new Operating System of their own. An operating system that will be faster than any other, will support everything and will have so many features that it’ll outnumber Windows XP in its user-base!

Yes, its close to impossible to outnumber Windows XP user-base or even Free BSD for that matter ;). Yes, its close to impossible to make something faster than them and still support as much as they do! Yeah, you can make a ‘hello world OS’ which is zillion times faster than any other, but whats the use?

Ok, all this was to build up a platform to talk to you. Well, just like ‘everyone’, even I have dreams. And they never become concrete, only day-dreams of all that I said before :D. But then, I realized that I wasted some 8 years in just dreaming! I didn’t take the next step which generally ‘human beings’ take. Thats how the human race has progressed from apes to what we are now, ‘mobile apes’ :D.

Anyways, so basically, till now I was a dumb day-dreamer like a couple of million more, when this angel came and told the golden words in my ear, … “IDIOT! START TOH KAR” (means, Idiot! Stop dreaming and start something). And then, me, following her words began to look in the world around me.

Coming to the point directly after all this drama, the straightforward deal is Tanu asked me to do something in this regard, and I began reading about OS development, and trying out ’something’ ;).

Ok so the next FAQ looks to be, ‘So have you begun your own OS?’. Dude, chill, Microsoft Inc. took five whole years before they could change these lines :D

printf (”Welcome to Windows XP\n”); to printf (”Welcome to Windows Vista\n”);

So, its not that simple as it sounds in the dream world. At least the 80X86 processor is not as simple as it should have been. And then there are other mental blockages for me. Here is a list,

1. Why make another *nix clone? Why not something new?

2. Everything is a file, umm.. *nix concept, I want something original, WHAT?

3. Copy windows? Uh, not even in my dreams :P

4. Why C? Why not my own D or E or F or G? Do I need to write another compiler :O

5. Why OS? What happened to web-dev and python scripting? And eh, computer vision?

6. My own filesystem or new? Why old? Why not be ‘readable’ by others? Linux also did ext2, why not me do my own AFS or something?

7. Ok, so if I use C, how do I write my kernel? I don’t even know much about it!

8. Uh, all this GDT, IVT, IDT, Page table, Multitasking, PCI, A20 line, and every damn thing has a hundred configuration settings. Am I enough or I need help?

So, basically I didn’t reach all this just by beginning. First I encountered Viral Patel (http://www.viralpatel.net), who is a anti-ME. He actually made a fully functional ‘CLOSED SOURCE’ OS, called Taj OS (named after Taj Mahal).

Then I reached www.osdev.org, which is a whole portal dedicated to help people like me try their hands on some OS development. It lists more than hundred hobby operating systems developed by people, many of which are open source and closely resemble *nix or DOS. The site has extensive tutorials for all aspects of OS development, with some holes left, which I might fill up one day.

I started using ‘nasm’ compiler to write initial bootable code in assembly. Using ‘vmware’ to keep it ’safe’, I booted the first few experiments, and with the help of Fedora Core 7 rescue DVD, I installed the bootloader onto the ‘virtual vmware hard disk’. So, now my small bootable assembly program can boot from a disk, read the keyboard and display messages! Cool for a start, at least I can feel that :D. Ofcourse, that hard disk will be able to boot my OS (rather boot code) and nothing else, even if we try GRUB.

Now, my next tasks are to read this book, THE INTEL MICROPROCESSORS (750 pages :() by BARRY B. BREY and C. R. SARMA (Rs. 299 only :D). And then I’ll have a better clue of the things that are happening. Then I might decide to begin some design of an OS, if I still have interest left. I also read the source-code of Ace OS (1.0 and 2.0), DEX OS 1.1, which are small operating systems, written in C and are somewhat understandable. Viral’s OS doesn’t run on my vmware and I don’t have a floppy drive, :D.

Ok, maybe I am thinking too high, but if I make one, I won’t make a ‘floppy OS’ for some DOS work, I’ll make a real installable OS with a CD setup and a hard-disk GRUB compatible install. I might not remain compatible with *nix, so maybe it’d be difficult to port Linux applications to it, but I’ll maybe write some of my own!

Right now, all this is a distant dream, but gladly the first bricks have been laid. And soon, when I am on the same level as other OSdevers (term for OS developers), I’ll come up with some concrete thing to write here.

Created a new page to log my knowledge and status on this issue.

Any comments are welcome. Any people interested in development can discuss with me, learn and share. But right now, as there is no ‘development plan’, there is no ‘development team’. Though, I will need more people by my side when I really go into doing it. And as you know, that there is no plan, YOU can affect the plan, and YOU can make it your plan. So, like me, you wont have hesitation in joining me when we actually begin work, because it’ll be YOUR OS too!

More information soon. Cheers!

PS: I fell from the bike, injured my knee, so maybe some cells in my ‘brain’ have been killed or altered, so I am thinking wierdly these days. Operating system and me, really huh?

PS2: Am perfectly fine guys, just an injury on the knee, so thanks for being concerned, but don’t worry, I’ll be ok.

PS3: HA HA HA, ok fine so you are not concerned, neither am I concerned about your concern ;).

PS4: Someone ask me to shut-up yaar!

Ok bye then. Take care.

Posted in Hardware, Linux, My operating system, Project work, System software, Thoughts | 7 Comments »

My mood swings and some techno crap

Posted by Anurag on 18 May, 2006

Human brain is an amazingly complicated thing. It can create virtual scenarios out of thin air, it can come up with thoughts which have no meaning at all and still depress you, it can come up with imaginations and ideas which no one ever thought about (using their brains, lol), it can make you feel romantic or excited or what ever in the world’s most gloomy and dirty places, it can make you imagine that something is great or beautiful or wonderful or amazing, though it might not be so, the brain can …. eh.. it can do what ever your brain can think of.

Last few days, I have been kind of irritated and/or depressed about being in Noida. Well, if you judge materialistically, everything was fine. An office with AC/PC/net, freedom to do anything in the evening, two new cities, Noida and Delhi. But then, it got a little monotonic,

  • come out of office
  • go to the Centre Stage Mall
  • eat or see a movie and return
  • sleep early and wake up early.

Maybe that wasn’t that exciting, but then, it wasn’t like I should decide to return to IIIT. Actually, the problem is, I was feeling bad that I couldn’t work on the BTP, which Jawahar sir was eager about. Mixed with some other feelings, last Sunday I had decided to quit the job at Kritikal. But then, I stayed on. Its feeling a little better today, lets see.

Kingsun DKU-5 USB to serial cable

Well, as Nikhil has this cable, I wanted to make it work on FC2 which I am using. I googled again with some success. I found out that ‘cypress’ driver which is a loadable module in the kernel supports this cable. But for that we need to patch cypress_m8.c and cypress.m8.h in KERNEL_SOURCE/drivers/usb/serial directory. The patch wasn’t compatible with the kernel source I had got. So, I read the patch file and manually patched the two files. Finally the kernel compilation failed when it reached the patched files due to some errors. Frustrated and tired, I finally gave up. Here is the link to the patch (nokia ca-42) (http://gnome.dnsalias.net/patches/). Though it mentions that it works for the CA-42 cable, it might work for DKU-5 (http://www.qbik.ch/usb/devices/showdev.php?id=3565).

Bon Echo alpha 2

A new alpha version of Firefox 2 has been released called Bon Echo Alpha 2. I downloaded and installed it. It has prebuilt session saving crash recovery, a suggestion system for ‘google search’ (like intellisense), and is much like the good-old firefox. Most extensions say that they are incompatible with it, but that’ll change soon I think. Due to lack of extensions and themes compatibility, I am back to Firefox 1.5.0 for the time being.

Conclusion

Rest of life is fine. Its Alvy’s birthday on 20th. I’ve to get a gift for her, lets see. My code isn’t working well, so rest of the day is just hard work!

Ciao.

Posted in Hardware, Moods, Outside IIIT, Thoughts, Utility software | 5 Comments »

tv.iiit.ac.in

Posted by Anurag on 14 March, 2006

How did it happen? Another idea by our good old Jawahar sir. Tarun was already recording news using some windows software whos license expires every 16 days! He knew it could be done in Linux too, he had done it before. Finally, first we came up with a portal so that we can test how people like the interface. Still runs on http://172.17.9.33/videoserver

The next step was the harder one. Making a recording possible in Linux. It wasn’t difficult as we thought. But then, first we had to tune the channels. Those hardware frequencies given ‘human recognizable’ names. We tuned about 40-45 channels, of which the one available are of good reception. Then, as we all know, Linux and audio are the two things that never meet. We did anything, left, right, center, /dev/dsp, /dev/dsp0, alsamixer, kmix, aumix, rpm, ffmpeg, nothing made audio come out! Finally, somehow we figured out the solution and it was recording.

The first video recorded was of ‘GREAT QUALITY’ but unfortunately 40 MB per 20 seconds. We kept trying different tweaks, codecs, but the compression ratio didn’t come down for the ‘best possible’ quality. Not the disk space but the ‘feasibility of download’ was the criterion in mind. Finally, we decided to drop the quality till we find a solution. And the odd channel switches might be caused by the operator himself as there is no other way one can change the hardware frequency that the card is using.

We’re planning a discussion forum kind of thing to be added there. And as and when the requirements start looking obvious, we’ll make changes. Expect a DF coming up soon. And thanks for all your compliments.

Ciao.

Posted in Development, Events at IIIT, Hardware, Life at IIIT, Project work, Utility software, tv.iiit.ac.in | 3 Comments »

Logitech QuickCam Notebook Pro

Posted by Anurag on 2 September, 2005

Logitech QuickCam Notebook Pro. This piece of hardware worked flawlessly when I used some kernel 2.6.10 in Fedora Core 2. But, ever since I installed Fedora Core 4, it didn’t work.

I explored for the reason, and found this answer,
“The linux kernel has stopped supporting philips webcam driver, as it was not released under GPL”
Just because the driver wasn’t open source, it was removed from the kernel, and poor users like me were helpless.

Exploring a little more, I came to know that the driver consisted of two parts, PWC and PWCX. While PWC was open source, PWCX was not. So, there was sourcecode of PWC, which could be compiled and installed to support my hardware.

After some searching, I reached http://www.saillard.org/linux/pwc/RPMs/. Here, I found some RPMS for the kernel module for PWC driver. As my kernel was not listed, I downloaded pwc-10.0.6a-1.src.rpm.

Now, the task was simple, just compile and install.
rpm -hiv pwc*.rpm
cd /usr/src/redhat/SPECS/
rpmbuild -bb pwc.spec
cd /usr/src/redhat/RPMS/i386/
rpm -hiv kernel-modules-pwc*.rpm

It got installed correctly. Then, I plugged in the CAM, and run xawtv. But, unfortunately, the output was a blank window. I could not understand why it happened.

I tried to investigate the contents of the rpm.
$ rpm2cpio kernel-modules-pwc_2.6.12-1.1398_FC4smp-10.0.6a-1_fc4.i386.rpm | cpio -t
./lib/modules/2.6.12-1.1398_FC4smp
./lib/modules/2.6.12-1.1398_FC4smp/misc
./lib/modules/2.6.12-1.1398_FC4smp/misc/pwc.ko
$ cd /lib/modules/2.6.12-1.1398_FC4smp/
$ find . -name *pwc*
./misc/pwc.ko
./kernel/drivers/usb/media/pwc
./kernel/drivers/usb/media/pwc/pwc.ko

Then, I realized that the RPM is actually putting the driver in the misc directory of kernel modules, while its using the one in kernel/drivers/usb/media/pwc/. I just did,
$ cd /lib/modules/2.6.12-1.1398_FC4smp/
$ cp misc/pwc.ko kernel/drivers/usb/media/pwc/
Overwrite file ‘pwc.ko’ ? y

And now, it worked!! So anyone of you, with this hardware and a 2.6.x kernel, do what I did and be happy. Cheers.

Posted in Hardware | 1 Comment »

Reliance FWP Internet in FC4

Posted by Anurag on 5 August, 2005

Setting up Internet using Reliance FWP is jus a cake walk …

These are the steps that need to be followed

  1. Check out whether you have wvdial software installed in your system. For FC4 it is automatically installed, so no issues..
  2. Check in which serial port you have attached the modem (ie WFP) Normally it is ttyS0 or ttyS1
  1. Login as Root user and check the following command “wvdialconf /etc/wvdial.conf” works..
  2. Finally you should get something like this
  1. “Found a modem on /dev/ttyS0.
    Modem configuration written to /etc/wvdial.conf.
    ttyS0<Info>: Speed 115200; init “ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0″
  • Next thing is we need to edit the wvdial.conf file, Add the following contents there..
      • [Modem0]
        Modem=/dev/ttyS1
        Baud=115200
        Dial Command = ATDT
        init1=ATZ
        init2=AT+CRM=1
        Flow Control= Hardware (CRTSCTS)
        [Dialer reliance]
        Username = YourUserName
        Password = YourPassword
        Phone = #777
        Stupid Mode = 1
        Inherits= Modem0
  • Close the file after saving the contents
  • Now type in “wvdial reliance” in the prompt … you should get the following
      • [root@localhost ~]# wvdial reliance
        –> WvDial: Internet dialer version 1.54.0
        –> Initializing modem.
        –> Sending: ATZ
        –> Sending: ATQ0
        OK
        –> Re-Sending: ATZ
        OK
        –> Initializing modem.
        –> Sending: ATZ
        –> Sending: ATQ0
        ATQ0
        OK
        –> Re-Sending: ATZ
        ATZ
        OK
        –> Initializing modem.
        –> Sending: ATZ
        –> Sending: ATQ0
        ATQ0
        OK
        –> Re-Sending: ATZ
        ATZ
        OK
        [root@localhost ~]# wvdial reliance
        –> WvDial: Internet dialer version 1.54.0
        –> Initializing modem.
        –> Sending: ATZ
        –> Sending: ATQ0
        ATQ0
        OK
        –> Re-Sending: ATZ
        ATZ
        OK
        –> Initializing modem.
        –> Sending: ATZ
        ATZ
        OK
        –> Sending: AT+CRM=1
        AT+CRM=1
        OK
        –> Sending: ATM0
        ATM0
        OK
        –> Modem initialized.
        –> Sending: ATDT#777
        –> Waiting for carrier.
        ATDT#777
        CONNECT
        –> Carrier detected. Starting PPP immediately.
        –> Starting pppd at Mon Jul 29 00:28:24 2002
        –> pid of pppd: 2919
        –> Using interface ppp0
        –> local IP address 220.226.33.135
        –> remote IP address 97.238.2.7
        –> primary DNS address 202.138.103.100
        –> secondary DNS address 202.138.96.2
  • Now open up your fav browser.. in my case it is firefox.. jus type in any url and chk if net is working. If it works, you wil be lucky, if not, jus start the service named “service named start”
      • [root@localhost etc]# service named start
        Starting named: [ OK ]

    Now if you go back to the previous step.. and chk the pages it would probably load.. if not leave a comment, lets chk out wat can be done

    Posted in Hardware | 8 Comments »