USB

From OLPC
Jump to navigation Jump to search

The Universal Serial Bus (USB) is the most common way of connecting peripherals, such as keyboards, mice, additional storage or display, and communication devices to a laptop computer. The XO Laptops provide three USB 2.0 ports for connecting peripherals.

USB drives

A much better presentation of this information is available at USB drive.

It can be useful to know how to move files to and from the XO and a USB drive you plug into the XO, beyond using the Activity transfer metaphor the Sugar interface provides. To do so, you must understand a little about Linux and its file systems. We do not provide a really complete tutorial on this subject here.

Plugging my USB drive into the provided port and going to the Journal, I dwell over the USB icon and read "18FB-3D54". (You will read another label with your USB drive.) Opening a Terminal activity (its startup icon is off the screen of the default Activity Circle view, so scroll to the right) I can verify there is now a directory branch named /media/18FB-3D54 holding my USB drive contents by issuing:

   ls -al /media/18FB-3D54
  • (Note that /media changes to /run/media/olpc for Fedora 17 based builds used in 12.1.0 and later).

I can then use the cp command to copy files between the USB drive and the XO. If you enter root mode (e.g. via the "su" command), be careful you do not damage critical files on your XO, lest you have to restore the system using either Secure Upgrade or Olpc-update!

You can use the Browse activity to examine the file system on the XO non-destructively. Clicking on the address field, which on startup reads "OLPC Library", you will see the name of the file at which one is looking from the text which now appears in the field, namely,

   file:///home/olpc/.library_pages/search/bundle_index.html

If you are familiar with hierarhical file systems, like that on Microsoft Windows, the meaning of the text above should be manifest. (But note that the Red Hat Linux operating system used to run the XO employs FORWARD slashes to sequence parent&child directories ("folders"), unlike Windows, which uses BACKWARD slashes.)

If you are new to this stuff, the meaning of the text above is as follows. The Browse activity is displaying a World-Wide-Web-style file called "bundle_index.html". It sits in a "directory" (a collection of files) labelled "search". The "search" directory sits (potentially with other directories and files) in a "parent" directory labelled ".library_pages", and so on up to the "home" directory. Actually, the "home" directory itself sits in a special directory at the top of all directories called "root", which we designate using the single symbol "/". People familar with Microsoft Windows will notice Linux evidently does not use letters to designate disk drives; in fact, all disk drives are "mounted" on branches of this universal file system descending from "root" using extra commands.

If your USB drive used the same symbol mine does, you can use Browse to examine its files by entering the following into the address field:

    file:///media/18FB-3D54

Your USB drive is also organized using a hierachical file system. Clicking on directories listed on the page shown lets you descend down to lower levels of it. You can back out of such descent by clicking on the special text not far from the top left of the page which reads "Up to a higher level directory".

If you encounter image files (e.g. "jpg" files) on your USB drive, you can view one by clicking on its name. To back out of viewing one, use the "back" button (its icon is an arrow-head pointing to the left, near the top left of the page.) If an image is too big to fit on the screen of the XO, you can click on it to make its appearance resize to just fit (the file itself is NOT changed). Clicking on the screen again and again toggles between these two alternatives. When in the mode in which the image is too large for the screen, you can use the "scroll bars" appearing at the right and/or bottom of the screen to pan over it.

The scroll bar also appears on the right of the screen if the USB directory contents are too extensive to fit on the screen, allowing you to scroll the listing up and down.

You may also like to use the Browse application to examine the file system on the XO itself.