Overview


Midori is a bundle of system software that is intended to promote the development of energy-efficient Linux-based devices like Internet appliances. Midori and its software development environment are based on Open Source software and common hardware components. Midori has a build and package management system that is designed for embedded software applications.

But most importantly, Midori contains a set of enhancements to the standard Linux kernel that will make it applicable to embedded applications. These include:

These enhancements are in the process of being integrated into the standard Linux kernel distribution.

Midori is not a monolithic platform like Windows CE or PalmOS. It isn't even as complete as one of the commercial desktop Linux distributions like Debian or Mandrake. Midori is a bundle of system technology that can be used to develop embedded products. But to do this successfully, you will probably need additional system software and a more tailored GUI framework.

This chapter describes Midori and its design space. Subsequent chapters describe the Midori build system, the Midori package management system, system software issues and Midori client management.
 

Midori Perspectives

It helps to look at Midori from the different perspectives of the Midori community. Each of the following groups has its own needs: Our mission is to deliver Midori technology that will be useful to all members of the Midori community.

Midori and Internet Appliances

Midori is a software technology designed to support a new class of devices called Internet appliances. The salient characteristics of Internet appliances are: Currently, a wide range of Internet appliances are possible with Midori, including consumer products and special-purpose devices for vertical markets. Because Midori is a freely available software technology, developers can modify it to suit the needs of their designs. But to help bring focus to the concept of an Internet appliance, here are some baseline hardware characteristics:

Special Kernel Features

Most of the peripherals listed above are supported by the standard Linux kernel or its device drivers. Midori has introduced a number of special features that are making their way into the standard Linux kernel:

Other Features

Midori includes a number of features that enhance usability on small and portable devices:

Midori Architecture

As might be expected, the Midori architecture is very similar to the widely-used desktop distributions based on the Linux 2.4 software releases.

application
layer
browser, MP3 player, etc.
graphics
layer
XFree86 4.x
library &
daemon
layer
ACPI daemon
mlconfig daemon
PCMCIA card manager
GNU glibc and other libraries
Linux
kernel
layer
base kernel kernel modules and drivers
cramfs
ramfs
ACPI
hardware
layer
RAM Flash ROM BIOS ROM low-power
x86 processor
peripherals
display
power
network

There are, however, some important differences.

Midori has a boot process that has been streamlined to meet the needs of small devices. In practice, this means that Midori has a specially configured Linux kernel that uses cramfs and ramfs to boot Midori out of Flash ROM with the assistance of an external BIOS. Midori also replaces the standard Linux init(8) with a script-based system that uses pdksh(1).

Briefly, here is an overview of the Midori boot process:

  1. power on the system
  2. CPU + BIOS interrogate system to bring up some of the system board (not the network or the PCMCIA)
  3. BIOS runs the bootloader
  4. kernel is loaded out of Flash ROM by the bootloader
  5. init-based boot sequence to mount root, cramfs and ramfs
  6. launch applications

Application Development

As an application environment, Midori is quite different from standard Linux desktop distributions and it is especially different from platforms like Windows CE and PalmOS. Because Midori is an enabling technology for consumer devices, it is left to the actual device designer to define a baseline application support system for a specific Midori-based device.

Midori Packages

Midori is organized as a set of packages, one of which holds a recent version of the standard Linux kernel. Other packages hold system software that provide platform functionality and applications that users can interact with. Midori also includes a build system for constructing Flash ROM images of the Midori runtime that can then be loaded into a target device and a package management system for adding applications or device drivers. Midori also includes a few critical build tools like gcc and binutils.

The table below describes the major packages included with Midori:

operating system system:  
    Linux kernel  
    cramfs:

        filesystem

        bootloader

        configuration utility

        upgrade system

        packcramfs

(Midori)
    ramfs (Midori)
    pdksh  
    busybox  
    log daemon (Midori)
    startup and runtime scripts
        (init(8) replacement)
(Midori)
debug support:  
    ltrace  
    strace  
libraries:  
    glibc  
    ldconfig  
    zlib  
    popt command line parsing library  
    audiofile library  
network:  
    net-tools  
    inet utilities  
    ppp  
    pppoe (PPP over Ethernet)  
    pump DHCP client  
devices:  
    wireless tools  
    hwclock  
    touchscreen utility

     (MK712 driver only)

(Midori)
    usbutils (debug)  
    PCMCIA card services  
Note: Midori depends on Linux and XFree86 for device driver support of standard hardware components. In some cases, the Midori team has submitted new or modified device drivers to the core Linux distribution.
 
audio:  
    tplay sound utility  
    aumix sound control utility  
    esound server utility  
     
GUI/window system XFree86  
GTK+/glib  
Microsoft Truetype core web fonts
(must be downloaded separately from http://www.microsoft.com/typography/fontpack/default.htm)
(binary)
window managers:  
    aewm  
    icewm  
    lwm  
    swm  
     
applications Netscape (binary)
xkeyboard (Midori)
xbutton (Midori)
rxvt xterm client (debugging tool, requires ncurses)  
vim (debugging tool)  
     
client management mlconfig (Midori)
network upgrade system (Midori)
     
build system GCC  
binutils  
MLZ package management system (Midori)
     

FAQ

Q: How can I hack on the kernel?
A: The source code for the Midori kernel is in the subdirectory cache/build/linux. This source code has been substantially modified from the Linux 2.4 distribution.

Q: How can I use gdb?
A: The Midori build system doesn't support remote debugging with gdb. Use ltrace and strace instead.

Q: It crapped out before it finished building, but whatever went wrong scrolled by too quickly for me to catch.
A: Run your make command with the script(1) terminal session logger:

% script
% make
% exit
This command sequence will send all the diagnostic output to the file typescript.

Q: This build process is righteously hosed. How do I force it to rebuild everything?
A: Rebuilding everything takes a very long time, because everything includes gcc, glibc, and X. To do this, type make distclean. However, if you do not want to build those three packages, just run make clean. This will let you rebuild much faster.

Q: It's printing out tons of debugging messages. Make it stop!
A: Use Webconfig to turn off the debug options.

Q: Something is completely screwed here.
A: Set DEBUG=yes in config and try again. This will print out what's happening in the scripts. These scripts are as bullet-proof as we could make them with limited time, but there are problems, and turning on debugging can help find them. If you haven't the time to debug, then do a make clean or make distclean and start over.

Q: What can I do about Netscape crashing?
A: Any experienced user of Linux Netscape is used to seeing it crash and the included version of Linux Netscape is no exception. This is probably not good, but the product does not come with source code. The workaround is to run Netscape in a loop.

Q: How does Midori provide support for disaster recovery?
A: Midori has several provisions to aid in disaster recovery. First, a Midori Flash ROM image includes two identical root (system software) directories. This provides a backup Linux kernel that can take over if the primary Linux kernel becomes damaged. Second, Midori provides a persistent storage mechanism that enables Internet appliances to store important information like user preferences in Flash ROM. Finally, Midori supports selected updates of compressed system software on Flash ROM. This enables Internet appliance developers to design an efficient and crash-proof software update strategy.