K-I-S-S-I-N-G...
The new machine I built was meant to be a VPN server, Vmware server, media centre, myth-ical backend and gaming rig. I hand picked each of the components to be compatible with Linux and blow the socks of the Windows based alternatives.
The one thing I didnt quite anticipate was the Hauppauge HVR 1950. I knew quite well the misery of PCI based TV tuners that worked ONLY in Windows. The HVR 1950 is an external USB 2.0 device - because of which I thought it would be a breeze to use in Linux - after all, USB is a reasonably stable standard, and Linux does have V4L et all to manage so many AV (audio/video) devices.
I underestimated the hackery that companies are capable of.
It seems that Mike Isely found, while providing support for Hauppauge devices in Linux, that firmware needs to be present on the host OS to use the device.
Now dont get me wrong - I'm sure Hauppauge intentions were admirable: Seen from their point of view, this method presents a clean way for the host to send across the correct firmware for the device without needing to implement the USB firmware upgrade class.
And what better way to ensure the best possible firmware than to upgrade it at every power cycle?
Dear Haupauge software geniuses: FAIL!!!
Most people associate USB devices with plug and play - just plug it in, it will work just fine.
What happens when one of your customers plugs your USB device into an operating system that follows the USB standards to the book but doesnt know about your backdoor entry firmware uploader?
Why? Why would you do that?
Were you attempting to have an interesting version of DRM??
Anyway: For those of you who have already purchased a Hauppauge HVR 1950 device: Do not despair.
Hauppauge doesnt seem to be as malevolent as some other companies. They have permitted ivtv to actually distribute their firmware binaries.
However, ivtv doesn't have all the firmware binaries yet (as of Dec 2008), specifically not the ones needed for HVR 1950.
So if you did purchase the HVR 1950, you have only one option: You will need to use your install CD and pull out the firmware from there.
But first, lets do some reading and find out how this all works: Go to Mike Isely's fantastic explanation of pvrusb2 to see why it matters to us right now.
So first we need to extract the firmware. It works and works VERY well.
You should now have the three files
v4l-cx2341x-enc.fw
v4l-cx25840.fw
v4l-pvrusb2-73xxx-01.fw
In ubuntu, you will need to copy these three files into /lib/firmware/
Now take a look at the usage page. Note the "initusbreset" setting. Note what he says about it.
Now read this. It describes the problem: deadlock due to re-acquisition of instance mutex as a result of doing a USB reset to the device, the workaround: Keeping a file with "options pvrusb2 initusbreset=0" under /etc/modprobe.d/
Remember that creating that file will need su privileges. Now read this to see why a simple sudo will not work. More explanation here.
The trick is to do a straight su or an "sudo -s".
This workaround should fix the bug I faced - described here and here.
Please note that my current "uname -r" is "2.6.27-9-generic".
The reason I give my uname is because in one of the postings on Mike's listserver, this workaround is unnecessary starting from 2.6.27-10.
Also, in a later conversation with Mike over IRC, he explained to me that the "fixed" pvrusb2 driver in 2.6.27-10 does not have initusbreset as one of its known parameters. Therefore, modprobe will calmly refuse to load pvrusb2 if you keep that parameter in modprobe.d
Thats something I will need to keep in mind when I get the next generic kernel from Canonical.
Edit 1:
You need another firmware: go here and follow the extract.sh
Edit 2:
Just for a fraction of a second, I saw the 1950's red LED glow... Then it disappeared.
dmesg confirms that the various firmware files are used, but then I get: "cx25840' 6-0044: 0x0000 is not a valid video input!"
Attempted to contact Mike Isely on freenode#pvrusb2. No response yet.
Dammit I'm hungry - time to feed.
Edit 3:
It works! It works!!!
Thanks Mike!
Edit 4: Short explanation about the "magic" between edit 2 and 3:
The output of "cat /sys/class/pvrusb2/*/ctl_input/enum_val" should show the list of values that can be sent to cur_val in that directory.
Depending on whatever input you have attached to the HVR 1950, you need to echo that value to cur_val.
Since in my case, I have a composite cable connected to the 1950, all I needed to do was "echo composite > cur_val".
This made pvrusb2 switch modes into picking up the composite input.
Now at this point, /dev/video[0-9] should have an mpeg stream from the 1950.
However, to actually see if it works on the media player of your choice, you need to tell the media player to treat /dev/video[0-9] as a standard file, and not use the v4l / dvb interface on it.
In my case, the node is called /dev/video1 and my favorite player is vlc. Therefore to test it, all I did was:
"vlc /dev/video1 &"
... wait for a few seconds, and I am able to see the composite input in VLC!
Up next: actually configuring the 1950 to be a real tuner and make it work in MythTV.
Tuesday, December 16, 2008
Mythbuntu in gnome.
I had researched media center solutions for almost a week. After settling on mythbuntu and reading all available documentation, I decided to roll it out in the normal way: Install it in a virtual machine, take note of all the problems and the test environment and then move to production.
Mythbuntu is a distribution specific version of MythTV.
MythTV has a familiar client server model. The backend is supposed to do the heavy lifting: Capture, transcode and stream out to any frontends. As I had guessed, the backend does not really need any UI. The frontend however quite obviously will need a really slick UI - and it rocks!
The way the frontend is actually installed however, is more than what I wanted or needed.
Mythbuntu installs xfce and makes it the default window manager. It also changes the boot splash to say "mythbuntu".
I like my ubuntu the way it is: with gnome and with a splash screen that says "Ubuntu". Bet you thought that I was going to put a sappy coffee joke, didn't you?
So this is what worked best for me in the virtual machine:
1. Install Ubuntu AMD64 8.10
2. Go to the Mythbuntu website and click on "Add to ubuntu"
3. The PHP script will start the package manager. Let it install the bare minimum mythbuntu files. Once the install ends, you'll end up back at the desktop.
4. System -> Administration -> Mythbuntu Control Centre
5. Select System Roles. Ensure that the Frontend role is selected. Enable the role of Primary Backend and press Apply. MCC will invoke the package manager to install the necessary files.
6. In Artwork and Login Behavior, you need to unselect ""Mythbuntu Artwork & Settings". However, it is initially grayed out. To disable it, you need to select "Automatically start MythTV standalone session upon boot" then unselect the artwork and then unselect the auto-login. Click apply. This will prevent the splash screen from changing.
7. Then go into System -> Login Window and set the default Login back to gnome. You may have to read about "usplash" on Google to fix it permanently.
Mythbuntu is a distribution specific version of MythTV.
MythTV has a familiar client server model. The backend is supposed to do the heavy lifting: Capture, transcode and stream out to any frontends. As I had guessed, the backend does not really need any UI. The frontend however quite obviously will need a really slick UI - and it rocks!
The way the frontend is actually installed however, is more than what I wanted or needed.
Mythbuntu installs xfce and makes it the default window manager. It also changes the boot splash to say "mythbuntu".
I like my ubuntu the way it is: with gnome and with a splash screen that says "Ubuntu". Bet you thought that I was going to put a sappy coffee joke, didn't you?
So this is what worked best for me in the virtual machine:
1. Install Ubuntu AMD64 8.10
2. Go to the Mythbuntu website and click on "Add to ubuntu"
3. The PHP script will start the package manager. Let it install the bare minimum mythbuntu files. Once the install ends, you'll end up back at the desktop.
4. System -> Administration -> Mythbuntu Control Centre
5. Select System Roles. Ensure that the Frontend role is selected. Enable the role of Primary Backend and press Apply. MCC will invoke the package manager to install the necessary files.
6. In Artwork and Login Behavior, you need to unselect ""Mythbuntu Artwork & Settings". However, it is initially grayed out. To disable it, you need to select "Automatically start MythTV standalone session upon boot" then unselect the artwork and then unselect the auto-login. Click apply. This will prevent the splash screen from changing.
7. Then go into System -> Login Window and set the default Login back to gnome. You may have to read about "usplash" on Google to fix it permanently.
Sunday, October 5, 2008
Good to know
Adjust your mirrors.
Que jumpers are assholes. But there is a trick that works.
Distributed Power Management (DPM).
Que jumpers are assholes. But there is a trick that works.
Distributed Power Management (DPM).
Wednesday, August 27, 2008
Laptop lock
I have one of those laptop locks that fit into the docking station and prevent the laptop from being undocked.
It has 4 revolving digits and one combination that works. Yeah right as if I'm going to tell you that its "hunter2".
What I wanted to know was how much time will it take to try each and every combination.
There are a total of 10000 combinations. To go from 0000 to 0040 took me 3 minutes - including initial reset to 0000.
That means 750 minutes for the whole range = 12 hours in the worst case using nothing but brute force.
This basically means that your laptop can be stolen over the weekend, even if it is locked.
It also means that any thief who has repeated access to your lock is going to break it within a maximum two nights.
So much for security.
It has 4 revolving digits and one combination that works. Yeah right as if I'm going to tell you that its "hunter2".
What I wanted to know was how much time will it take to try each and every combination.
There are a total of 10000 combinations. To go from 0000 to 0040 took me 3 minutes - including initial reset to 0000.
That means 750 minutes for the whole range = 12 hours in the worst case using nothing but brute force.
This basically means that your laptop can be stolen over the weekend, even if it is locked.
It also means that any thief who has repeated access to your lock is going to break it within a maximum two nights.
So much for security.
Street signal cheeky hack
I am always in search of an optimized route home. Just as I get out of the office parking lot, whether I turn right or left is dependent on the signal to my right. In the case where I turn left, I go through the another parking lot - this eliminates 2 signals, but introduces a third just as I exit the other parking lot.
During rush hour, this third one is a large risk: It always schedules the cross traffic a lot more time than me.
There are two ways to trick the signal scheduler:
1. Go up to the line, reverse back a few inches. Works sometimes...
2. Put the car into park, hop out, press the walk button for pedestrians crossing the cross traffic road. This one works for sure! However, if you time your exit from your car badly, the guys behind you will be pissed when the signal goes green and you're outside the car.
Obvious disclaimer: Do this at your own risk - I am not responsible for anything you do.
During rush hour, this third one is a large risk: It always schedules the cross traffic a lot more time than me.
There are two ways to trick the signal scheduler:
1. Go up to the line, reverse back a few inches. Works sometimes...
2. Put the car into park, hop out, press the walk button for pedestrians crossing the cross traffic road. This one works for sure! However, if you time your exit from your car badly, the guys behind you will be pissed when the signal goes green and you're outside the car.
Obvious disclaimer: Do this at your own risk - I am not responsible for anything you do.
Friday, June 6, 2008
Some collected history about the x86 interrupts
Nilesh: I figured out some things ....
Nilesh: pan barech shya goshti maahiti nahin aahet
Uv: for example ?
Nilesh: for ex: IRQ kaase assign hotat
Uv: IRQ is dependant on legacy architecture decisions
Uv: the x86 family always had a single interrupt line
Nilesh: that is the old 8259 Interrupt controller na ?
Uv: as a result multiple devices that wanted to interrupt the processor had to follow an elaborate procedure to inform the main processor that 1. I want to interrupt you 2. "I" am <specific> device
Nilesh: and you could optionally cascade another one on it ?
Uv: correct
Uv: the 8259 takes of those devices that would not be able to talk in the language of x86
Uv: *takes care
Uv: x86 <-> 8259 <-> upto 8 devices
Uv: the alternate (and actually the most common hardware configuration) is:
Nilesh: right did that mean that with 8259 controller the maximum devices that could connect were 8 and 15 if cascaded ?
Uv:correct
x86 <--> 8259 <--> 7 devices
+<---> cascaded 8259 <--> 8 more devices
Uv: giving a total of 15 connectable devices
Uv: but now think about this:
Nilesh: ok ?
Nilesh: how would a driver know that its device is on this specific IRQ line ?
Uv: how can cascading be possible without those 8259's talking to each other and establishing a strict discipline about what to tell the x86 proocessor ?
Nilesh: correct yes they should have a understanding between them
Uv: first lets look at what x86 wants
Nilesh: ok
Uv: whenever x86 gets a signal on its one and only interrupt line, it waits for "someone" to put an additional data byte explaining the IRQ that fired
Nilesh: I see
Uv: the original idea (historical) was that the devices would be able to define this on their own
Nilesh: right
Nilesh: so would specific devices have to be connected to specific lines ?
Uv: but device manufactures told Intel to go sod off because it would unecessarily add cost and complexity to their simple devices
Uv: thus the 8259 was born
Uv: something that would just have interrupt inputs on its right edge for "simple" devices
Uv: and on its left edge, it would have a single interrupt line output and enough circuitry to feed the x86 the IRQ that caused the interrupt
Nilesh: hummm I making some sense out of this
Uv: before i386, this IRQ value was directly used to offset into the interrupt dispatch table
Uv: IRQL value right shifted by 2 (3?) to get offset value
Uv: sorry left shifted
Uv: i dont remember the exact shifting count - and right now too distracted to calculate it myself
Nilesh: :)
Nilesh: OSR vaale he kaahich shikvat naahin
Uv: this information could be a part of a more expensive "advanced course"
Uv: I dont know
Uv: nevermind
Nilesh: no they are pretty tight fisted about sharing finer details
Uv: in i386 and later, depending on the current mode of the processor, either the real mode IVT (offest from real address 0x0) or the protected mode interrupt descriptor table (IDT that can be located anywhere in memory) is used
Uv: but if you remember (if you have done) DOS assembly programming, you will remember that you had to actually write the address of your interrupt handler in the table
Nilesh: yes I remember that I wrote a few TSRs
Uv: there always was a previous value that you had to save... remember?
Uv: someone used to pre-fill those values... who was that ?
Nilesh: yes
Nilesh: let me guess
Nilesh: are you asking about SYS / COM file ?
Uv: that "someone" was a combination of the BIOS and DOS
Nilesh: I was about to say that.....
Uv: as part of boot up , the BIOS initialized some vectors, while DOS initialized others
Uv: 13h, 16h, 17h, were the "BIOS interrupts" and 21h was DOS umbrella interrupt
Nilesh: yes I guess 21 had file related interrupts etc
Uv: correct!
Nilesh: infact I had written a TSR that would prompt the user name a password if he would do a CD
Nilesh: cd to some directory
Uv: you said "file related interrupts" - which should indicate that the file system code was in int 21h.
Nilesh: right
Nilesh: I dont recollect the subcodes though
Uv: thats fine
Nilesh: I referred Ray Duncan for that
Uv: nevertheless, try remembering the lowest BIOS interrupt
Uv: the lowest BIOS interrupt was 10h
Nilesh: the timer ?
Nilesh: hummmm
Nilesh: I guess timer was 8 or 7
Uv: I mean software interrupt that provided "non-hardware" functionality
Nilesh: ok
Nilesh: I see
Uv: 10h = 16 decimal
Uv: thats the first number after 15
Nilesh: right
Uv: see the significance ?
Nilesh: hummm no
Uv: the first BIOS interrupt HAD to be at 10h because it could not reliably assign any of the lower vectors to software interrupts
Uv: because the 8259 could have 15 interrupts
Nilesh: ah right
Nilesh: how are your concepts so clear ?
Uv: party because I learnt assembly from my father :)
Nilesh: :)
Uv: the rest because I did electrical engineering
Uv: so anyways
Uv: how was it always certain that the timer interrupt was at IVT 8 and keyboard was always at 9?
Uv: etc?
Uv: and div by zero was 0 ?
Nilesh: because I guess DOS did that ?
Uv: I broke my head looking for an answer to this for a loooong time
Nilesh: or the Intel BIOS did that ?
Uv: nope the answer is not so technical as DOS or Intel decided it
Nilesh: ok
Uv: because if you look at the pure description of any x86 processor and the 8259, there is no place that says 8 MUST be timer
Nilesh: right
Uv: but think about it a bit: the first BIOS was created by IBM
Nilesh: ok
Uv: those guys had to write handlers for every device
Nilesh: right
Uv: and the hardware kept changing
Nilesh: hummm right
Uv: the sinplest way for them to reduce the constant changes
Nilesh: right
Uv: would be to make permanent the IRQ assigned to "standard devices" on a "standard motherboard"
Nilesh: right
Uv: and thus was born the IBM AT compatible motherboard standard
Nilesh: :)
Uv: some hardware designer just arbitrarily decided that IRQ 8 was the timer.
Uv: as simple as that :D
Nilesh: :))
Uv: and it became a standard that EVERYONE in the world followed
Nilesh: cool
Uv: now some IRQ were permanently set in stone
Nilesh: Keyboard ?
Uv: like the timer, the keyboard and mouse, etc
Nilesh: I see
Nilesh: the timer interrupt changed right ?
Uv: some others like the HDD and floppy became permanent later on
Nilesh: its no more 8 right ?
Uv: some others like sound cards still behave in non-standard ways
Nilesh: I see
Uv: timer is still 8 btw :D
Nilesh: I see
Uv: but! in protected mode, the IRQ and the IRQL are not related in the way they were in real mode
Nilesh: right
Nilesh: IRQL is CPU agnostic
Nilesh: ?
Uv: IRQ 8 is timer, but the IRQL at which the timer interrupt will run is IRQL 1
Nilesh: I see
Nilesh: right
Uv: the hardware interrupt and the software handler are two different things
Uv: even though their notifications (IRQ and IRQL) seem similar
Uv: btw, do you mind if I edit this conversation a bit and put it in my tech blog ?
Nilesh: absolutely
Uv: thanks
Nilesh: what is your blog URL ?
Uv: it will be a better idea to store it so others can also read
Uv: heh theres not much right now
Nilesh: Yuvraj thanks alot for spending your time explaining some basic stuff
Uv: no problems dude - its been a pleasure!
Nilesh: thanks
Uv: there is a little bit more to tell about interrupts though: if you want to hack at writing device drivers for standard devices on your own, then look at the AT and XT standards from IBM for reference.
Uv: that will give the IRQs that you are to hook to
Uv: and then read about Interrupts from MSDN / your favourite Windows Internals book
Uv: then the connection between many concepts should be obvious
Nilesh: wow that is a fabulous project to work on
Nilesh: sure I will take it up
Uv: enjoy! me goes back to work :)
Nilesh: sure thanks
Nilesh: pan barech shya goshti maahiti nahin aahet
Uv: for example ?
Nilesh: for ex: IRQ kaase assign hotat
Uv: IRQ is dependant on legacy architecture decisions
Uv: the x86 family always had a single interrupt line
Nilesh: that is the old 8259 Interrupt controller na ?
Uv: as a result multiple devices that wanted to interrupt the processor had to follow an elaborate procedure to inform the main processor that 1. I want to interrupt you 2. "I" am <specific> device
Nilesh: and you could optionally cascade another one on it ?
Uv: correct
Uv: the 8259 takes of those devices that would not be able to talk in the language of x86
Uv: *takes care
Uv: x86 <-> 8259 <-> upto 8 devices
Uv: the alternate (and actually the most common hardware configuration) is:
Nilesh: right did that mean that with 8259 controller the maximum devices that could connect were 8 and 15 if cascaded ?
Uv:correct
x86 <--> 8259 <--> 7 devices
+<---> cascaded 8259 <--> 8 more devices
Uv: giving a total of 15 connectable devices
Uv: but now think about this:
Nilesh: ok ?
Nilesh: how would a driver know that its device is on this specific IRQ line ?
Uv: how can cascading be possible without those 8259's talking to each other and establishing a strict discipline about what to tell the x86 proocessor ?
Nilesh: correct yes they should have a understanding between them
Uv: first lets look at what x86 wants
Nilesh: ok
Uv: whenever x86 gets a signal on its one and only interrupt line, it waits for "someone" to put an additional data byte explaining the IRQ that fired
Nilesh: I see
Uv: the original idea (historical) was that the devices would be able to define this on their own
Nilesh: right
Nilesh: so would specific devices have to be connected to specific lines ?
Uv: but device manufactures told Intel to go sod off because it would unecessarily add cost and complexity to their simple devices
Uv: thus the 8259 was born
Uv: something that would just have interrupt inputs on its right edge for "simple" devices
Uv: and on its left edge, it would have a single interrupt line output and enough circuitry to feed the x86 the IRQ that caused the interrupt
Nilesh: hummm I making some sense out of this
Uv: before i386, this IRQ value was directly used to offset into the interrupt dispatch table
Uv: IRQL value right shifted by 2 (3?) to get offset value
Uv: sorry left shifted
Uv: i dont remember the exact shifting count - and right now too distracted to calculate it myself
Nilesh: :)
Nilesh: OSR vaale he kaahich shikvat naahin
Uv: this information could be a part of a more expensive "advanced course"
Uv: I dont know
Uv: nevermind
Nilesh: no they are pretty tight fisted about sharing finer details
Uv: in i386 and later, depending on the current mode of the processor, either the real mode IVT (offest from real address 0x0) or the protected mode interrupt descriptor table (IDT that can be located anywhere in memory) is used
Uv: but if you remember (if you have done) DOS assembly programming, you will remember that you had to actually write the address of your interrupt handler in the table
Nilesh: yes I remember that I wrote a few TSRs
Uv: there always was a previous value that you had to save... remember?
Uv: someone used to pre-fill those values... who was that ?
Nilesh: yes
Nilesh: let me guess
Nilesh: are you asking about SYS / COM file ?
Uv: that "someone" was a combination of the BIOS and DOS
Nilesh: I was about to say that.....
Uv: as part of boot up , the BIOS initialized some vectors, while DOS initialized others
Uv: 13h, 16h, 17h, were the "BIOS interrupts" and 21h was DOS umbrella interrupt
Nilesh: yes I guess 21 had file related interrupts etc
Uv: correct!
Nilesh: infact I had written a TSR that would prompt the user name a password if he would do a CD
Nilesh: cd to some directory
Uv: you said "file related interrupts" - which should indicate that the file system code was in int 21h.
Nilesh: right
Nilesh: I dont recollect the subcodes though
Uv: thats fine
Nilesh: I referred Ray Duncan for that
Uv: nevertheless, try remembering the lowest BIOS interrupt
Uv: the lowest BIOS interrupt was 10h
Nilesh: the timer ?
Nilesh: hummmm
Nilesh: I guess timer was 8 or 7
Uv: I mean software interrupt that provided "non-hardware" functionality
Nilesh: ok
Nilesh: I see
Uv: 10h = 16 decimal
Uv: thats the first number after 15
Nilesh: right
Uv: see the significance ?
Nilesh: hummm no
Uv: the first BIOS interrupt HAD to be at 10h because it could not reliably assign any of the lower vectors to software interrupts
Uv: because the 8259 could have 15 interrupts
Nilesh: ah right
Nilesh: how are your concepts so clear ?
Uv: party because I learnt assembly from my father :)
Nilesh: :)
Uv: the rest because I did electrical engineering
Uv: so anyways
Uv: how was it always certain that the timer interrupt was at IVT 8 and keyboard was always at 9?
Uv: etc?
Uv: and div by zero was 0 ?
Nilesh: because I guess DOS did that ?
Uv: I broke my head looking for an answer to this for a loooong time
Nilesh: or the Intel BIOS did that ?
Uv: nope the answer is not so technical as DOS or Intel decided it
Nilesh: ok
Uv: because if you look at the pure description of any x86 processor and the 8259, there is no place that says 8 MUST be timer
Nilesh: right
Uv: but think about it a bit: the first BIOS was created by IBM
Nilesh: ok
Uv: those guys had to write handlers for every device
Nilesh: right
Uv: and the hardware kept changing
Nilesh: hummm right
Uv: the sinplest way for them to reduce the constant changes
Nilesh: right
Uv: would be to make permanent the IRQ assigned to "standard devices" on a "standard motherboard"
Nilesh: right
Uv: and thus was born the IBM AT compatible motherboard standard
Nilesh: :)
Uv: some hardware designer just arbitrarily decided that IRQ 8 was the timer.
Uv: as simple as that :D
Nilesh: :))
Uv: and it became a standard that EVERYONE in the world followed
Nilesh: cool
Uv: now some IRQ were permanently set in stone
Nilesh: Keyboard ?
Uv: like the timer, the keyboard and mouse, etc
Nilesh: I see
Nilesh: the timer interrupt changed right ?
Uv: some others like the HDD and floppy became permanent later on
Nilesh: its no more 8 right ?
Uv: some others like sound cards still behave in non-standard ways
Nilesh: I see
Uv: timer is still 8 btw :D
Nilesh: I see
Uv: but! in protected mode, the IRQ and the IRQL are not related in the way they were in real mode
Nilesh: right
Nilesh: IRQL is CPU agnostic
Nilesh: ?
Uv: IRQ 8 is timer, but the IRQL at which the timer interrupt will run is IRQL 1
Nilesh: I see
Nilesh: right
Uv: the hardware interrupt and the software handler are two different things
Uv: even though their notifications (IRQ and IRQL) seem similar
Uv: btw, do you mind if I edit this conversation a bit and put it in my tech blog ?
Nilesh: absolutely
Uv: thanks
Nilesh: what is your blog URL ?
Uv: it will be a better idea to store it so others can also read
Uv: heh theres not much right now
Nilesh: Yuvraj thanks alot for spending your time explaining some basic stuff
Uv: no problems dude - its been a pleasure!
Nilesh: thanks
Uv: there is a little bit more to tell about interrupts though: if you want to hack at writing device drivers for standard devices on your own, then look at the AT and XT standards from IBM for reference.
Uv: that will give the IRQs that you are to hook to
Uv: and then read about Interrupts from MSDN / your favourite Windows Internals book
Uv: then the connection between many concepts should be obvious
Nilesh: wow that is a fabulous project to work on
Nilesh: sure I will take it up
Uv: enjoy! me goes back to work :)
Nilesh: sure thanks
Collected hacks for future reference
Using Skype on AMD64 Ubuntu.
Lord of the Ring0. This works with VirtualBox as well. The pipe name "\\.\pipe\com_1" should be used for VirtualBox - it doesn't come into the text box by default.
Configure OpenVPN on Windows.
Enable NVIDIA video drivers.
Sign Powershell scripts.
Installing UT2004 in Linux.
Unshield 64 bit.
Adding notepad to the the system context menu.
Lord of the Ring0. This works with VirtualBox as well. The pipe name "\\.\pipe\com_1" should be used for VirtualBox - it doesn't come into the text box by default.
Configure OpenVPN on Windows.
Enable NVIDIA video drivers.
Sign Powershell scripts.
Installing UT2004 in Linux.
Unshield 64 bit.
Adding notepad to the the system context menu.
Friday, May 2, 2008
Solar is disappointingly expensive
After a little research I have come to the same conclusion that thousands before me already had: Solar is expensive!
First the good stuff:
I bought a 6.5W foldable solar panel from Frys a few days ago. It has extremely little to set up - all you need to do is find some sun and plug in your device.
Thanks to the innumerable "road warriors" out there, almost all electronic devices that need charging come with a car charger. As a result, the most important connector provided with this foldable panel was the the car charger (female).
I connected my battery charger to the solar panel - this is a reasonably good way to charge up my AA and AAA cells, without being on the grid and without draining the car battery. I could also charge my Nokia toys in this way as well.
After that I started checking out what else can be put onto this foldable panel. The rated output is 6.5W. With a 12V rated voltage on the car connector, it means that the rated current is a measly 0.54A.
The typical Dell laptop needs 19V,4.6A at its input DC.
For me to use this panel for the laptop, I would have to make a series-parallel combination to achieve that sort of a rating. I'd need 10 branches in parallel with 2 panels in each branch to make it 24V, 5.4A - With this sort of rating, I may be able to use one laptop off it.
However, the cost comes in the way: Per 6.5W panel comes at $100 in Frys. Pricegrabber shouws lowest price at $74, but even with that, the total price for running one laptop off solar panels is $2000. Way too high.
What about higher rated solar panels? The manufacturers usually can cut costs for larger panels, why not go for that?
A 100W solar panel from ICP seems like a good choice - except for the fact that it costs $800 +.
I can definitely come up with that sort of money, but how much sunlight will I have to eat to break even on the investment?
I'll get the numbers as soon as I can and see if its a worthy investment.
First the good stuff:
I bought a 6.5W foldable solar panel from Frys a few days ago. It has extremely little to set up - all you need to do is find some sun and plug in your device.
Thanks to the innumerable "road warriors" out there, almost all electronic devices that need charging come with a car charger. As a result, the most important connector provided with this foldable panel was the the car charger (female).
I connected my battery charger to the solar panel - this is a reasonably good way to charge up my AA and AAA cells, without being on the grid and without draining the car battery. I could also charge my Nokia toys in this way as well.
After that I started checking out what else can be put onto this foldable panel. The rated output is 6.5W. With a 12V rated voltage on the car connector, it means that the rated current is a measly 0.54A.
The typical Dell laptop needs 19V,4.6A at its input DC.
For me to use this panel for the laptop, I would have to make a series-parallel combination to achieve that sort of a rating. I'd need 10 branches in parallel with 2 panels in each branch to make it 24V, 5.4A - With this sort of rating, I may be able to use one laptop off it.
However, the cost comes in the way: Per 6.5W panel comes at $100 in Frys. Pricegrabber shouws lowest price at $74, but even with that, the total price for running one laptop off solar panels is $2000. Way too high.
What about higher rated solar panels? The manufacturers usually can cut costs for larger panels, why not go for that?
A 100W solar panel from ICP seems like a good choice - except for the fact that it costs $800 +.
I can definitely come up with that sort of money, but how much sunlight will I have to eat to break even on the investment?
I'll get the numbers as soon as I can and see if its a worthy investment.
Thursday, April 10, 2008
Bluetooth tethering for the Nokia 6555
I had an AT&T connection with the typical Media bundle promo which drained about $10 out of my pocket and offered very little in terms of download / upload limits.
My phone (Nokia 6555) is good as a clamshell model, and is capable of bluetooth DUN, FTP, HFP, OPP, SAP and SPP.
After a bit of digging around the Net and AT&T's customer support, I finally managed to get DUN working on my laptop. The dialing number to be used is "*99***1#". No username, no password.
While doing this, make sure that you configure your modem speed to be the maximum 921600. It repeatedly defaults to 115200, so you need to step it up every time you connect. There is probably a fix for this, but I haven't looked into it yet.
The speed seems to pick up after a minute of browsing - I don't know if this is something my overworked mind imagines or it is a valid symptom.
After testing this several times at different locations, I figured it was time to move to the AT&T Media Max bundle.
The main reason for doing all this was that I wanted my laptop to be connected in places where I do not have the luxury of free and reasonably secure WIFI.
The necessity for this came while sitting in a Days Inn in San Diego trying desperately to use its weak WIFI signal to book a hotel in Las Vegas.
The ultimate proof that it was worth the effort came at a client site where they did not have guest WIFI or ethernet and I had to send status reports back to my team.
Quickly tethered the 6555, fired up DUN, connected to the Internet, started the Cisco VPN, started Outlook and started work.
The speed was good enough for me to not realize that I was on BT, not WIFI or LAN.
Of course this may be because Outlook is always slow, but thats a rant for a later day.
The only problem I seem to be having so far with this method of connectivity is that the 6555 heats up unbearably when using it as a BT modem. Then it starts draining its battery at an exponential rate. The heating problem can be mostly ignored, but the battery problem is difficult.
The only workaround I have right now is to keep charging the 6555 so that the battery cannot drain. But this means I have to be close to a charging location. In the car, its possible to have a car charger that charges the phone, but what about other times? I hope to find something that will let me be really free of fixed location constraints.
My phone (Nokia 6555) is good as a clamshell model, and is capable of bluetooth DUN, FTP, HFP, OPP, SAP and SPP.
After a bit of digging around the Net and AT&T's customer support, I finally managed to get DUN working on my laptop. The dialing number to be used is "*99***1#". No username, no password.
While doing this, make sure that you configure your modem speed to be the maximum 921600. It repeatedly defaults to 115200, so you need to step it up every time you connect. There is probably a fix for this, but I haven't looked into it yet.
The speed seems to pick up after a minute of browsing - I don't know if this is something my overworked mind imagines or it is a valid symptom.
After testing this several times at different locations, I figured it was time to move to the AT&T Media Max bundle.
The main reason for doing all this was that I wanted my laptop to be connected in places where I do not have the luxury of free and reasonably secure WIFI.
The necessity for this came while sitting in a Days Inn in San Diego trying desperately to use its weak WIFI signal to book a hotel in Las Vegas.
The ultimate proof that it was worth the effort came at a client site where they did not have guest WIFI or ethernet and I had to send status reports back to my team.
Quickly tethered the 6555, fired up DUN, connected to the Internet, started the Cisco VPN, started Outlook and started work.
The speed was good enough for me to not realize that I was on BT, not WIFI or LAN.
Of course this may be because Outlook is always slow, but thats a rant for a later day.
The only problem I seem to be having so far with this method of connectivity is that the 6555 heats up unbearably when using it as a BT modem. Then it starts draining its battery at an exponential rate. The heating problem can be mostly ignored, but the battery problem is difficult.
The only workaround I have right now is to keep charging the 6555 so that the battery cannot drain. But this means I have to be close to a charging location. In the car, its possible to have a car charger that charges the phone, but what about other times? I hope to find something that will let me be really free of fixed location constraints.
Finally, my new toy!
Every time I mentioned that I got a new AT&T connection, I was always asked, "So did ya get the iPhone?"
Now being the geek that I am, I was constantly embarrassed into saying no. However, it was for good reason - I didn't think getting a toy when I was barely setting up my new base would be a good financial decision.
About a month ago I finally convinced myself that I could afford to look for something. After a lot of research on various small form factor "laptop-like" devices, including the iPhone, Treo, various Blackberries and the Asus Eee-PC, I came upon the Nokia internet tablets.
What I found really interesting in the n810 (and its preceding 2 generations) was that it runs the Debian based maemo operating system.
After checking the specifications and the blogs, I eventually came up with a list of features that I wanted, and got in the n810:
- WIFI and bluetooth connectivity. WEP, WPA and WPA2 capable.
- email client capable of IMAP: claws
- browser capable of Javascript, AJAX, and flash
- chatting and voice clients: Pidgin, skype
- openVPN
- media players capable of decoding MP3, DIVX and other processor intensive formats: There are multiple apps which do this: Canola, mplayer, etc.
- VNC, rdesktop
- Utilities: PDF reader, FTP client, SSH client and server, calculator, etc.
- Upto 8GB micro SHDC external MMC card capable.
The unit also has a camera, a GPS receiver and a slide out QWERTY keyboard.
Pretty soon I hope to have at least one blog typed out completely from my n810.
Now being the geek that I am, I was constantly embarrassed into saying no. However, it was for good reason - I didn't think getting a toy when I was barely setting up my new base would be a good financial decision.
About a month ago I finally convinced myself that I could afford to look for something. After a lot of research on various small form factor "laptop-like" devices, including the iPhone, Treo, various Blackberries and the Asus Eee-PC, I came upon the Nokia internet tablets.
What I found really interesting in the n810 (and its preceding 2 generations) was that it runs the Debian based maemo operating system.
After checking the specifications and the blogs, I eventually came up with a list of features that I wanted, and got in the n810:
- WIFI and bluetooth connectivity. WEP, WPA and WPA2 capable.
- email client capable of IMAP: claws
- browser capable of Javascript, AJAX, and flash
- chatting and voice clients: Pidgin, skype
- openVPN
- media players capable of decoding MP3, DIVX and other processor intensive formats: There are multiple apps which do this: Canola, mplayer, etc.
- VNC, rdesktop
- Utilities: PDF reader, FTP client, SSH client and server, calculator, etc.
- Upto 8GB micro SHDC external MMC card capable.
The unit also has a camera, a GPS receiver and a slide out QWERTY keyboard.
Pretty soon I hope to have at least one blog typed out completely from my n810.
MS VS .NET browser trick
I have seen emacs doing just too many things to the point of it being really silly.
I wanted to see if MSVS would also be able to do something special - no matter how silly.
Lets first browse in it: Therefore the first thing I tried was to "Open File" and point it to Google.
(Yes, I know - Ironic: Attempting to access Google from a MSVS IDE.)
Unfortunately this resulted in totally a different outcome. VS opened the HTML page as a text file. This is quite interesting, but not what I want. Lets try again.
Go back to the Open file dialog, type in the address and instead of just clicking Open, lets try clicking the small arrow besides the Open button.
No choices available to load it as a valid HTML page. Hmm, time to look at other options.
How about getting some help from the VS documentation? Lets get some F1!
Now this is interesting - "Online help as primary source"
After selecting this option and waiting for enough time, I see the help page with two drop down toolbars. One of those toolbars is the URL with the typical "ms-help://" address.
Type http://www.google.com/ in there and voila! We have Google in MSVS.
After a little bit of Wireshark digging to find out which browser has been used by MSVS : The User agent string is MSIE7.0
My default browser is Seamonkey, but I'm sure the devs at MS wouldn't be allowed to fire that up in Visual Studio...
This means that VS is firing up Internet Explorer only.
Is it using ActiveX to do this? I dont know yet how to find out.
Conclusion:
Microsoft's Visual Studio IDE's - .NET and above - use IE as the browser, over-riding your default browser settings.
Using IE, you can do all the things a browser does - webmail, Internet radio and so on.
Not exactly emacs, but conceptually similar.
EDIT:
A good friend (Nilesh) pointed out that:
"figuring out whether it uses the IE browser is easy... there is this tool called SPY++ that ships with Visual Studio"
Use VS tools to find out more about VS! Excellent recursive hack!
I wanted to see if MSVS would also be able to do something special - no matter how silly.
Lets first browse in it: Therefore the first thing I tried was to "Open File" and point it to Google.
(Yes, I know - Ironic: Attempting to access Google from a MSVS IDE.)
Unfortunately this resulted in totally a different outcome. VS opened the HTML page as a text file. This is quite interesting, but not what I want. Lets try again.
Go back to the Open file dialog, type in the address and instead of just clicking Open, lets try clicking the small arrow besides the Open button.
No choices available to load it as a valid HTML page. Hmm, time to look at other options.
How about getting some help from the VS documentation? Lets get some F1!
Now this is interesting - "Online help as primary source"
After selecting this option and waiting for enough time, I see the help page with two drop down toolbars. One of those toolbars is the URL with the typical "ms-help://" address.
Type http://www.google.com/ in there and voila! We have Google in MSVS.
After a little bit of Wireshark digging to find out which browser has been used by MSVS : The User agent string is MSIE7.0
My default browser is Seamonkey, but I'm sure the devs at MS wouldn't be allowed to fire that up in Visual Studio...
This means that VS is firing up Internet Explorer only.
Is it using ActiveX to do this? I dont know yet how to find out.
Conclusion:
Microsoft's Visual Studio IDE's - .NET and above - use IE as the browser, over-riding your default browser settings.
Using IE, you can do all the things a browser does - webmail, Internet radio and so on.
Not exactly emacs, but conceptually similar.
EDIT:
A good friend (Nilesh) pointed out that:
"figuring out whether it uses the IE browser is easy... there is this tool called SPY++ that ships with Visual Studio"
Use VS tools to find out more about VS! Excellent recursive hack!
Subscribe to:
Comments (Atom)