File:  [NetBSD Developer Wiki] / wikisrc / ports / hpcmips / howto-develop.mdwn
Revision 1.2: download - view: text, annotated - select for diffs
Tue Jan 14 12:40:28 2014 UTC (3 months, 1 week ago) by ryoon
Branches: MAIN
CVS tags: HEAD
Fix broken things

[[!meta title="NetBSD/hpcmips Developer How-To page"]]

# Developing NetBSD/hpcmips

[[!toc startlevel=1 levels=2]]

* * * * *

## About this page

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

* * * * *

# Environment for developers

## Self compile Environment

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.

<dt>CF Ethernet card</dt>
<dd>Type1<br />
Socket Communications CF Ethernet Cards
TDK CF Ethernet Cards
Xircom CF Ethernet Cards
<dt>PCMCIA SCSI Card</dt>
<dd>Adaptec SlimSCSI 1460 series Card with any SCSI Disk works fine.<br />
Adaptec SlimSCSI 1480 is Cardbus version,CardBus won't work.<br />
If you want to build NetBSD/hpcmips system from source file. you
have 2G SCSI Disks.<br />
If you want to build NetBSD/hpcmips system with all packages from
source file,5-10G Disks required.
<dt>PCMCIA ATA Card</dt>
some ATA-PCMCIA cards works fine, but I recommended SCSI system.

## Cross compile Environment

To make Cross Compiler, you can use pkgsrc/cross/mipsel-netbsd package
from the [The NetBSD packages collection
(pkgsrc)]( After you've installed the
mipsel-netbsd package, use the [[cross make script|hpcmips-make]] by

There's also an experimental ELF binary for a NetBSD/i386 cross compile
environment. It is located at

* * * * *

# NetBSD/hpcmips kernel hacking

## Adding support for a new system

[[!template id=programlisting text="""
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

-   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

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`"
    directory in the root of the CD-ROM.
3.  Right-click on the file named "`Japanese`"
    ("`Japanese.inf`" if you have Explorer set to display known
    file extensions), and select the "`Install`" 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`." 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`, to be present in the
"`sys/arch/hpcmips/stand/include`" 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` 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

<dt>Windows CE Embedded Toolkit for Visual C++ 5.0:</dt>
Unknown. If you know, [send us mail](
<dt>Windows CE Platform Builder 2.11:</dt>
On Disk 1, at the path "\public\common\oak\inc\diskio.h".
<dt>Windows CE Platform Builder 2.12:</dt>
On Disk 2, at the path "\public\common\oak\inc\diskio.h".

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


## Further references for the Microsoft tools

-   [Visual C++
-   [Windows CE eMbedded Visual Tools
-   [Windows CE Platform Builder

## Japanese characters in menu

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

<dt>Dxx\_yyyy and M2L\_y</dt>
xx means frame buffer depth<br />
y means the pixel value of the foreground color in hexadecimal<br />
'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

## Share source tree with other ports

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

## binutils support WinCE

[binutils]( support WinCE for arm,
sh3, mips. Does anybody try to build pbsdboot with binutils? What shall
we do?

CVSweb for NetBSD wikisrc <> software: FreeBSD-CVSweb