File:  [NetBSD Developer Wiki] / wikisrc / ports / hpcmips / howto-develop.mdwn
Revision 1.1: download - view: text, annotated - select for diffs
Sat Mar 30 17:40:26 2013 UTC (12 months, 2 weeks ago) by mspo
Branches: MAIN
CVS tags: HEAD
add the hpcmips sub pages

NetBSD/hpcmips Developer How-To page
====================================

Developing NetBSD/hpcmips
-------------------------

### 

-   [About this page](#about)

### Environment for developers

-   [Self compile Environment](#env-dev)
-   [Cross compile Environment](#cross-dev)

### NetBSD/hpcmips kernel hacking

-   [Adding support for a new system](#add-platform)
-   [console frame buffer](#console-scroll)

### pbsdboot.exe - boot program from CE environment

-   [Preparing to build Windows CE programs](#prep-booter)
-   [Building the Windows CE Boot Program (pbsdboot.exe)](#build-booter)
-   [Further references for the Microsoft tools](#build-references)
-   [Japanese characters in menu](#jp-menu)
-   [frame buffer type names](#fb-names)
-   [Share source tree with other ports](#share-source)
-   [binutils support WinCE](#binutils-wince)

* * * * *

### 

#### About this page ([top](#))

This page contains information that current and potential developers of
NetBSD/hpcmips might find useful.

* * * * *

### Environment for developers

#### Self compile Environment ([top](#))

Developers needs Ethernet cards and Large disks. Typical CE system has
CF slot and PCMCIA slots. Assign CF to Ethernet card and PCMCIA to
ATA/SCSI Interface.

CF Ethernet card
:   
Type1:
:   Socket Communications CF Ethernet Cards

    TDK CF Ethernet Cards

Type2:
:   Xircom CF Ethernet Cards

PCMCIA SCSI Card
:   
Adaptec SlimSCSI 1460 series Card with any SCSI Disk works fine.
:   
Adaptec SlimSCSI 1480 is Cardbus version,CardBus won't work.
:   If you want to build NetBSD/hpcmips system from source file. you
    have 2G SCSI Disks.

    If you want to build NetBSD/hpcmips system with all packages from
    source file,5-10G Disks required.

PCMCIA ATA Card
:   some ATA-PCMCIA cards works fine,but I recommended SCSI system.

#### Cross compile Environment ([top](#))

To make Cross Compiler, you can use pkgsrc/cross/mipsel-netbsd package
from the [The NetBSD packages collection
(pkgsrc)](../../docs/software/packages.html). After you've installed the
mipsel-netbsd package, use the [cross make script](./hpcmips-make) by
`<sakamoto@splhack.org>`{.email}.

There's also an experimental ELF binary for a NetBSD/i386 cross compile
environment. It is located at
[/pub/NetBSD/arch/hpcmips/cross/i386-hpcmips/mipsel-netbsd.tgz](ftp://ftp.NetBSD.org/pub/NetBSD/arch/hpcmips/cross/i386-hpcmips/mipsel-netbsd.tgz).

* * * * *

### NetBSD/hpcmips kernel hacking

#### Adding support for a new system ([top](#))

commit syssrc/sys/arch/hpcmips/hpcmips: platid.def
:   
make syssrc/sys/arch/hpcmips/hpcmips dir.
:   regen syssrc/sys/arch/hpcmips/include: platid\_generated.h
    platid\_mask.h
commit syssrc/sys/arch/hpcmips/ dir.
:   
add entry /syssrc/sys/arch/hpcmips/stand/pbsdboot/main.c and commit
:   
keyboard translation table
:   commit /syssrc/sys/arch/hpcmips/vr/vrkiu.c

#### console frame buffer ([top](#))

-   virtual TEXT vram implementation
-   optimize scroll
-   hardware accelerator hooking mechanism
-   multiscreen (some bugs, so currently disabled)
-   if you want disable above codes, \#define HPCFB\_DISABLE

* * * * *

### pbsdboot.exe - boot program from CE environment

#### Preparing to build Windows CE programs ([top](#))

To build the NetBSD/hpcmips Windows CE "standalone" programs, you will
need to use a properly configured Windows NT 4.0 system. This section
will tell you what you tools you need and how you should configure your
system to build the standalone programs. You should read the whole
section before you proceed, but beware, some of the names of the
products mentioned here are a bit confusing.

Building the NetBSD/hpcmips standalone programs *requires* Japanese
language character encoding ("code page") support in Windows NT. If your
installation of Windows NT does not already support Japanese language
character encoding, you will need to install the Japanese Language Pack.
(Windows NT installations in the United States will typically not
include this support, even if you've installed Japanese language support
for recent versions of Internet Explorer.) To install the Japanese
Language Pack:

1.  Put your Windows NT 4.0 CD-ROM into your PC's CD-ROM drive.
2.  With the Windows NT Explorer, enter the "`langpack`{.code}"
    directory in the root of the CD-ROM.
3.  Right-click on the file named "`Japanese`{.code}"
    ("`Japanese.inf`{.code}" if you have Explorer set to display known
    file extensions), and select the "`Install`{.code}" menu option to
    install the language pack.
4.  When the system has finished installing the language pack, reboot
    your system.

Microsoft Visual C++ and the Windows CE Toolkit for Visual C++ are
*required* to build the NetBSD/hpcmips standalone programs. Versions 5.0
and 6.0 of Visual C++ are known to build the standalone programs
correctly. (You might be able to substitute the Windows CE Platform
Builder or the Windows CE Embedded Toolkit in place of the Windows CE
Toolkit if you don't have the latter, but this documentation assumes
that if you have the expensive tools you know how to use them.) To
prepare these tools:

1.  Install Microsoft Visual C++ 5.0 or 6.0.
2.  Install the Windows CE Toolkit for Visual C++ corresponding to your
    version of Visual C++ (e.g., the Windows CE Toolkit for Visual C++
    6.0, if you're using Visual C++ 6.0. (If you are doing a custom
    installation, you do not have to install the cross-compilation tools
    for platforms other than "`WCE MIPS`{.code}." You should install
    both the Palm-size PC and Handheld PC components of the Toolkit.)

Finally, in order to build a boot loader with support for directly
reading kernels from BSD FFS disk partitions, you will need the Windows
CE raw disk I/O control header, `diskio.h`{.code}, to be present in the
"`sys/arch/hpcmips/stand/include`{.code}" directory of your source tree.
(This header is not required if you're content to build a version of the
boot loader which only supports reading kernels from FAT file systems.)
`diskio.h`{.code} is part of the Windows CE Platform Builder (formerly
known as the "Embedded Toolkit"), and can be found in one of the
following locations depending on Platform Builder/Embedded Toolkit
version:

Windows CE Embedded Toolkit for Visual C++ 5.0:
:   Unknown. If you know, [send us mail](mailto:www@NetBSD.org).
Windows CE Platform Builder 2.11:
:   On Disk 1, at the path "`\public\common\oak\inc\diskio.h`{.code}."
Windows CE Platform Builder 2.12:
:   On Disk 2, at the path "`\public\common\oak\inc\diskio.h`{.code}."

#### Building the Windows CE Boot Program (pbsdboot.exe) ([top](#))

TODO

#### Further references for the Microsoft tools ([top](#))

-   [Visual C++
    Datasheet](http://msdn.microsoft.com/visualc/prodinfo/datasheet/default.asp)
-   [Windows CE eMbedded Visual Tools
    Datasheet](http://www.microsoft.com/windows/embedded/ce/tools/factsheet.asp)
-   [Windows CE Platform Builder
    Datasheet](http://www.microsoft.com/windows/embedded/ce/tools/pb30datasheet.asp)

#### Japanese characters in menu ([top](#))

Having Japanese characters in menu is very important for Japanese
version Windows CE users. Because, newer version of Windows CE (Japanese
version; 2.11?) treats CF/PC Card folder as 'MEMORIKA-DO' (spelled in
Japanese, Katakana), not 'Storage Card'.

On the other hand, older version of Windows CE(Japanese version; 1.0 and
2.0?) treats them as 'Storage Card'.

Therefore, both of 'Storage Card' and 'MEMORIKA-DO' are necessary for
Japanese users.

(Does GetLocaleInfo API of WindowsCE help us?)

#### frame buffer type names ([top](#))

D2
:   2bpp

Dxx\_yyyy and M2L\_y
:   xx means frame buffer depth

    y means the pixel value of the foreground color in hexadecimal

    'M2L means most significant bit to least significant bit. The MSB is
    left pixel and LSB is right pixel if a byte represents two or more
    pixels. 'L2M means reverse order. The 'x2' option provides virtual
    double width screen. For example, Palm Size PC, Freestype, which has
    LCD of 320x240, pretend to has LCD of 640x480. It had been hack for
    debugging until serial port got available. Please don't mind about
    it.

#### Share source tree with other ports ([top](#))

set OBJMACHINE environment to create object directories namend
`obj.${MACHINE}`{.filename} instead of `obj`{.filename}.

#### binutils support WinCE ([top](#))

[binutils](http://sources.redhat.com/binutils/) support WinCE for arm,
sh3, mips. Does anybody try to build pbsdboot with binutils? What shall
we do?



CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb