[[!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.
- 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
To make Cross Compiler, you can use pkgsrc/cross/mipsel-netbsd package
from the [The NetBSD packages collection
(pkgsrc)](http://www.pkgsrc.org/). 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
[/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
[[!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
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".
- Windows CE Platform Builder 2.12:
-
On Disk 2, at the path "\public\common\oak\inc\diskio.h".
## Building the Windows CE Boot Program (pbsdboot.exe)
TODO
## Further references for the Microsoft tools
- [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
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
- 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
set OBJMACHINE environment to create object directories namend
`obj.${MACHINE}` instead of `obj`.
## binutils support WinCE
[binutils](http://sources.redhat.com/binutils/) support WinCE for arm,
sh3, mips. Does anybody try to build pbsdboot with binutils? What shall
we do?