Re: An idea: Add a port layer neugens.limasoftware at
Sun May 15 23:29:29 PDT 2011

This is a very good idea.

I have a lot if experience in porting java on weird OS and I can tell you I had lots of troubles trying to unify the various native layers.

In some OS, a common native interface should be enough, but I think a better solution is to have service providers together with native abstractions, similar to the concept we already have in the current filesystem api.

In either case, this is definitely a great idea and you can count on me for some manpower :) I have access to a QNX box for the moment (which is mostly compatible, needs some minor things in the network interfaces, and the graphics layer of course), but I can help with other OS as well if I get access to them somehow.

Sent from HTC Desire...

pgp key: PGP Key ID: 80F240CF
Fingerprint: BA39 9666 94EC 8B73 27FA  FC7C 4086 63E3 80F2 40CF

Proud GNU Classpath developer:
Read About us at:

Please, support open standards:

----- Reply message -----
Da: "Jing LV" <lvjing at>
Data: lun, mag 16, 2011 04:08
Oggetto: An idea: Add a port layer
A: <bsd-port-dev at>

Hello BSD developers,

I see on openjdk we'll have more platforms - except BSD, MacOS, there is
discussions about AIX. This is great news to the community, as well as a
new challenge to the community to manage different native implementation
for new added platform as well as early platform. The challenges we may
face are:
1. in current implementation, we have native implementation in
windows/linux/solaris directory, and create some same jni methods. But
actually they have the same or very similar logic. This is not very
manageable. If some logic is change we need to modify implementation on
all platforms. and may cause some of problem as no one knows all
platforms differences, and the platform developers need to understand
the logic before the modification, it may be a extra work for developers
like BSD/AIX engineers.
2. different platforms offers different system APIs, and even different
versions of system have different APIs; in current implementation I see
some code like
#ifdef someplatform
use some API
This increases the complexity of the code, and make code ugly. Also the
developer may have much trouble to read and modify if necessary.
3. Openjdk is working on project digjaw/modularization, it may meet some
trouble if the native API and logic are separated by platform level, not
in functional level.

I am wondering if a port layer, leave all APIs differences in this
layer. The jni developers can use this unified API, like "int write(fd,
byte[])" should work on all platforms openjdk supported, including
BSD/linux, windows, MacOS etc. This may help us the developers:
1. the platform developer can focus on covering the API difference and
care nothing of the upper logical - say, e.g, focus on write some given
bytes into the give fd, do not care what the fd is and how to deal with
the buffers etc, so we will write it only once, and only update for new
APIs when necessary. Meanwhile, the classlib developers can use an
unified system API and focus on the logic, we write the code once for
all platforms. It save time and effort on both side.
2. The code is then clear, no #endif is required, this helps the
developer to read and understand, and much easier to modify.
3. it may help to modularize the jdk as well.

An new portlib may also have some problems, like modification on the
current code, and performance. We need to define the portlayer well, and
make excellent build script to avoid performance degradation of the
layer. However, in the long run, the portlayer will really help the
developers as well as JDK, like some other opensource jdk do.

I believe the portlayer would help BSD developers a lot in code
maintenance, and when updating new features. I'd like to listen to your
opinions/comments/suggestions on this topic.


Best Regards,
Jimmy, Jing LV

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the bsd-port-dev mailing list