Install the following packages:
- monodevelop
- monodoc-browser (for MonoDevelop Help)
- monodevelop-debugger-mdb (To enable MonoDevelop Debugger)
- mono-devel
- gtk-sharp2
2010年9月3日星期五
2010年8月29日星期日
min3d Sample Project Study Notes
1. According to the content of "AndroidMainfest.xml", the startup activity is "SplashActivity".
2. The relationships between list items and the activities are:
"Hello, Jupiter" ---> ExampleRotatingPlanets
"Minimal example" ---> ExampleMostMinimal
"Vertex colors" ---> ExampleVertexColors
"Texture" ---> ExampleTextures
"Usage of Vertices class" ---> ExampleVerticesVariations
"Triangles, lines, points" ---> ExampleRenderType
"Camera, frustum (trackball)" ---> ExampleCamera
"Multiple lights" ---> ExampleMultipleLights
"Animating vertices" ---> ExampleAnimatingVertices
"Rendering subset of faces" ---> ExampleSubsetOfFaces
"Assigning textures dynamically" ---> ExampleAssigningTexturesDynamically
"MIP Mapping (on vs. off)" ---> ExampleMipMap
"Texture wrapping" ---> ExampleTextureWrap
"Multiple textures" ---> ExampleMultiTexture
"Texture offset" ---> ExampleTextureOffset
"3D inside layout" --> ExampleInsideLayout
"Load model from .obj file" ---> ExampleLoadObjFile
"Load multiple models from .obj file" ---> ExampleObjFileMultiple
"Load model from .3ds file" ---> ExampleLoad3DSFile
"Load animated .md2 file" ---> ExampleLoadMD2File
"Keyframe animation" ---> ExampleKeyframeAnimation
3. To create a min3d based activity, we have to create a activity class that is derived from RendererActivity class:
public class xxxxx extends RendererActivity.
Then we have to override initScene() and updateScene() functions.
4.1 Library source codes note:
4.1 Functions initScene() and updateScene() are declared in ISceneController interface class (interfaces/ISceneController.java)
4.2 When class RendererActivity (core/RendererActivity.java) is created, it will:
- Save current context to the STATIC class Shared (Shared.java)
- Create a scene object (core/Scene.java) (See 4.3 for more information)
- Create a renderer object (core/Renderer.java) for Android OpenGL surface and save the renderer to the STATIC class Shared.
- Assign the renderer object to the OpenGL surface
- Set render mode to RENDERMODE_CONTINUOUSLY.
4.3 When scene object is created, it will:
- Save the ISceneController Interface class so that it can call the overrided initScene() and updateScene() functions.
- Create a ManagedLightList object (core/ManagedLightList.java) for OpenGL light objects
4.4 The renderer object controls the FINAL output for a OpenGL surface. (More information can be found from Android development documents and other Android OpenGL tutorials) It is a good point to study how min3d displays 3D objects on the screen.
A renderer object has three important functions:
- onSurfaceCreated
- onSurfaceChanged
- onDrawFrame
And onDrawFrame() will be called frequently to update the scrren. (I.e. It is the critical part for performance...)
4.5 When the renderer object is created, it will:
- Save the created scene object to the variable _scene for later use
- Create two scratch buffers (one for Int and another for float (not used yet))
- Create TextureManager (core/TextureManager.java) and save it to the STATIC class Shared (textureManager will delete all existing textures in its list. See reset() of TextureManager class)
- Create other objects for doFps() function. (For statistic)
4.6 When OpenGL surface is created (onSurfaceCreated() is called), it will:
- Make use of a STATIC RenderCaps class (core/RenderCaps.java) to get the OpenGL capability
- save the current GL10 object for internal function use
- Do some initialization (reset())
- Initialize scene object (See 4.7 for more information)
4.7 When init() of scene object is called, it will:
- It will clear all attached Object3d objects (core/Object3d.java)
- Create a CameraVo Object (vos/CameraVo,java)
- Create a background color (vos/Color4Managed.java)
- Enable lighting flag
- Call the override initScene() function (which is defined in your Activity class)
4.8 When a Color4Managed object works as a Color4 object:
- Initialize internal r,g,b,a and float buffer.
- When any r,g,b,a is changed, dirty flag is set
- IDirtyParent parent is not used so onDirty() of scene object is no use
4.9 CameraVo object just setup some Numer3d objects (vos/Number3d.java) and a FrustumManaged object (vos/FrustumManaged.java) for public access.
4.10 Therefore, when the override initScene() function is called,
- You can access the STATIC Shared class to get:
- the scene object to add Object3d objects and/or light objects (vos/Light.java) (see 4.2 and 4.3)
- the TextureManager object (see 4.5) to add textures
- You can access the RenderCaps object (see 4.6) to get OpenGL capability
- Also, some default settings are set (see 4.2, 4.5 and 4.7)
2. The relationships between list items and the activities are:
"Hello, Jupiter" ---> ExampleRotatingPlanets
"Minimal example" ---> ExampleMostMinimal
"Vertex colors" ---> ExampleVertexColors
"Texture" ---> ExampleTextures
"Usage of Vertices class" ---> ExampleVerticesVariations
"Triangles, lines, points" ---> ExampleRenderType
"Camera, frustum (trackball)" ---> ExampleCamera
"Multiple lights" ---> ExampleMultipleLights
"Animating vertices" ---> ExampleAnimatingVertices
"Rendering subset of faces" ---> ExampleSubsetOfFaces
"Assigning textures dynamically" ---> ExampleAssigningTexturesDynamically
"MIP Mapping (on vs. off)" ---> ExampleMipMap
"Texture wrapping" ---> ExampleTextureWrap
"Multiple textures" ---> ExampleMultiTexture
"Texture offset" ---> ExampleTextureOffset
"3D inside layout" --> ExampleInsideLayout
"Load model from .obj file" ---> ExampleLoadObjFile
"Load multiple models from .obj file" ---> ExampleObjFileMultiple
"Load model from .3ds file" ---> ExampleLoad3DSFile
"Load animated .md2 file" ---> ExampleLoadMD2File
"Keyframe animation" ---> ExampleKeyframeAnimation
3. To create a min3d based activity, we have to create a activity class that is derived from RendererActivity class:
public class xxxxx extends RendererActivity.
Then we have to override initScene() and updateScene() functions.
4.1 Library source codes note:
4.1 Functions initScene() and updateScene() are declared in ISceneController interface class (interfaces/ISceneController.java)
4.2 When class RendererActivity (core/RendererActivity.java) is created, it will:
- Save current context to the STATIC class Shared (Shared.java)
- Create a scene object (core/Scene.java) (See 4.3 for more information)
- Create a renderer object (core/Renderer.java) for Android OpenGL surface and save the renderer to the STATIC class Shared.
- Assign the renderer object to the OpenGL surface
- Set render mode to RENDERMODE_CONTINUOUSLY.
4.3 When scene object is created, it will:
- Save the ISceneController Interface class so that it can call the overrided initScene() and updateScene() functions.
- Create a ManagedLightList object (core/ManagedLightList.java) for OpenGL light objects
4.4 The renderer object controls the FINAL output for a OpenGL surface. (More information can be found from Android development documents and other Android OpenGL tutorials) It is a good point to study how min3d displays 3D objects on the screen.
A renderer object has three important functions:
- onSurfaceCreated
- onSurfaceChanged
- onDrawFrame
And onDrawFrame() will be called frequently to update the scrren. (I.e. It is the critical part for performance...)
4.5 When the renderer object is created, it will:
- Save the created scene object to the variable _scene for later use
- Create two scratch buffers (one for Int and another for float (not used yet))
- Create TextureManager (core/TextureManager.java) and save it to the STATIC class Shared (textureManager will delete all existing textures in its list. See reset() of TextureManager class)
- Create other objects for doFps() function. (For statistic)
4.6 When OpenGL surface is created (onSurfaceCreated() is called), it will:
- Make use of a STATIC RenderCaps class (core/RenderCaps.java) to get the OpenGL capability
- save the current GL10 object for internal function use
- Do some initialization (reset())
- Initialize scene object (See 4.7 for more information)
4.7 When init() of scene object is called, it will:
- It will clear all attached Object3d objects (core/Object3d.java)
- Create a CameraVo Object (vos/CameraVo,java)
- Create a background color (vos/Color4Managed.java)
- Enable lighting flag
- Call the override initScene() function (which is defined in your Activity class)
4.8 When a Color4Managed object works as a Color4 object:
- Initialize internal r,g,b,a and float buffer.
- When any r,g,b,a is changed, dirty flag is set
- IDirtyParent parent is not used so onDirty() of scene object is no use
4.9 CameraVo object just setup some Numer3d objects (vos/Number3d.java) and a FrustumManaged object (vos/FrustumManaged.java) for public access.
4.10 Therefore, when the override initScene() function is called,
- You can access the STATIC Shared class to get:
- the scene object to add Object3d objects and/or light objects (vos/Light.java) (see 4.2 and 4.3)
- the TextureManager object (see 4.5) to add textures
- You can access the RenderCaps object (see 4.6) to get OpenGL capability
- Also, some default settings are set (see 4.2, 4.5 and 4.7)
2010年8月14日星期六
How to build min3d source codes
1. Download source codes from Google code SVN server to your local folder (e.g. min3d)
Suppose Eclipse (Helios Release) and ADT 0.9.7 will be used.
2. In Eclipse, select "File --> Import...", then select "Existing Projects into Workspace", and then click "Next"
3. Set "Select root directory" to your local min3d folder (e.g. min3d) and then you can see "min3dSampleProject1" in the "Project list". Select "Copyprojects into workspace" and click "Finish".
4. Now, we have to change some configurations:
4.1 Under "min3dSampleProject1", select "src_min3d" and select "Properties" from the pop-up menu (Click your left mouse button)
4.2 Under "Resource" item, set the "location" to/src (e.g. min3d/src) and then click "Apply".
4.3 Select "min3dSampleProject1" again and select "Properties" from the pop-up menu. Select "Android" and then select which Android Paltform you want to use and then click "Apply".
4.4 Then select "Java Build Path", select "Libraries" tag and then remove "src...." item, then click "OK".
5. Now Eclipse should build the sample project automatically.
Suppose Eclipse (Helios Release) and ADT 0.9.7 will be used.
2. In Eclipse, select "File --> Import...", then select "Existing Projects into Workspace", and then click "Next"
3. Set "Select root directory" to your local min3d folder (e.g. min3d) and then you can see "min3dSampleProject1" in the "Project list". Select "Copyprojects into workspace" and click "Finish".
4. Now, we have to change some configurations:
4.1 Under "min3dSampleProject1", select "src_min3d" and select "Properties" from the pop-up menu (Click your left mouse button)
4.2 Under "Resource" item, set the "location" to
4.3 Select "min3dSampleProject1" again and select "Properties" from the pop-up menu. Select "Android" and then select which Android Paltform you want to use and then click "Apply".
4.4 Then select "Java Build Path", select "Libraries" tag and then remove "src...." item, then click "OK".
5. Now Eclipse should build the sample project automatically.
2010年7月5日星期一
How to use NDK and Eclipse to setup and build a Android JNI project under Ubuntu 10.04
How to use NDK and Eclipse to setup and build a Android JNI project under Ubuntu 10.04
Assume the following software are installed:
- Eclipse 3.5.1
- Android SDK (version 8)
- ADT 0.9.7
- Android NDK r4
1. Use Eclipse and ADT to create a Android project. Remember to set a right min. version for your project.
More information can be found from Android SDK document, Android NDK section.
2. Declare your native functions and load library functions.
Here is a simple example:
In ActivityMain.java file, I wrote:
package com.xxx.TestJNI;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
public class ActivityMain extends Activity {
private static final String TAG = "TestJNI:ActivityMain";
// Declare native functions
public native String getString();
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
Log.d(TAG, "OnCreate >>>>>");
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Log.d(TAG, "String from native library = " + getString());
Log.d(TAG, "OnCreate <<<<<");
}
// load native library
static {
System.loadLibrary("jnitest");
}
}
If "Project-->Build Automatically" option is enabled, Eclipse will generate the corresponding class file in the {bin} folder.
You can find the class file in {project}/bin/{package}/
3. Create {jni} folder under your project folder. I.e. mkdir {project}/jni
4. Create JNI header file:
Type the following command:
javah -classpath {project}/bin -d {project}/jni/ {full package name}.{class name}
For example:
javah -classpath workspace/TestJNI/bin -d workspace/TestJNI/jni/ com.xxx.TestJNI.ActivityMain
where "com.xxx.TestJNI" is the full package name and "ActivityMain" is the class name.
Then you should find a header file in the {jni} folder.
5. Create the corresponding C/C++ file in the {jni} folder and write your codes.
For example:
In the C++ file (com_xxx_TestJNI_ActivityMain.cpp), I wrote:
#include "com_xxx_TestJNI_ActivityMain.h"
// we want to use android logging functions such that we can use Logcat for debugging
#include <android/log.h>
#define TAG "TestJNI:jnitest"
// this function will be called when the library is loaded
jint JNI_OnLoad(JavaVM *vm, void *reserved) {
// we want to use JDK/JRE 1.4 functions so we will return JNI 1.4 version to JAVA VM
// Otherwise, JAVA VM assumes we want to use JDK/JRE 1.1 functions
// More information can be found from JAVA Native Interface Specification (In the JDK documentation)
JNIEnv *env = 0;
jint result = -1;
__android_log_print(ANDROID_LOG_DEBUG, TAG, "On Load...");
if(vm->GetEnv((void**)&env, JNI_VERSION_1_4) != JNI_OK) {
__android_log_print(ANDROID_LOG_WARN, TAG, "JNI 1.4 is not supported!");
return result;
}
result = JNI_VERSION_1_4;
return result;
}
JNIEXPORT jstring JNICALL Java_com_xxx_TestJNI_ActivityMain_getString(JNIEnv *env, jobject obj) {
__android_log_print(ANDROID_LOG_DEBUG, TAG, "Create and return String object");
return env->NewStringUTF("Hello native world");
}
Here, we can see that I use "env->NewStringUTF("Hello native world")" to create a String object.
However, if your source file is C, then you have to change the line to "(*env)->NewStringUTF(env, "Hello native world")".
You can find more information from {NDK}/build/platforms/android-(X)/arch-arm/usr/include/jni.h.
(X) = the selected android system version.
In fact, you can search all functions which can be used from {NDK}/build/platforms/android-(X)/arch-arm/usr/include/.
Also, you can read {NDK}/docs/STABLE-APIS.TXT for a quick reference.
For JNI programming, please read JDK 6 Documentation, Java Native Interface section.
6. Create a Make file (Android.mk) in {project}/jni:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := jnitest
LOCAL_SRC_FILES := com_xxx_TestJNI_ActivityMain.cpp
LOCAL_LDLIBS := -llog
include $(BUILD_SHARED_LIBRARY)
For the module name (LOCAL_MODULE), it should be as same as what you use for the System.loadLibrary() call in your JAVA source file.
For more information about Make file, please read {NDK}/docs/OVERVIEW.TXT and {NDK}/docs/ANDROID-MK.TXT
7. Build the native shared library.
Type the following commands:
cd {project}
{NDK}/ndk-build -B V=1
For more information about build process, please read {NDK}/docs/OVERVIEW.TXT and {NDK}/docs/NDK-BUILD.TXT
8. Rebuild your android project
Suppose the native library was built successfully, in Eclipse, select "Project-->Clean..." and then Eclipse will rebuild the project again.
Now, you can use DDMS, Logcat and software simulator/hardware to test your application.
Assume the following software are installed:
- Eclipse 3.5.1
- Android SDK (version 8)
- ADT 0.9.7
- Android NDK r4
1. Use Eclipse and ADT to create a Android project. Remember to set a right min. version for your project.
More information can be found from Android SDK document, Android NDK section.
2. Declare your native functions and load library functions.
Here is a simple example:
In ActivityMain.java file, I wrote:
package com.xxx.TestJNI;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
public class ActivityMain extends Activity {
private static final String TAG = "TestJNI:ActivityMain";
// Declare native functions
public native String getString();
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
Log.d(TAG, "OnCreate >>>>>");
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Log.d(TAG, "String from native library = " + getString());
Log.d(TAG, "OnCreate <<<<<");
}
// load native library
static {
System.loadLibrary("jnitest");
}
}
If "Project-->Build Automatically" option is enabled, Eclipse will generate the corresponding class file in the {bin} folder.
You can find the class file in {project}/bin/{package}/
3. Create {jni} folder under your project folder. I.e. mkdir {project}/jni
4. Create JNI header file:
Type the following command:
javah -classpath {project}/bin -d {project}/jni/ {full package name}.{class name}
For example:
javah -classpath workspace/TestJNI/bin -d workspace/TestJNI/jni/ com.xxx.TestJNI.ActivityMain
where "com.xxx.TestJNI" is the full package name and "ActivityMain" is the class name.
Then you should find a header file in the {jni} folder.
5. Create the corresponding C/C++ file in the {jni} folder and write your codes.
For example:
In the C++ file (com_xxx_TestJNI_ActivityMain.cpp), I wrote:
#include "com_xxx_TestJNI_ActivityMain.h"
// we want to use android logging functions such that we can use Logcat for debugging
#include <android/log.h>
#define TAG "TestJNI:jnitest"
// this function will be called when the library is loaded
jint JNI_OnLoad(JavaVM *vm, void *reserved) {
// we want to use JDK/JRE 1.4 functions so we will return JNI 1.4 version to JAVA VM
// Otherwise, JAVA VM assumes we want to use JDK/JRE 1.1 functions
// More information can be found from JAVA Native Interface Specification (In the JDK documentation)
JNIEnv *env = 0;
jint result = -1;
__android_log_print(ANDROID_LOG_DEBUG, TAG, "On Load...");
if(vm->GetEnv((void**)&env, JNI_VERSION_1_4) != JNI_OK) {
__android_log_print(ANDROID_LOG_WARN, TAG, "JNI 1.4 is not supported!");
return result;
}
result = JNI_VERSION_1_4;
return result;
}
JNIEXPORT jstring JNICALL Java_com_xxx_TestJNI_ActivityMain_getString(JNIEnv *env, jobject obj) {
__android_log_print(ANDROID_LOG_DEBUG, TAG, "Create and return String object");
return env->NewStringUTF("Hello native world");
}
Here, we can see that I use "env->NewStringUTF("Hello native world")" to create a String object.
However, if your source file is C, then you have to change the line to "(*env)->NewStringUTF(env, "Hello native world")".
You can find more information from {NDK}/build/platforms/android-(X)/arch-arm/usr/include/jni.h.
(X) = the selected android system version.
In fact, you can search all functions which can be used from {NDK}/build/platforms/android-(X)/arch-arm/usr/include/.
Also, you can read {NDK}/docs/STABLE-APIS.TXT for a quick reference.
For JNI programming, please read JDK 6 Documentation, Java Native Interface section.
6. Create a Make file (Android.mk) in {project}/jni:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := jnitest
LOCAL_SRC_FILES := com_xxx_TestJNI_ActivityMain.cpp
LOCAL_LDLIBS := -llog
include $(BUILD_SHARED_LIBRARY)
For the module name (LOCAL_MODULE), it should be as same as what you use for the System.loadLibrary() call in your JAVA source file.
For more information about Make file, please read {NDK}/docs/OVERVIEW.TXT and {NDK}/docs/ANDROID-MK.TXT
7. Build the native shared library.
Type the following commands:
cd {project}
{NDK}/ndk-build -B V=1
For more information about build process, please read {NDK}/docs/OVERVIEW.TXT and {NDK}/docs/NDK-BUILD.TXT
8. Rebuild your android project
Suppose the native library was built successfully, in Eclipse, select "Project-->Clean..." and then Eclipse will rebuild the project again.
Now, you can use DDMS, Logcat and software simulator/hardware to test your application.
2010年7月4日星期日
Setup QEMU under Ubuntu 8.04
1. Install QEMU package
2. Setup network bridge
2.1 install uml-utilities and bridge-utils package
2.2 setup bridge configuration:
In /etc/network/interfaces file, add the following lines:
iface br0 inet dhcp
bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off
auto br0
2.3 Disable Ubuntu roaming function for eth0
In the terminal, type network-admin. And then set eth0 to use "Static IP address".
Assign IP, subnet mask and gateway to eth0. After that, you should see the setting in /etc/network/interfaces file.
For example:
iface eth0 inet static
address 192.168.1.100
netmask 255.255.0.0
gateway 192.168.1.254
auto eth0
Then edit /etc/network/interfaces file to comment the line "auto eth0":
#auto eth0
2.4
Since we want to add default gateway to the bridge interface,
we can create a shell script in the /etc/network/if-up.d folder:
#! /bin/sh
#Not for loopback!
if [ "$IFACE" != "lo" ]; then
/sbin/route add -host 192.168.251.1 gw 192.168.252.254 dev $IFACE
fi
In the above script, route will be ran for each interface when network service is started.
You can adjust it to fit your situation.
3. Prepare qemu script for network bridge
In /etc/qemu-ifup file, add the following lines:
echo "Executing /etc/qemu-ifup"
echo "Bringing up $1 for bridged mode..."
sudo /sbin/ifconfig $1 0.0.0.0 promisc up
echo "Adding $1 to br0..."
sudo /usr/sbin/brctl addif br0 $1
sleep 2
4. Restart network service
sudo /etc/init.d/network restart
Normally, there is no IP for eth0 and br0 has a IP address.
5. Prepare system disk image
6. run Qemu
use qemu command to start the simulation. For example:
sudo qemu -hda sysimage.img -net nic,model=rtl8139 -net tap -serial /dev/ttyS0
-hda sysimage.img = the disk image (sysimage.img) is mapped to hda
-net,model=rtl8139 = use rtl8139 network card for the simulator (input)
-net tap = use TAP/TUN dirver (output), this dirver is already connected to the network bridge
-serial /dev/ttyS0 = enable serial port emulation and map guest's serial port to the host's port (/dev/ttyS0)
7. You can use "ping" command to check the network connection.
If the guest Linux system cannot detect the serial port, we can use "modprobe 8250" command and then you see the following output:
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16450
That means qemu will use 16450 chip set to emulate serial port for the guest linux system.
2. Setup network bridge
2.1 install uml-utilities and bridge-utils package
2.2 setup bridge configuration:
In /etc/network/interfaces file, add the following lines:
iface br0 inet dhcp
bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off
auto br0
2.3 Disable Ubuntu roaming function for eth0
In the terminal, type network-admin. And then set eth0 to use "Static IP address".
Assign IP, subnet mask and gateway to eth0. After that, you should see the setting in /etc/network/interfaces file.
For example:
iface eth0 inet static
address 192.168.1.100
netmask 255.255.0.0
gateway 192.168.1.254
auto eth0
Then edit /etc/network/interfaces file to comment the line "auto eth0":
#auto eth0
2.4
Since we want to add default gateway to the bridge interface,
we can create a shell script in the /etc/network/if-up.d folder:
#! /bin/sh
#Not for loopback!
if [ "$IFACE" != "lo" ]; then
/sbin/route add -host 192.168.251.1 gw 192.168.252.254 dev $IFACE
fi
In the above script, route will be ran for each interface when network service is started.
You can adjust it to fit your situation.
3. Prepare qemu script for network bridge
In /etc/qemu-ifup file, add the following lines:
echo "Executing /etc/qemu-ifup"
echo "Bringing up $1 for bridged mode..."
sudo /sbin/ifconfig $1 0.0.0.0 promisc up
echo "Adding $1 to br0..."
sudo /usr/sbin/brctl addif br0 $1
sleep 2
4. Restart network service
sudo /etc/init.d/network restart
Normally, there is no IP for eth0 and br0 has a IP address.
5. Prepare system disk image
6. run Qemu
use qemu command to start the simulation. For example:
sudo qemu -hda sysimage.img -net nic,model=rtl8139 -net tap -serial /dev/ttyS0
-hda sysimage.img = the disk image (sysimage.img) is mapped to hda
-net,model=rtl8139 = use rtl8139 network card for the simulator (input)
-net tap = use TAP/TUN dirver (output), this dirver is already connected to the network bridge
-serial /dev/ttyS0 = enable serial port emulation and map guest's serial port to the host's port (/dev/ttyS0)
7. You can use "ping" command to check the network connection.
If the guest Linux system cannot detect the serial port, we can use "modprobe 8250" command and then you see the following output:
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16450
That means qemu will use 16450 chip set to emulate serial port for the guest linux system.
2010年7月3日星期六
Netbeans 有關 PHP Debug 設定
如果不想在 Debug PHP 的過程中每次進入新的 PHP 頁時停下來,我們可以在 Options-->PHP-->General 中不選擇 Stop at First Line 就可以了.
2009年9月13日星期日
How to setup Netbeans 6.7 PHP debug environment in Ubuntu 8.04
1. Enable personal HTTP directory
1.1 use sudo command to create two symbolic links in /etc/apache2/mod-enabled directory:
sudo ln -s ../mods-available/userdir.conf userdir.conf
sudo ln -s ../mods-available/userdir.load userdir.load
1.2 create HTTP directory in the user's home directory:
makedir public_html
1.3 restart apache web server
sudo /etc/init.d/apache2 restart
1.4 test personal HTTP directory
use web browser to browse http://localhost/~[username]/
2. Enable xdebug
2.1 install xdebug DEB package
2.2 add the following lines in /etc/php5/apache2/php.ini:
zend_extension=xdebug.so
xdebug.remote_enable=on
3. Setup Netbeans PHP project
3.1 enable "copy files from sources folder to another location" and set the folder to user HTTP directory
3.2 in "run Configuration" page, set "Project URL" to user HTTP directory
1.1 use sudo command to create two symbolic links in /etc/apache2/mod-enabled directory:
sudo ln -s ../mods-available/userdir.conf userdir.conf
sudo ln -s ../mods-available/userdir.load userdir.load
1.2 create HTTP directory in the user's home directory:
makedir public_html
1.3 restart apache web server
sudo /etc/init.d/apache2 restart
1.4 test personal HTTP directory
use web browser to browse http://localhost/~[username]/
2. Enable xdebug
2.1 install xdebug DEB package
2.2 add the following lines in /etc/php5/apache2/php.ini:
zend_extension=xdebug.so
xdebug.remote_enable=on
3. Setup Netbeans PHP project
3.1 enable "copy files from sources folder to another location" and set the folder to user HTTP directory
3.2 in "run Configuration" page, set "Project URL" to user HTTP directory
訂閱:
文章 (Atom)