Skip to content

Secure Communication in Smart Grids

Due to the last weeks and months I worked on a university project about secure communications within smart grids. As one of its results we published a paper summarizing our efforts of creating a secure communication infrastructure for it which is based on trusted computing. The paper is submitted at the german DACH Security 2013 conference.

The whole paper is in german an can be found here.

Categories: Publications, Smart Grid.

Building Debian packages

As we released a new version of the Freesmarpthone.org middleware some time ago I am very interested in getting this into the Debian distribution and finally Ubuntu. As the various components are already available in Debian the initial packaging work is almost done and just needs to be updated to ship the recent version. As this is the first time for me with packaging something for Debian I want to share my steps to setup the packging repository here. As an example I picked the libfsosystem library which packaging source is available here. For a long time there were no releases of the FSO components and the debian guys started to base their packaging work on snapshots of the upstream git repository. This needs to be chanaged as further packaging work should be based on the release tarballs.

To setup the repository I did the following:

# mkdir libfsosystem
# pull-debian-soure -d libfsosystem sid
# cd libfsosystem
# git-import-dsc –sign-tags –pristine-tar ../libfsosystem_0.1.0~git20120214-1.dsc
# git-import-orig –sign-tags –pristine-tar ../libfsosystem-0.10.0.tar.bz2
# git-import-orig –sign-tags –pristine-tar ../libfsosystem-0.10.1.tar.bz2

Thats all to setup the repository for further packaging. With all the tools from Debian and Ubuntu this is done with some small steps. A great experience to see that packaging something in debian from already available packages is done after some minutes of work.

Building the real package is now only a matter of calling git-buildpackaging and pbuilder/sbuild.

After setting up the initial repository for libfsosystem I did some further work to remove existing patches which aren’t needed anymore and enabled building from the vala sources and not the precompiled c sources from the release tarball. You can find the repository here which is currently waiting for a review by the Debian FSO packaging team.

Categories: Debian, FSO.

Upgrade from Debian Lenny to Squeeze

Today I upgrade my server finally from Debian lenny to squeeze (which was released already last year, but I never had the time to do the upgrade since today). All in all the upgrade process went very fine. Following the release upgrade notes helped a lot and saved me some time (see [0]).

Finally I migrated to a dependency based boot system too. I already started with this last year but stopped it a second time cause of missing time for it. I purged today all packages I never purged which leave their stuff in the init system after removal and the upgrade process succeeded finally.

Congratulations to all Debian people out here. You do a great job everyday! Thank you very much, you saved me a lot time with focussing on quality and stability.

As next step I will migrate the whole lighttpd migration back to apache2 as I never felt very comfortable with lighttpd due to a lot of small things I will not list here but maybe another time. Let’s see how much time there will be in the next weeks for it :)

[0]: http://www.debian.org/releases/stable/amd64/release-notes/ch-upgrading.html

Categories: Debian, Linux.

Tags: , , , ,

World is small …

After a long time I got finally supported by HP (you know they bought Palm and webOS back in 2010) with a HP Veer device for development. Back in feburary 2011 HP started a Free Pre 2 Device program and I wrote to them to get qualified for a device. After more than 8 months I finally got a device (not the Pre 2 but who cares). The HP Veer is a very tiny device I like very much. It has 2.6-inc display (take your wallet out and look at your credit card, thats the size of the HP Veer), a powerfull MSM chipset inside and all features you know from todays smartphones.

I will use the HP Veer mainly to create a open source implementation of the RPC protocol used by all MSM chipsets to communicate with the baseband chip. Already before I received the device I started with a library called libmsmrpc which implements the basic functionality to to the RPC calls. Today it’s already possible to connect to the device and send commands to the modem with the OEM RAPI service and receive response. Just the details of the messages send to the device and received from the device needs to be implemented. About the details of this and the current state I will write something in the near future.

Categories: Uncategorized.

One to rule them all!

Talking about modem processors used in todays smartphones is a sad story. Most of them are using a binary protocol which is not known by the public. In some cases the linux userland is talking plain AT over a serial line with the modem but thats the exception. Let me list some devices:

  • Palm Pre/Pre Pus/Pre 2: All three have a MSM6280 modem chip and are using a binary protocol for modem access from the application processor.
  • Nokia N900: Uses a modem chip made by nokia with can be accessed with the ISI protocol. Some parts of it are documented but not everything. Furthermore the Linux support from nokia is dieing with there move to phones powered by Windows Mobile.
  • Google Nexus One/S: Both devices have a msm modem chip and are using plain AT commands over a shared memory interfcae
  • Geeksphone: Is build on Qualcomms MSM platform and is using a binary RPC protocol to communicate with the modem.
  • HP Veer: Is also build on Qualcomms MSM platform and is using the same RPC protocol than the Geeksphone but in another way. They are sending mostly the same packages as they did with the Palm Pre/Pre Plus/Pre 2.

