Export to GitHub

e60-open - HowToTestAKernel.wiki


Introduction

When testing a custom Linux kernel on the E60, the process of flashing the Kernel image is not very practical, as it is both lengthy and risky: writing the kernel into Flash is slow, and thus replacing the normal "working" kernel may lead to use the RecoveryMode in case there is something wrong with your modifications...

Fortunately, there is a way to download a Linux kernel to the E60 in RAM and launch it once from there, without fearing a crash. By using the U-Boot bootloader serial console, it is possible to stop the normal boot process, wait for a kernel image bulk download over USB and launch the fresh kernel image from RAM just once.

Prerequisites

Hardware

An access to the Samsung E60 eReader U-Boot/Linux console is required.

In order to get access to this console, opening the E60 device is required, as explained in the Teardown Wiki page.

Then, a little soldering is also required, as explained in the SerialConsole Wiki page.

Software

On the Samsung E60 device side, all the required software is already built-in into it, so nothing specific is needed.

However, on the device side, both a low-level USB driver and an application program are required in order to perform the USB bulk transfer.

If we consider the Linux PC platform, the 2 required pieces of software are: * the secbulk Samsung USB bulk transfer device driver kernel module * the dnw command line utility

Building the kernel driver module

In order to build the secbulk kernel driver module, you need: * to have a working toolchain available (binary utilities, C/C++ compiler and standard C/C++ library and headers), that is capable of building a kernel * to get your kernel sources: usually, this is obtained by installing a "linux-devel" package using the standard binary package manager on your desktop Linux * to download the secbulk source package * to unzip this source package into a directory of your choice * to enter into the module directory: cd path_to/secbulk-1.0.0 * to compile the external module by using the command: make * to install the compiled module at the appropriate location so that it can be loaded when required, by using the command: sudo make install

Building the command line utility

If you ever compiled another source package, building the dnw command line utility is very simple: * download the dnw source package * unzip this source package into a directory of your choice * enter into the module directory: cd path_to/dnw-1.0.0 * configure the source package so that it can be compiled on your machine by using the command: ./configure * compile the utility by using: make * install the binary program, translated messages and manual page at the correct location, by using: sudo make install

Procedure

Once you have a working serial console and have compiled the required piece of host software, testing a custom kernel becomes very easy: * open a terminal emulator window, such as: sudo minicom -p /dev/ttyS0

or screen /dev/ttyS0 115200,cs8,-ixon,-ixoff,istrip * plug the Samsung provided (two-headed on one side) USB cable into both the Samsung E60 eReader and the computer host * while frantically pressing a key into the terminal emulator, turn on the E60 device * you should get a display like the following into the terminal emulator: ``` U-Boot 1.3.4 (May 14 2010 - 18:09:39) for E6

CPU: S5PC100@666MHz Fclk = 666MHz, Hclk = 166MHz, Pclk = 66MHz, DoutMpll = 133MHz, Serial = PCLK Board: E6 e-Diary DRAM: 256 MB Flash: 0 kB SD/MMC: 1960MB The input address don't need a virtual-to-physical translation : 27e7c008 Init EPD Panel.........done

In: serial Out: serial Err: serial Net: No ethernet found Hit any key to stop autoboot: 0 SNE6 # * enter the download wait command at the U-Boot prompt: dnw c0008000 ```

This should display: OTG cable Connected! Now, Waiting for DNW to transmit data * back onto the host, launch the Samsung USB bulk transfer utility: sudo dnw path_to/kernel.bin * after approximately 1 second, you should get on the host side: Target USB device found! Filename : kernel.bin Filesize : 1692828 bytes Checksum : 0xd4e2 Writing data... 100% 1692828 bytes Done! * and on the E60 device side: Download Done!! Download Address: 0xc0008000, Download Filesize:0x19d49c Checksum is being calculated.. Checksum O.K. SNE6 # * the only thing left to do at the U-Boot prompt is to launch the kernel from RAM: bootm c0008000