Use Java on VxWorks

Source: Internet
Author: User

Sender: shengb (Tianji qihong), email area: embedded
Question: use Java on VxWorks [1]
Mailing site: BBS shuimu Tsinghua station (Mon Jul 22 08:51:50 2002)

I was idle for the last two days and wanted to compile a Java program on VxWorks for fun. So I got a discount on Sun's j2s.
Finally, we can see the cute "Hello World" on VxWorks ".

1. Introduction
Java platforms include standard, enterprise, and micro. Micro version, also known,
It is specially designed for use as a Java Development Platform by mobile devices with low memory capacity and low processing capability.
However, because mobile devices have a wide range of coverage and different hardware configurations
It is unlikely that a universal development platform will be provided for all mobile devices. Therefore, two types
Specifications, deployments, and profiles.
1.1 Configuration
By abstracting the configuration, J2EE processes a large number of hardware functions of different mobile devices. J2EE
Configuration defines virtual machines and low-level APIs available for specific devices, and provides corresponding development basics. Contents
There are two available configuration types, that is, connection device configuration CDC (connected device configuration)
) And connect the limited device to configure cldc (connected limited device configuration ).
1.1.1 Connection Device Configuration
CDC is applied to mobile devices with relatively large memory and powerful processor capabilities. The CDC specification uses memory optimization
The Virtual Machine (CVM) provides equivalent features of the standard JVM. According to Sun's instructions,
CDC targets high-end devices such as new PDAs, smart communication devices, and set-top boxes. To be supported by CDC, mobile
The device must meet at least the following conditions:
2 MB memory for CVM and Java API library.
32-bit microprocessor or controller.
Available network connection, preferably high bandwidth connection.
1.1.2 link limited Device Configuration
CDC requirements favor expensive mobile phones, IR scanners, or similar products. Cldc focuses on lighter
Cost-effective devices that cannot meet the CDC requirements.
Cldc uses a lightweight virtual machine designed to run in a low memory environment. The reference implementation of this JVM is also
It is the so-called KVM. The virtual machine size is measured in kilobytes. The cldc device requirements are as follows:
The minimum memory size is kb, of which KB is used for KVM and runtime libraries.
Minimum 16-bit 25-mhz Processor
Limited User interface functions
No (or intermittent) low-bandwidth network connection
Due to the strict memory capacity limit, KVM lacks some features provided by the complete JVM. That is to say,
At such a low memory requirement, KVM has to deal with floating point mathematical computing, response, and finalizers class support.
Performance compromise. After compiling a program, cldc developers must use one provided by
Checks their source code.
1.2 Profile
If the configuration provides the foundation for the application, the profile provides the application framework. Profile
Defines a complete set of available API classes for the J2EE application and is created specifically for the given configuration. Sun introduces two available
For more information, see <G id = "1"> </G>.
Mation device profile ).
Basic profile is mainly used for CDC configuration, so its virtual machine is almost equivalent to a standard virtual machine. This means that,
Developers using the basic profile must access the fully implemented j2se feature set.
Together with the low-function cldc configuration, MIDP provides the most possible use for developing today's mobile device applications.
To the Java platform. MIDP supports a limited subset of j2se class libraries and defines custom users for cldc configurations.
Interface and input/output class.
Generally, j2se code can be run using CDC and basic profile without having to or rarely modify. However
The host hardware is limited. cldc and MIDP profile only provide a limited set of functions. Therefore, the j2se Application
The sequence is unlikely to run on such platforms without modification, unless it limits itself
API intersection (severely restricting its functionality ). Because the cldc requirements correspond to the functions of most handheld devices today
Yes, so any j2se application often needs to be modified to run on a given device.
Sun's j2's support for two embedded systems: Embedded Linux and Wind River's Vxworks real-time system
System.

Top

Tonkeycn (I un known...) on the 7th floor ...)The score is 0 at 17:30:56.

Sender: shengb (Tianji qihong), email area: embedded
Question: use Java on VxWorks [2]
Mailing site: BBS shuimu Tsinghua station (Mon Jul 22 09:14:26 2002)

J2mesoftware j2me_cdc-1090-fcs-src-ar-22_jan_2001.zip, which is included in the package
Vxworks5.4 Pentium BSP, the network card used is 3Com 10/100 pci nic (3c90x)
Host environment:
(1) Java 2 SDK, Se, v1.3 or update
(2) Tornado 2.0 Development System
(3) Solaris 7 OS or update
(4) iSCSI hardware
(5) 128 mb ram (256 MB recommended)
Target machine environment:
(1) Pentium hardware
(2) VxWorks 5.4 OS
(3) At least 32 MB RAM

Note:
(1) The sysel3c90xend. c driver provided by j2-cdc has many undefined macros during compilation. Therefore, we recommend that you
Replace tornado II;
(2) There is no simnt directory under $ wind_base/target/h/ARCH/under Solaris 7 OS, but in the file
Some files in this directory are used. Therefore, we recommend that you copy one file from the PC to this directory.
(3) we recommend that you use gnumake for make compilation, and the version must be at least 3.74. You can also use
Make.
(4) the target host is recommended to be in the same network.



Sender: shengb (Tianji qihong), email area: embedded
Question: use Java on VxWorks [3]
Mailing site: BBS shuimu Tsinghua station (Mon Jul 22 09:29:25 2002)

Preparations before Compilation:
(1)uncompress j2me_cdc-1_0-fcs-src-ar-22_jan_2001.zip, assume it is
(2) EDIT $ j2-dffoundation/build/VxWorks/config_vxworks.mk and set the environment to change
Quantity:
Target IP Address
Host IP Address
Host Name
Base directory for tornado software (wind_base)
(3) modify the j2sdk environment variable and point it to the location of j2sdk on the actual machine.

Compile
(1) type gnumake cvm_debug = true in the $ j2_cvfoundation/build/VxWorks/directory.
(2) After compilation, continue to compile the VxWorks image and type gnumake download_image
After the compilation is complete, go to the PC-boot and PC/Default of $ j2-dffoundation/build/VxWorks/target /.
The VxWorks and VxWorks. sym files are generated in the directory. Only the target code under PC/default that contains CVM
CVM. O. Therefore, you need to download PC/default/VxWorks.
(3) create a boot floppy disk. If the system has started a floppy disk, you can leave it empty.

Start the target machine to download VxWorks
On the target console, go to the $ j2-dffoundation/build/VxWorks/bin directory.
-> SP runjava, "-djava. Class. Path = ../testclasses.zip helloworld"
Then, you can see the cute helloworld. character on the screen.

User Application

(1) javac-bootclasspath = $ j2-dffoundation/build/VxWorks/btclasses.zip/
$ J2-cdfoundation/build/VxWorks/lib/CDC. Jar hello. Java
(2) jar-CF hello. Jar hello. Class
(3) On the target console,
-> SP runjava, "-djava. Class. Path = <appdir>/Hello. Jar hello"
Or in windsh,
-> Runjava, "-djava. Class. Path = <appdir>/Hello. Jar hello"
Haha, I saw "Hello World" again at this time and thought it was cute at this time.
Hello. Java is a common j2se application.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.