Understanding Sugar code: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
No edit summary
Line 5: Line 5:
To do this, let's use the superuser command, "su".
To do this, let's use the superuser command, "su".


[olpc@localhost]$ su
----

[olpc@localhost]$ su


----
----


What runs as part of sugar? Let's see what processes have the keyword sugar using both the "ps" command to list processes, and the grep command to filter for the processes with the word "sugar" in them.
What runs as part of sugar? Let's see what processes have the keyword sugar using both the "ps" command to list processes, and the grep command to filter for the processes with the word "sugar" in them.
bash-3.1# ps -eaf | grep sugar
olpc 1290 1285 3 15:46 ? /usr/bin/python /usr/bin/sugar-shell
olpc 1293 1290 0 15:46 ? matchbox-window-manager -kbdconfig /usr/share/sugar/kbdconfig ...
olpc 1296 1 0 15:46 ? dbus-launch --exit-with-session sugar-shell
olpc 1298 1 0 15:46 ? /usr/bin/python /usr/bin/sugar-presence-service
olpc 1302 1 0 15:46 ? /usr/bin/python /usr/bin/sugar-clipboard
olpc 1304 1 0 15:46 ? /usr/bin/python /usr/bin/sugar-nm-applet
olpc 1306 1 4 15:46 ? python /usr/bin/sugar-console
olpc 1339 1285 1 15:46 ? grep sugar


----

bash-3.1# ps -eaf | grep sugar
<txt>
olpc 1290 1285 3 15:46 ? /usr/bin/python /usr/bin/sugar-shell
olpc 1293 1290 0 15:46 ? matchbox-window-manager -kbdconfig /usr/share/sugar/kbdconfig ...
olpc 1296 1 0 15:46 ? dbus-launch --exit-with-session sugar-shell
olpc 1298 1 0 15:46 ? /usr/bin/python /usr/bin/sugar-presence-service
olpc 1302 1 0 15:46 ? /usr/bin/python /usr/bin/sugar-clipboard
olpc 1304 1 0 15:46 ? /usr/bin/python /usr/bin/sugar-nm-applet
olpc 1306 1 4 15:46 ? python /usr/bin/sugar-console
olpc 1339 1285 1 15:46 ? grep sugar
</txt>
Most things seem to run on python, not a big suprise. But right here, we can see some key architectural divisions:
Most things seem to run on python, not a big suprise. But right here, we can see some key architectural divisions:
# A shell
# A shell

Revision as of 16:35, 22 February 2007

OK, Sugar runs on an OLPC. The OLPC runs a stripped down Fedora Linux Operating System.

Open the Developer Console, and go to the Terminal tab. Click in the Terminal window, and switch to the root account:

To do this, let's use the superuser command, "su".

[olpc@localhost]$ su

What runs as part of sugar? Let's see what processes have the keyword sugar using both the "ps" command to list processes, and the grep command to filter for the processes with the word "sugar" in them.

bash-3.1# ps -eaf | grep sugar
olpc 1290 1285 3 15:46 ? /usr/bin/python /usr/bin/sugar-shell 
olpc 1293 1290 0 15:46 ? matchbox-window-manager -kbdconfig /usr/share/sugar/kbdconfig ... 
olpc 1296    1 0 15:46 ? dbus-launch --exit-with-session sugar-shell
olpc 1298    1 0 15:46 ? /usr/bin/python /usr/bin/sugar-presence-service 
olpc 1302    1 0 15:46 ? /usr/bin/python /usr/bin/sugar-clipboard
olpc 1304    1 0 15:46 ? /usr/bin/python /usr/bin/sugar-nm-applet
olpc 1306    1 4 15:46 ? python /usr/bin/sugar-console
olpc 1339 1285 1 15:46 ? grep sugar

Most things seem to run on python, not a big suprise. But right here, we can see some key architectural divisions:

  1. A shell
  2. A presence service (the right side of the sugar interface)
  3. A clipboard (The left side of the sugar interface)
  4. A nm applet utility of some kind (This might be the bottom stuff in the sugar interface)
  5. A console (probably the development console)

Also, there are two non-python type processes running, dbus-launch, and a matchbox-window-manager. I think matchbox is an automated test utility (notice it's spawned from the sugar-shell), and the dbus is for Inter-process communications (supporting the presence service, amongst other things)

So the questions are...

What starts the sugar shell? What is each service or utility?