So I hope you get the point that there is not one way to communicate with a modem in todays smartphones. This makes it a very complicated for a FOSS operating system to be able to run on such a device. Also another problem is when two devices are using the same way there are even differences especially all devices using a msm modem chip. Qualcomm is offering a toolset to smartphone creators, which makes it possible to customize most bits of the modem part of the device even the protocol to communicate with modem … For example between the different webOS versions of the Palm Pre devices Palm changed some bits in the protocol so we have to adjust our protocol implementation as well (which means some more days of reverse engineering).

Especially for the smartphones using a MSM modem chip I am going to fix the communication part for open source software. There should be a open and free distributable implementation available people can use to talk to the modem and do things they want to do. I cannot talk about concrete details yet, but will post here when I can :)

Stay tuned!

Categories: FSO, Linux, Smartphones.

FOSS capabilities of the HP Veer smartphone

Yesterday HP released their new smartphone the HP Veer in the US to the market. At the same they released their webOS doctor for the new phone which is the ulitity you use when your device gets broken some way. It contains the whole rootfs and kernel files for the device so I was able to do some first research about the FOSS capabilities of the new device. Here are some first notes about the device and the software it’s using:

  • Linux Kernel 2.6.29
  • Wireless chip is a bcm4319; kernel driver is found /lib/modules/2.6.29-palm-shank/kernel/net/wifi/dhd.ko; I didn’t found a linux driver for the bcm4319 out there after a short search
  • Modem protocol is mostly the same as we found in the Palm Pre devices
  • The only thing about the modem that has changed is the lowlevel of the protocol. The HCI protocol as found in Palm Pre devices isn’t used anymore. Instead they are know using a shared memory buffer for the communication between the baseband the application processor. On keyword here is oncrpc which I found even on other websites about android devices
  • Touchscreen is a cy8ctma300e from Cypress
  • most utilities like PmTilTest, PmModemInfo are still there

So far some already interesting points. Let’s see when I get one of these devices in my hands do some more detail research.

Categories: FSO, HP|Palm, Linux.

Tags: , , ,

Free Pre Plus Smartphone from Palm

Yeah! I finally got my free Pre Plus smartphone from Palm! In late september I wrote to Palm as they offered free Pre Plus devices for qualified developers:

Hello,

as I read in our newsletter you are offering free Pre Plus devices to
qualified developers. I am one of the people trying to bring an open and
free operating system to the great Palm Pre device. We are comming
originally from the Openmoko project and searching for a new device which
can be the base for our further development. We are doing all of this work
in our spare free time with the aim to have an linux based operating system
which feeds our needs of an free and open operating system which we can
modify in all areas.

I am one of this people working mostly on the Freesmartphone
(http://www.freesmartphone.org/) and SHR project
(http://www.shr-project.org/). I am a OpenEmbedded develper too and
currently integrating support for the Palm Pre device in OpenEmbedded.

It would be great if you can donate me a Pre Plus device to improve my
work and let me have one more device I can use to improve the FOSS support
for your great Pre device family.

Sincerely yours,

Simon Busch

Yesterday, three months later the device arrives from the US here in germany and is now ready to be used as new development device :)

Thank you Palm for supporting the FOSS community in such a way!

Categories: Palm Pre.

FSO Palm Pre Modem Status Report

Through my last three weeks on holiday I got implemented a lot of stuff in msmcomm. We have now the following features:

  • call support: dial, answer and end calls (only call forwarding and call conference stuff is missing)
  • various network information: networklist, rssi, current nework, network time, mode preference (GSM/UMTS/auto) …
  • various system stuff: set system time, modem audio tuning parameters, audio profiles,  charging, …
  • SIM: Read/write/delete phonebooks, verify pin, enable/disable pin, change pin,  sim info (imsi, misdn), phonebook properties

This is already a lot of stuff we can work with. For all messages we already have simple error handling like checking the received message for an error code and reporting the error upstream. Only on some response messages left for which we have to find out the right offset of the error return code. But thats just a matter of time :)

The next step will be SMS support. I already started with this and can receive an incomming SMS. Luckily the msmcomm protocol is using the same PDU format for reporting SMS t as it is defined in TS 23.040 – makes it easy for us to implement it beside our already existing SMS implementation in fsogsmd. But there is one thing I am curious about: It seems that Palm does not implemented some functionality to read/write sms from/to the SIM card. Maybe I miss something, but it would fit into Palm’s way of doing SMS handling in webOS. They are just receiving the SMS and do not save them on the SIM card. All SMS messages are directly copied to a internal userspace database. So if you put your SIM card into another phone you will miss all your SMS messages (btw. it’s the same approach for SIM contacts. They are never saved on the SIM card by webOS …).

Next step will be sending SMS. I already dumped the messages webOS is sending and receiving for this. I just have to look deeper into them and implement all important messages, responses and events in libmsmcomm.

If you want to try everything to can do the following:

WARNING: Before you do any of the steps below just backup all our data from the device! The Freesmartphone team provides this as is without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of this program is with you. Should this program prove defective, you assume the cost of all necessary servicing, repair or correction. In no event will the Freesmartphone team or any other party be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use this program (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of this program to operate with any other programs)

