Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How do you Invert signed numbers?

843789Aug 26 2009 — edited Sep 3 2009
Hi there.

A simple question: How can I invert the sign of an integer? ie) convert -12 to +12? No doubt there is a really simple way to do this, but I'm stumped, I cannot find anything and I've been working on this program all day.

I'll be very grateful to anyone who can let me know if Java provides a way to do this, or point me in the right direction if it takes some tweaking of binary numbers using the Math package or something.

Cheers!

Comments

tbrinkmann
Re,
you can try to use the release notes to check witch version of OL was shipped with witch UEK version.

https://oss.oracle.com/el5/docs/

*T
Dude!
You can get a full listing showing you all available versions of a package for OL 5 and OL6, e.g. kernel-uek by browsing the repository channel at http://public-yum.oracle.com/repo/OracleLinux and opening the "latest" and "uek" channels. The listings are quite large and may take a while to load in your web browser.

From what I understand, having the same Oracle UEK kernel available for OL 5 and OL 6 is part of the plan. It is mentioned in several documentations. However, not every feature is necessarily available in both versions. For instance, BTRFS requires OL 6.

To install the UEK2 kernel under OL 5 requires to download the latest yum repository configuration file from http://public-yum.oracle.com and enable the UEK_latest channel.
alvaromiranda
Hello

Think in this way.

kernel uek, came out

kernel-uek-2.6.32

version were

kernel-uek-2.6.32-100
kernel-uek-2.6.32-200
kernel-uek-2.6.32-300
kernel-uek-2.6.32-etc

one every quarter

at some point, kernel uek2 came out

kernel-uek-2.6.39-100

then

kernel-uek-2.6.39-200
kernel-uek-2.6.39-300
kernel-uek-2.6.39-400

Do you see the pattern and how it;s going higher version?

you should always be on the latest one checking the applications support it.

on yum, enable latest and UEK_latest channel, and that's all.

hope this helps.

Alvaro.
alvaromiranda
on top of that, ol6 and ol5 each one have their own uek_latest and latest channel, and the RPMS have .ol6 or ol5 in the name, are not interchangable

example, all the kernel-uek kernels availables for ol6 are:

./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-100.34.1.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-100.35.1.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-100.36.1.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-100.37.1.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-200.16.1.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-200.19.1.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-200.20.1.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-200.23.1.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-300.11.1.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-300.20.1.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-300.21.1.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-300.24.1.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-300.25.1.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-300.27.1.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-300.29.1.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-300.29.2.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-300.3.1.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-300.32.1.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-300.32.2.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-300.32.3.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-300.37.1.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-300.38.1.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-300.39.1.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-300.39.2.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-300.39.4.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-300.39.5.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-300.4.1.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-300.7.1.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-400.26.1.el6uek.x86_64.rpm
./OracleLinux/OL6/latest/x86_64/kernel-uek-2.6.32-400.26.2.el6uek.x86_64.rpm
./OracleLinux/OL6/UEK/latest/x86_64/kernel-uek-2.6.39-100.10.1.el6uek.x86_64.rpm
./OracleLinux/OL6/UEK/latest/x86_64/kernel-uek-2.6.39-100.5.1.el6uek.x86_64.rpm
./OracleLinux/OL6/UEK/latest/x86_64/kernel-uek-2.6.39-100.6.1.el6uek.x86_64.rpm
./OracleLinux/OL6/UEK/latest/x86_64/kernel-uek-2.6.39-100.7.1.el6uek.x86_64.rpm
./OracleLinux/OL6/UEK/latest/x86_64/kernel-uek-2.6.39-200.24.1.el6uek.x86_64.rpm
./OracleLinux/OL6/UEK/latest/x86_64/kernel-uek-2.6.39-200.29.1.el6uek.x86_64.rpm
./OracleLinux/OL6/UEK/latest/x86_64/kernel-uek-2.6.39-200.29.2.el6uek.x86_64.rpm
./OracleLinux/OL6/UEK/latest/x86_64/kernel-uek-2.6.39-200.29.3.el6uek.x86_64.rpm
./OracleLinux/OL6/UEK/latest/x86_64/kernel-uek-2.6.39-200.31.1.el6uek.x86_64.rpm
./OracleLinux/OL6/UEK/latest/x86_64/kernel-uek-2.6.39-200.32.1.el6uek.x86_64.rpm
./OracleLinux/OL6/UEK/latest/x86_64/kernel-uek-2.6.39-200.33.1.el6uek.x86_64.rpm
./OracleLinux/OL6/UEK/latest/x86_64/kernel-uek-2.6.39-200.34.1.el6uek.x86_64.rpm
./OracleLinux/OL6/UEK/latest/x86_64/kernel-uek-2.6.39-300.17.1.el6uek.x86_64.rpm
./OracleLinux/OL6/UEK/latest/x86_64/kernel-uek-2.6.39-300.17.2.el6uek.x86_64.rpm
./OracleLinux/OL6/UEK/latest/x86_64/kernel-uek-2.6.39-300.17.3.el6uek.x86_64.rpm
./OracleLinux/OL6/UEK/latest/x86_64/kernel-uek-2.6.39-300.26.1.el6uek.x86_64.rpm
./OracleLinux/OL6/UEK/latest/x86_64/kernel-uek-2.6.39-300.28.1.el6uek.x86_64.rpm
./OracleLinux/OL6/UEK/latest/x86_64/kernel-uek-2.6.39-400.17.1.el6uek.x86_64.rpm
./OracleLinux/OL6/UEK/latest/x86_64/kernel-uek-2.6.39-400.17.2.el6uek.x86_64.rpm
./OracleLinux/OL6/UEK/latest/x86_64/kernel-uek-2.6.39-400.21.1.el6uek.x86_64.rpm
./OracleLinux/OL6/UEK/latest/x86_64/kernel-uek-2.6.39-400.21.2.el6uek.x86_64.rpm
1010013
Thanks all for you replies. They certainly help.

