Run Linux

Run Linux

Before running Linux/M32R please make sure M32R cross-tools, kernel and user land are installed propery. If you have not installed them yet, please check Installation.

The installation procedure itself is broken into four steps.

  1. Create gdbinit
  2. Run sdiserver
  3. Prepare serial console
  4. Run kernel from gdb

Create gdbinit

Please change the working directory to the directory which you built the Linux kernel before starting the following procedures.

Please copy the gdbinit file to the current directory as ".gdbinit".

cp arch/m32r/mappi2/dot.gdbinit .gdbinit
Each platform has its own gdbinit file. Please use the appropreate gdbinit file.

uT-Engine arch/m32r/m32700ut/dot.gdbinit
Mappi-II(M3A-ZA36) arch/m32r/mappi2/dot.gdbinit

Gdbinit file contains the following configuration line which depends on the environment. Please modify it for your environment.

set {char[0x200]}($param + 0x100) = "console=ttyD0,115200n8x root=/dev/nfsroot
nfsroot= nfsaddrs=
.1: \0"
This line defines boot arguments of Linux kernel.

console Console device and its baud rate.
root Target's root file system.
nfsroot Configuration of NFS root file system.
<server-ip> -- The IP address of the NFS server.
<root-dir> -- Name of the directory on the server to mount as root.
nfsaddrs Configuration of network.
<my-ip> -- The IP address of the target.
<server-ip> -- The IP address of the NFS server.
<gw-ip> -- The IP address of the gateway.
<netmask> -- Netmask.
<name> -- Host name of the targetk.

Run sdiserver

gdb cannot connect to a target board directory. Instead, gdb sends commands to sdiserver by sockets interface and sdiserver controls the target. Please run sdiserver before running Linux/M32R. You have to use the super user account because sdiserver accesses I/O port.
> su
> /usr/local/m32r-linux-3.2/bin/sdiserver
sdiserver 1.5
Copyright (c) 2003 Renesas Technology Co. All rights reserved.
Waiting for connection to port 3232

Prepare serial console

Target machine uses serial port for console. Please run cu command to get console outpout from the target.
 cu -s 115200 -l /dev/ttyS0

Run kernel from gdb

Run m32r-linux-gdb. Please make sure the current directory is the directory which you built Linux kernel.
> m32r-linux-gdb 
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=i586-pc-linux-gnu --target=m32r-linux".
You can connect gdb to the target by target command. Please use m32rsdi as target command's argument.
(gdb) target m32rsdi
Remote m32rsdi connected to M32R/XNUX
If you get a message like "Remote m32rsdi connected to ...", the connection between gdb and the target is established correctly.

Please enter restart command. Restart command is defined in gdbinit file. It configures target board and download/run the kernel.

(gdb) restart
Check the serial console to see Linux kernel outputs boot messages.


You can login the target as root by slogin command. The password of root account is "root".


Last modified: 2004/03/25