1. Compile the serial_forward utility (http://git.freesmartphone.org/?p=cornucopia.git;a=tree;f=tools/serial_forward) for the Palm Pre (use OpenEmbedded or you favourite toolchain) and copy it on the Palm Pre

2. Take care that you enabled usbnet on your Pre

3. Connect to your Pre with novaterm

4. Stop the TelephonyInterfaceLayer: # stop TelephonyInterfaceLayer

5. Reset the modem: # pmmodempower cycle

6. Run serial_forward with: # ./serial_forward -n /dev/modemuart -p 3001 -t hsuart

7. On your local PC configure the usbnet interface: # ifconfig usb0 192.168.0.1

8. Install msmcommd on your local PC

9. Edit /etc/msmcomm.conf to look like this:

source_type network
source_path 192.168.0.202:3001
log_target stderr

10. Start msmcommd: ./msmcommd

11. You will see msmcommd doing the initial low level setup

12. Compile msmvterm and launch it: # ./msmvterm

13. Type ‘help’ withing msmvterm to see all available commands

14. To do a simple setup of the modem, type the following commands:

# change_operation_mode reset
# test_alive
# verify_pin pin1
# change_operation_mode online

NOTE: Only after you have done ‘change_operation_mode reset’ and ‘test_alive’ the modem can received any other command!

Categories: FSO, msmcomm, Palm Pre.

FSO on the Palm Pre – Short Status Update

For a long time we’re now hacking on the Palm Pre device to get FSO working: Time for a short summary were we are and what has do be done in the near future (mickey already pointed out which components are working and which not).

Modem

The modem was the big show stopper when we initial began with hacking on the Palm Pre. The protocol Palm uses to communicate with the modem is nothing already known in the FOSS community. Yes, there is even an AT-Port you can use but there are missing some commands we need to make calls or register for so called unsolicited responses.  So the only way to bring FSO to the Palm Pre was reverse engineering the protocol.

Most of the basic reverse engineering is already done. We know how the protocol works and how we could use it. We wrote already an implementation of the protocol and it is used in FSO’s fsogsmd to interact with the modem (checkout msmcommd and libmsmcomm in the msmcomm repository). We can make calls and see when a call is comming in.

Currently we are using both ports (the AT and the binary one) to communicate with the modem. So we have all functionality you want have to on a basic phone (Call, SMS, …) but no GPRS/EDGE/HSDPA connection. Normally webOS uses the AT port to setup up a PPP connection and as we are using it to do some other stuff we cannot create a PPP connection anymore. When we are ready with the msmcomm protocol to support most of the GSM stuff we can disable the AT port in fsogsmd and use it for creating a PPP connection. So you see, this is no real show stopper anymore, just a matter of time :)

What have to be done on the modem level? I assume that we currently have about 10% disassembled from the msmcomm protocol. There is many stuff missing (SIM API, Network related stuff,  …). To improve this I am currently writing a little tool called msmsh to improve the reverse engineering of the protocol.

Suspend/Resume

Suspend/Resume works out of the box with the kernel from webOS without any modification. You can do a simple echo mem > /sys/power/state and the device suspends. To resume there are several wakup sources defined in the kernel (Power Button, Volume Keys, Slider, Headphone …). I already wrote a plugin for FSO’s fsodeviced to support suspend/resume within FSO.

Touchscreen

This is our currently show stopper. Palm implemented a driver in the Linux kernel which only does low level communication with the touchscreen. It only forwards all data from the touchscreen to the device node /dev/touchscreen. Actually some people are trying to find out how this data is structured to use it without requiring any of Palm’s tools. But no real progress here.

rootfs

Currently we are building an uImage with integrated rootfs and then boot it from our local PC on the Pre device to leave everything else on the Pre as it is. When we are ready with basis telephony stuff and touchscreen we will release this uImage so everyone can test it on their device. It will include zhone2 (a rewrite of zhone in vala) to have a simple UI to test FSO’s telephony stuff. Later we want to integrate a bootloader into the device so you can easily switch between webOS and a FSO based linux.

So you may see, many stuff is already done and we so close to have a full featured FSO framework running the Palm Pre device. If you are interested in running your Pre without webOS and with a only-FOSS userland then get in contact with us: Use smartphone-userland mailinglist or #openmoko-cdevel/#opemoko-dev on irc.freenode.net.

Categories: FSO, Linux.

FSO Palm Pre Code-Sprint

Tomorrow I will meet with Mickey to work with him on the FSO support for the Palm Pre. In the last month I worked mostly on the implementation of the protocol between userland and modem in the Palm Pre and we are now able to react on incomming calls and only one step away from doing our own calls.

Most part of our work tomorrow will be the integration of libmsmcomm into FSO. We need to rework some of the basic interfaces in fsogsmd to be able to run the AT interpreter beside the libmsmcomm stuff. So we should be able for the first time to do most stuff which is actually not implemented in libmsmcomm with normal AT commands only with the loss of creating data connections over GPRS/EDGE/UMTS. But I hope we can replace nearly all of the important AT commands in the near future with their equivalent in libmsmcomm.

So stay tuned! FSO will be on our Palm Pre, very soon.

Categories: FSO, Linux.

Tags: , , ,