uClinux for H8/300H

[ja]

uClinux porting to H8/300H.
It is operating on the simulator of GDB now. and H8/3068 Evalition board Tested.

login of single user. and Execution of a command.


Updating history

January 28, 2002 (JST)First public presentation
January 30, 2002 (JST)uClibc-0.9.8 Patches Added
February 2, 2002 (JST) Kernel Patch Update (signal fixed)
February 3, 2002 (JST) Kernel Patch Update (execve fixed)
February 4, 2002 (JST)uClibc-0.9.5-020127.diff.gz removed.
February 11, 2002 (JST) Kernel Patch Update (for CVS HEAD) ptrace support Add/signal fixed.
He wishes to comment about mounting of ptrace.
uClibc patch Added.
March 9, 2002 (JST)H8/300H diff of CVS Marge Complete. Public presentation of a patch is ended.
The reference text for using source distribution was added.
April 21, 2002 (JST)new Patch Released. uClinux-H8-020421.diff.gz
April 28, 2002 (JST)NE2K Driver Porting. Test of RTL8019AS.
April 21, 2002 (JST)new Patch Released. uClinux-H8-020429.diff.gz
critical bug fixed.

Screen shot

uClinux for H8/300H
Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne
Calibrating delay loop.. ok - 5.12 BogoMIPS
Memory available: 3832k/4080k RAM, 515k/1024k ROM (2296k kernel data, 509k code)
Swansea University Computer Society NET3.035 for Linux 2.0
NET3: Unix domain sockets 0.13 for Linux NET3.035.
Swansea University Computer Society TCP/IP for NET3.034
IP Protocols: ICMP, UDP, TCP
uClinux version 2.0.38.1pre3 (ysato@vc6300cb1) (gcc version 2.95.3 20010315 (release)) #286 2002年 1月23日(水) 02時18分59秒 JST
Hitachi SCI driver version 0.01
hitachi-sci.c(1465): info=2178fe num=0
ttySC0 at 0xffffb0 (irq = 52 - 55)
hitachi-sci.c(1465): info=217a02 num=1
ttySC1 at 0xffffb8 (irq = 56 - 59)
hitachi-sci.c(1465): info=217b06 num=2
ttySC2 at 0xffffc0 (irq = 60 - 63)
Ramdisk driver initialized : 16 ramdisks of 4096K size
Blkmem copyright 1998,1999 D. Jeff Dionne
Blkmem copyright 1998 Kenneth Albanowski
Blkmem 1 disk images:
0: 82496-9E895 (RO)
PPP: version 2.2.0 (dynamic channel allocation)
TCP compression code copyright 1989 Regents of the University of California
PPP Dynamic channel allocation code copyright 1995 Caldera, Inc.
PPP line discipline registered.
SLIP: version 0.8.4-NET3.019-NEWTTY (dynamic channels, max=256).
CSLIP: code copyright 1989 Regents of the University of California.
Open of blkmem arena 0 at 82496, length 1c400
VFS: Mounted root (romfs filesystem) readonly.
init: Booting to single user mode.
# hello
Hello World
# 
    

BogoMIPS is calculated by clock 16MHz (16bit bus/2cycle).
sorry, the date is Japanese.


The compile / execution method

returns to head.

uClinux for H8/300H - Toolchain? list

The following programs are needed in order to compile a kernel, library and userland. returns to head.

Acquisition place

When you do not have, get from the following places.

Patches

get a required thing. returns to head.

Tools BUILD

gcc, binutils, and gdb are built in the almost same procedure as the usual crossing development environment.
When a procedure is unknown, look for the detailed data of H8/300 crossing environment.

returns to head.

Compile of a kernel

The patch of 2.0.38-1pre7 is old.
Useing Source Distribution. or CVS Repositry.
  1. Deployment of a source tree
    $ tar xzf linux-2.0.38.tar.gz
    $ cd linux-2.0.38
    $ zcat ../uClinux-2.0.38.1pre7.diff.gz | patch -p1
    $ zcat ../uClinux-H8-020203.diff.gz | patch -p1
     

    The source tree of uClinux-h8 is developed now.

  2. Construction of a kernel

    Notes : A configuration of those other than a standard is not tested.

returns to head.

Compile of a library

Although 0.9.8 is released, it does not acquire yet. It is the patch of 0.9.5snapshot.removed.
(2002/01/30) Added 0.9.8
0.9.9 Released. Marged H8/300H Support. but ptrace problem. please fixed patch. (2002/03/09) Update CVS Source. ptrace problem fixed.

Deployment of source (for 0.9.9)

  1. Please download uClibc-0.9.9.tar.bz2
  2. Please download ptrace.diff and apply a patch.
returns to head.

Configuration & installation

I do not know details of work. He wishes a supplement of those who know details.

  1. extra/Configs/Config.h8300 are copied to Config of a top directory.
  2. Please change the variable of Config according to environment. It seems that a library will be made if these three are set up according to environment for the time being although it is likely to be in others.
  3. make
  4. It is set to root and is make install.

A detailed thing should read the document of a library.

returns to head.

The compile method of a userland

Although it can compile and link ordinarily, be careful of the following points.

The portion which is not known should refer to other architecture.

Addition

The user land of uCsimm was compiled.
The difference in library for corrected and it has compiled normally. init and sh are actually .

returns to head.

Creation of a route image file

It creates by genromfs.
Refer to the kernel document for the details of genromfs and romfs.
make a suitable directory and place a file by making that into a root.
A file required for starting of uClinux-H8, (Naturally /dev/ttyS0 is made from mknod. and init is a program which actually operates.)
It is the same as ordinary linux.
If a required file is arranged
$ genromfs -f imagename root-directory-name
An image file is created.

tarball of a sample is put on placed.

returns to head.

The conversion of a route image

This is main subject.

the output of genromfs cannot be linked as it is.
Since linking to a kernel is indispensable, it changes into coff by objcopy.

$ h8300-hitachi-hms-objcopy --adjust-vma=0x88000 --adjust-arch=h8300h \
> --adjust-mach=2 --add-section .rootimg=(rootimage binary) --remove-section .data \
> -I binary -O coff-h8300 (rootimage binary) (rootimage coff)

It changes into coff by this command.
The changed file is copied to the top directory of kernel source, and carries out make.

returns to head.

Arrangement of a route image

The following is changed into reference when changing arrangement of a route image.
The ROMFS driver(drivers/block/blkmem.c) has managed the root image.
Since area_t in a driver has managed the address of an image, corrects of change arrangement.
Now, the data arranged at .rootimage section becomes a route image.
A detailed thing should look at blkmem.c and arch/h8300/platform/h8300h/generic/rom.ld.

returns to head.

execute.

It cannot perform simply.
Please let me start in the following procedures.
  1. Please prepare two terminals. It becomes the terminal of gdb and uClinux.
  2. linux is specified and started by gdb which has applied the patch.
    $ h8300-hitachi-hms-gdb linux
    
  3. If it is set as a simulator by target sim, the false terminal for SCI simulations will be assigned and a terminal name (probably ttya0) will be displayed.
    (gdb) target sim
    SCI0=ttya0
    (gdb)
    
  4. Please connect with a false terminal in one more terminal using a suitable serial terminal (ex. cu).
    This becomes the console of uClinux.
  5. Please load.
  6. Please set here to pass a kernel parameter.
    In standard ldscript, an address is from 0x5ffe00.
  7. If it run, a kernel will start.
  8. Please operate it suitably.
  9. If you want to come to stop, please SIGINT-send to gdb and stop.
returns to head.

Notes

It is not serious. returns to head.
A link is free.
Yoshinori Sato
To Top.