I do understand that it makes sense to have the latest UEK kernel on any distro. But the reason I wanted a complete table is because we want to make sure our application/driver works on all supported OL/UEK combinations.

For example the default kernel that comes with OL5.8 is 2.6.39-300. But is 2.6.39-100 and 2.6.39-200 also supported on OL5.8. Probably not. But I just wanted to confirm this.

Or can we make an assumption that a particular OL version will support only the default UEK kernel in that version and all the newer UEK versions? But not any of the older UEK versions.

Thanks,
Gopi
Dude!
Like I previously replied, you can check the public repository, e.g.:

http://public-yum.oracle.com/repo/OracleLinux/OL5/UEK/latest/x86_64/

... and you should see that Oracle provides the same UEK kernel versions for OL 5 and OL 6.
Or can we make an assumption that a particular OL version will support only the default UEK kernel in that version and all the newer UEK versions?
Oracle ships with a version of the UEK kernel that has been tested and certified to work with the rest of the OS and Oracle products. You can perhaps and most likely install an older UEK kernel and it should work unless some software requires a feature that is not available. But what would be the practical case or logic behind it to do that?

Oracle provides a compatible kernel Application Binary Interface (kABI) with the UEK kernel. As far as I'm aware and remember being mentioned in this forum in the past: kABI is guaranteed within each 2.6.39-### kernel family.

P.S. This thread should probably be moved to the Oracle Linux forum.

Edited by: Dude on May 21, 2013 1:28 PM
Dude!
Checking on some information.....

Oracle guarantees kABI compatibility for a certain kernel family. For instance:

2.6.32-200.16.1.el5uek
2.6.32-200.19.1.el5uek

The kernel -200 family use an identical kABI.

The 2.6.32-300.10.1.el5uek (-300) uses a different kABI and 3rd party kernel drivers need to be rebuild.

The same applies to the 2.6.39-xxx kernel family:

The -xxx increments if there are quarterly updates with a different kABI. If the kABI remains the same, only the version updates, e.g. -xxx.xx.1

I hope this is correct.
alvaromiranda
Ok, reading your last email that is a driver what you provide.

I ask,

How the end user apply that driver? in a binary form? source code?

If your driver is kernel-version dependant, and you provide a binary rpm file or anything, then you should provide an update version any time oracle realease a new kernel.
if you provide a src version that the client will compile, then, you should test it work on any major versiom, so, when kernel-uek3 came out, if the src version will compile just fine, then you are done or you should provide an updated one.

Alvaro
1010013
You have hit the issue on the nail. Ours is a driver and we release it in binary form.

The various minor releaese of UEK kernels (like 2.6.39-100, 2.6.39-200, etc..) are not kABI compatible and hence we have to compile our driver for each of these versions.

And lets say we have our drivers compiled for 2.6.39-100 UEK version. Theoretically it should work on all versions of OL6 for example. But it was introduced in OL6.2, i think. And lets say OL6.4 comes with 2.6.39-300 kernel by default. So my doubt is whether to qualify my driver (built for 2.6.39-100) on OL6.4 also after installing UEK 2.6.39-100 on it. Hope this makes sense.

This is the reason why I am looking for a table that lists all OL versions and the UEK versions supported on each of them. That way it will make my life that more simpler because then I would know which combinations I need to qualify my driver. But for some reason, Oracle doesnt publish this table.

Thanks,
Gopi
Dude!
You can check the release notes to find out which version ships with each release:
For instance: https://oss.oracle.com/el6/docs/RELEASE-NOTES-U4-en

Oracle Linux 6 Update 4 ships with two sets of kernel packages:
* Unbreakable Enterprise Kernel Release 2 (kernel-uek-2.6.39-400.17.1.el6uek)
* Red Hat Compatible Kernel (kernel-2.6.32-358.el6)

Creating a list from all Oracle releases shouldn't be too much effort. Then to find out which updates are available, simply browse the "latest" repository channels. There will naturally be updates and you will need to recompile your driver if the -xxx kernel family changes. Sorry, all of this was already mentioned.

I would not install a kernel version that is older than the version shipped to meet your driver requirements. Can you not update your system as kernel updates appear and recompile the driver? Or install virtual machines with all the different kernel versions and recompile your driver?

Would it not be sufficient to provide the object code of your driver so people can relink the driver when required?
alvaromiranda
From a sysadmin stand point, I think you are going the other way around.

Let me explain.

The OL6 distribution, is just one. OL6, major number 6.

When the GA (General availability came out), we will say the vendor pack a bunch of files with versions, call it GA or 6.0 and ship.

Then, it start to release updates

At some point, they decide to pack again and release 6.1, then 6.2, then 6.3, then 6.4

From a system that is already installed, and say I am very keen to patch and I do patch daily, my 6.0 at some point will become 6.1, and at some point will get a kernel higher than the one included in the 6.1 dvd.. then at some point will become 6.2, etc.. you get the idea..

so for your application, what you need to do, is tell the sysadmin, to please check your site before updating the kernel, to ensure your driver for that particular kernel have been released or not..

For what kernel version came included on the release of a give 6.x you can check find the kernel and kernel-uek included in the iso, and do it your self, but bear in mind, that a proactive sysadmin will be at some point on the latest available one.

If your costumer are paying top dollar, say ol support with ksplice, that patch on memory the running kernel, and don't change the rpm kernel running, will patch the specific code affected by a patch only.

Hope this helps.
1 - 11
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 1 2009
Added on Aug 26 2009
32 comments
3,628 views