2013年12月29日 星期日

Risc-V on Arty A7 35T - scala design cpu & add instruction & jtag debug

The project fit for Arty A7-35T

1.
install Vivado 2019.2.1
run step 5 in http://fatalfeel.blogspot.com/2013/12/chisel-design-ic-for-risc-v.html
gedit /etc/environment
~add path
/opt/Xilinx/Vivado/2019.2/bin

2.
cd $HOME
mkdir -p riscv_cpu
cd $HOME/riscv_cpu
git clone --recursive https://github.com/SpinalHDL/VexRiscv

Risc-V on Ice40HX8K and Ice40UP5K - scala design cpu

1. preinstall
apt install build-essential cmake clang bison flex libreadline-dev gawk tcl-dev libffi-dev git mercurial graphviz xdot pkg-config libftdi-dev qt5-default libboost-all-dev libeigen3-dev

apt install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev texinfo gperf libtool patchutils bc zlib1g-dev git libexpat1-dev

apt install libhidapi-dev libusb-1.0-0-dev

install python3.7 + pip3
refer to http://fatalfeel.blogspot.com/2019/12/ai-with-cuda-install-step-and-yolov3-in.html

Rocket-chip Risc-V core design and debugging in IntelliJ IDE

Refer to:
https://github.com/chipsalliance/rocket-tools/blob/master/README.md
https://github.com/chipsalliance/rocket-chip/blob/master/README.md
https://fatalfeel.blogspot.com/2013/12/chisel-design-ic-for-risc-v.html
https://hardsecurity.github.io/docs/untether-v0.2/figures/pipeline.png

1.
#preinstall
apt install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev libusb-1.0-0-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev device-tree-compiler pkg-config libexpat-dev libfl-dev

2.
#export must add to last line of ~/.bashrc
export RISCV="/opt/riscv"
export ROCKETCHIP="/root/riscv_cpu/rocket-chip"
export MAKEFLAGS="$MAKEFLAGS -j8"

MQL5 auto trading source. (that's why you cannot beat the speed of large exchanges)

/* Do not use this code to trading, some bug inside*/

/*
MQL5 source, this code trade in CFD. Using QQE, EMA, RSI, MACD,
to do buy, sell, close and the other best actions. Length of time is 24 hours.
*/
#property copyright "Copyright 2000-2024, MetaQuotes Ltd."
#property link      "https://www.mql5.com"

#include <Trade\Trade.mqh>
input int     InpQQE_RSI_Period     = 14;            // QQE RSI Period
input double  InpQQE_RSI_Smooth     = 5;             // QQE RSI Smoothing Factor
input double  InpQQE_RSI_REF        = 50;
input int     InpEMA_Period         = 50;                // EMA Period
input int     InpRSI_Period         = 14;                // RSI Period
input int     InpMACD_PeriodFast    = 12;           // MACD Fast Period
input int     InpMACD_PeriodSlow    = 26;           // MACD Slow Period
input int     InpMACD_PeriodSignal  = 9;          // MACD Signal Period
input int     InpATR_Period         = 14;                // ATR Period
input double  InpLotSize            = 0.1;               // Lot Size

Cortex-m33 change modem shutdown time in assembly

When using nrf_modem_shutdown of libmodem.a. It need to wait 48 seconds and leave.
To fix it in assembly source.

///////////////////Trace into nrf_modem_shutdown()///////////////////
<nrf_modem_shutdown>
4B0C
          ldr r3, =0x20019441
B510           push {r4, lr}
781A           ldrb r2, [r3]
B18A           cbz r2, 0x00031464
2400            movs r4, #0
701C           strb r4, [r3]
4B0A           ldr r3, =0x20019442 <operation_mode>
781B           ldrb r3, [r3]
B12B           cbz r3, 0x00031456
2B01           cmp r3, #1
D007           beq 0x0003145E
F7FFFFB1  bl 0x000313B4 <modem_off>
4620            mov r0, r4
BD10           pop {r4, pc}
F000F80D   bl 0x00031474 <nrf_modem_platform_shutdown>
4604            mov r4, r0
E7F7           b 0x0003144E
F7FBFC87  bl 0x0002CD70 <nrfx_ipc_uninit>
E7F4           b 0x0003144E
F04F34FF   mov.w r4, #0xFFFFFFFF
E7F3           b 0x00031452
BF00           nop

2013年12月28日 星期六

Faster-Rcnn in Pytorch with tuberculosis ai detect

Theory:
https://arxiv.org/pdf/1506.01497.pdf
https://lilianweng.github.io/lil-log/2017/12/31/object-recognition-for-dummies-part-3.html
https://zhuanlan.zhihu.com/p/31426458
https://www.lablab.top/post/how-does-faster-r-cnn-work-part-ii

Loss function:
https://blog.csdn.net/qq_34106574/article/details/81669891

Roi align:
https://erdem.pl/2020/02/understanding-region-of-interest-part-2-ro-i-align

Source:
https://github.com/fatalfeel/faster_rcnn_pytorch
https://github.com/fatalfeel/tb_faster_rcnn

Demo:
https://www.mediafire.com/view/c96v330bq1i4hqg/faster-rcnn.png

Chisel design Risc-V cpu

Refer to:
https://github.com/schoeberl/chisel-lab/blob/master/Setup.md
https://com-lihaoyi.github.io/mill/mill/Intro_to_Mill.html
https://github.com/OpenXiangShan/XiangShan

1.
#preinstall
apt install openjdk-8-jdk git make

2.
#install python 3.7:
http://fatalfeel.blogspot.com/2019/12/ai-with-cuda-install-step-and-yolov3-in.html
label: install python 3.7 + pip3 + labelimg + yolov3
Do step 1~9

Hog Pca Svm Slider Nms in C++

Refer to: http://fatalfeel.blogspot.com/2013/12/opencv-and-dlib-training.html

1. Preinstall:
opencv 3.4.16
https://opencv.org/releases
dlib 2022-03-22 21:32:14 sha1: 5cb036564c986fcc45eb16dd0174b1602ceb4f7f
https://github.com/davisking/dlib.git 

both make install to /opt

2. eclipse (option)
sudo apt install openjdk-8-jdk 
Luna Service Release 2 + cdt
https://www.eclipse.org/downloads/packages/release/luna/sr2

run it as root

BackTace caller name in C/C++

1. down binutils and build
~~~binutils 2.25.1 x86_64 & aarch64 both build pass other version may be not~~~
download: https://ftp.gnu.org/gnu/binutils
x86_64
./configure --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=$HOME/binutils-2.25.1/build
make && make install
or
aarch64
./configure --host=x86_64-linux-gnu --target=aarch64-linux-gnu --prefix=$HOME/binutils-2.25.1/build
make && make install

cp -f ~/binutils-2.25.1/build/bin/addr2line [your project path]

2013年12月27日 星期五

Cross Platform NRF9160 Cortex-M33 inter thread communication

Refer to:
https://www.boost.org/doc/libs/1_60_0/doc/html/signals/tutorial.html
http://fatalfeel.blogspot.com/2013/09/how-to-program-send-message-on-corss.html

//header
class EventManager
{
public:

typedef std::vector<EventFunctorBase<EventPack>*> EventMessageSlot_Vector;
typedef std::map<int, EventMessageSlot_Vector> EventMessageSlot_Map; //<message_ID, EventPack_Vector>
static EventManager* Get();
static void Free();
EventManager();
~EventManager();
// event sinks
//void ConnectEventSlot(int messageID, EventFunctorBase<EventPack>* functor);
void ProcessEvent(int type, int messageID, void* callmember, EventPack* event);
void    ConnectEventSlot(int messageID, void* callmember);
void    DisconnectEventSlot(void* callmember);
void    SendEventMessage(EventPack* event);

private:
// event sinks
EventMessageSlot_Map m_EventMessageSlotMap;
};






How to do thread context switch in RTOS

git clone --recursive  https://github.com/FreeRTOS/FreeRTOS

//vector table for a Cortex M3 interrupt
~/FreeRTOS/Demo/CORTEX_STM32F103_Keil/STM32F10x.s
//found
; Vector Table Mapped to Address 0 at Reset
                AREA    RESET, DATA, READONLY
                EXPORT  __Vectors
__Vectors       DCD     __initial_sp              ; Top of Stack
                DCD     Reset_Handler             ; Reset Handler
                DCD     NMI_Handler               ; NMI Handler
                DCD     HardFault_Handler         ; Hard Fault Handler
                DCD     MemManage_Handler         ; MPU Fault Handler
                DCD     BusFault_Handler          ; Bus Fault Handler
                DCD     UsageFault_Handler        ; Usage Fault Handler
                DCD     0                         ; Reserved
                DCD     0                         ; Reserved
                DCD     0                         ; Reserved
                DCD     0                         ; Reserved
                DCD     vPortSVCHandler           ; SVCall Handler
                DCD     DebugMon_Handler          ; Debug Monitor Handler
                DCD     0                         ; Reserved
                DCD     xPortPendSVHandler        ; PendSV Handler
                DCD     xPortSysTickHandler       ; SysTick Handler

2013年12月26日 星期四

8051 OS on µVision V5

1. multitask
in RTX51\project\src\ABS_TASK\absTask.c
~find
void Task_Init() _task_ INIT
~add your talk

2. help you do cpu simulation with peripheral hardware
https://developer.arm.com/documentation/kan145/latest
https://developer.arm.com/documentation/kan154/latest

3. µVision command window
https://www.keil.com/support/man/docs/uv4/uv4_debug_commands.htm
https://www.keil.com/support/man/docs/uv4/uv4_debug_functions.htm

4. keil plugin demo
http://www.neoegm.com/tech/hardware/8051/keil-plugins/keil-uvision-plugin-matrix-keyboard
http://www.neoegm.com/tech/hardware/8051/keil-plugins/how-to-install-a-keil-uvision-peripheral-plugin

How to build 4g LTE base station in very low cost

Refer to:
1. https://cyberloginit.com/2018/05/03/build-a-lte-network-with-srslte-and-program-your-own-usim-card.html
2. https://cloud.tencent.com/developer/article/1684051
3. https://blog.white-alone.com/%E4%BD%BF%E7%94%A8srsLTE%E6%90%AD%E5%BB%BA4G%E5%9F%BA%E7%AB%99%E7%94%A8%E4%BA%8E%E6%97%A5%E5%B8%B8%E6%B5%8B%E8%AF%95/
4. https://www.white-alone.com/%E4%BD%BF%E7%94%A8BladeRF%E6%88%96%E8%80%85B210%E5%BF%AB%E9%80%9F%E6%9E%84%E5%BB%BA4G%20LTE%E6%B5%8B%E8%AF%95%E7%BD%91/
5. https://www.mobibrw.com/2018/10729/comment-page-1

USRP N210 Taobao price 26000 RMB = 4030 US$
https://world.taobao.com/item/530598387626.htm

Some people may think N210 is too expensive.
USRP B210 transparent version 500 RMB = 714 US$
https://item.taobao.com/item.htm?spm=a230r.1.14.30.6ea326b6S8jv4c&id=618435712984

EMNIST handwritten dataset on libtorch c++

Refer to:
https://jovian.ai/goyalbhavya529/emnist-project
https://github.com/austin-hill/EMNIST-CNN
https://discuss.pytorch.org/t/libtorch-how-to-use-torch-datasets-for-custom-dataset/34221
https://github.com/pytorch/examples/blob/main/cpp/custom-dataset/custom-dataset.cpp

1. download emnist label and image
https://www.kaggle.com/datasets/crawford/emnist

2. explain emnist data
###emnist-balanced-train-labels-idx1-ubyte###
[offset]    [type]      [value]                        [description]
0000        32 bits     0x00000801(2049)     magic number     - big endian
0004        32 bits     0x0001b8a0(112800) number of items  - big endian
0008        unsigned    byte   ??                   label
0009        unsigned    byte   ??                   label
....
xxxx        unsigned    byte   ??                   label

labels   = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabdefghnqrt"
classes = 47

###emnist-balanced-train-images-idx3-ubyte###
[offset] [type]              [value]                        [description]
0000     32 bit integer  0x00000803(2051)     magic number          - big endian
0004     32 bit integer  0x0001b8a0(112800) number of images    - big endian
0008     32 bit integer  0x0000001c(28)         number of rows        - big endian
0012     32 bit integer  0x0000001c(28)         number of columns  - big endian
0016     unsigned byte   ??                              pixel
0017     unsigned byte   ??                              pixel
....
xxxx     unsigned byte   ??                              pixel

Pixels are arranged in row-wise 28 x 28 pixels
Pixel value between 0 to 255.
0     = background white.
255 = foreground black.
The original EMNIST images provided are inverted horizontally and rotated 90 anti-clockwise

nrf9160 soft uart - using gpio simulator uart

 static uint32_t get_BitWidth(uint32_t baudrate)
{
  uint32_t bit_width;

  switch( baudrate )
  {
    case 4800:
      bit_width = 0x7c; //123~152 for 4800, for nrf9160
      break;

    case 9600:
      bit_width = 0x68; //104
      break;

2013年12月25日 星期三

Intel arc xpu for pytorch in ubuntu install step

refer to:
1. https://github.com/intel/intel-extension-for-pytorch
2. https://pytorch.org/tutorials/recipes/recipes/intel_extension_for_pytorch.html
3. https://blog.csdn.net/m0_63007797/article/details/136606591

################## install step ##################
1. install xpu driver for arc
https://dgpu-docs.intel.com/driver/client/overview.html
if you buy Flex Series or Max Series try this
https://dgpu-docs.intel.com/driver/installation.html

RK3566 / RK3568 SWD debug

Refer to
http://notes.zahoryzontnik.com/
https://fatalfeel.blogspot.com/2015/12/openocd-with-eclipse-debug-kernel-of.html

1. openocd source download and install
https://github.com/fatalfeel/openocd_integrated
note: site include rk3566.cfg (fit for rk3568 too)

2. bus blaster dangerous prototypes v3c or v4.1a jtag to swd
https://fatalfeel.blogspot.com/2013/09/bus-blaster-flash-to-swd-mode-in-openocd.html

3. hardware dp_busblaster_kt-link connect to swd of rk3568
(a) remove off sdcard connector, or the connector spring will trigger jtag disable
https://www.mediafire.com/view/gljvlwq83nauxbc/sdcard_connector.jpg
(b) swd connect circuit, do not connect any vref like 3.3v or 5.0v
tck  - swclk
tms - swdio
gnd - gnd

Nrf9160 uart port to external pin

ubuntu host PC rs232usb:
nrf9160 target board:

Get log from PC /dev/ttyACM0 change to PC /dev/ttyUSB0
PC Tx ---- target rx p0.00
PC Rx ---- target tx p0.01

Build nrf9160dk projects on Zephyr OS and SEGGER Embedded Studio

Zephyr OS is RTOS - The Application bind with kernel and drivers into a image

##########################Zephyr Project 2.5.99###############################
################for console build projects
################
Refer to:
https://infocenter.nordicsemi.com/pdf/nRF9160_DK_HW_User_Guide_v1.0.pdf
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/getting_started/index.html
http://fatalfeel.blogspot.com/2019/12/ai-with-cuda-install-step-and-yolov3-in.html
https://apt.kitware.com/
https://docs.zephyrproject.org/latest/boards/arm/nrf9160dk_nrf9160/doc/index.html

2013年12月24日 星期二

PPO AI in raycasting game to simulate self driving for saving people's lives

Refer to:
a. https://permadi.com/1996/05/ray-casting-tutorial-1
b. https://raytomely.itch.io/raycasting-floorcasting
c. https://killerrobotics.me/2021/08/13/raycasting-game-in-python-and-pygame-part-1
d. https://www.mediafire.com/file/zo15gqjz5roxzk5/ray_trace_java.tar.gz
e. https://github.com/StanislavPetrovV/3D-Python-game-Raycast
f. https://github.com/jordansavant/doomengine.python
g. https://fatalfeel.blogspot.com/2013/09/build-3d-game-doom1-on-ubuntu-1604.html
h. http://www.peteflorence.com/ReinforcementLearningAutonomousDriving.pdf
i. https://github.com/peteflorence/Machine-Learning-6.867-homework
j. https://www.fatalerrors.org/a/lane-change-detection.html
k. https://github.com/HevLfreis/TrafficLight-Detector
l. https://www.fatalerrors.org/a/lane-change-detection.html
m. https://fatalfeel.blogspot.com/2013/12/ppo-and-awr-guiding.html
n. https://arxiv.org/pdf/1807.10913.pdf
o. https://github.com/lijx10/uwb-localization

Project Idea:
Using doom game simulate LiDAR raycasting. When opencv detect driver eyes closed too long, then switch to PPO AI driving and move to road side slowly.
Each ray is status into PPO actor network and output are left, right, doing nothing.

Source:
https://github.com/fatalfeel/PPO_raycast
because someone use PPO to unmanned combat air vehicle(UVAC) so I decide delete this repository.

Simulation Environment: (3D working)
https://www.mediafire.com/file/8kp1bgq5zvmlj12/raycast_env.py
https://www.mediafire.com/file/naegynukhwxlad7/best_factors.npy

Learn to pay Attention

source:
https://github.com/fatalfeel/LearnToPayAttention

paper:
https://www.robots.ox.ac.uk/~tvg/publications/2018/LearnToPayAttention_v5.pdf

2013年12月22日 星期日

Eclipse AI generate c/c++ java python on Ubuntu/Windows

official source and system minimum require:
Ubuntu 18.04 above because need gtk version >= 3.22
openjdk-11-jdk

patched source and system minimum require:
Ubuntu 16.04
openjdk-8-jdk

~check gtk version
dpkg -l libgtk* | grep -e '^i' | grep -e 'libgtk-*[0-9]'

1.
rm -rf /usr/lib/python3/dist-packages/uaclient
pip3 install opcua-client

2.
sudo apt update
sudo apt install openjdk-11-jdk

Binder on Ubuntu process to process communication

Why binder faster than socket:
Binder copy only needs one time, but pipelines, queues, sockets, D-bus all need two times
https://www.dre.vanderbilt.edu/~schmidt/cs282/PDFs/android-binder-ipc.pdf

Binder include 4 parts:
1. Driver
2. Service Manager
Register service name
3. Server
onTransact receive data from the client
4. Client

2013年12月21日 星期六

Yolov3 to OpenCV C++

Refer to
(1.) https://blog.francium.tech/custom-object-training-and-detection-with-yolov3-darknet-and-opencv-41542f2ff44e
(2.) https://learnopencv.com/training-yolov3-deep-learning-based-custom-object-detector
(3.) https://github.com/pjreddie/darknet/issues/2257
(4.) https://github.com/pjreddie/darknet/issues/1458

Start Training
1.
git clone --recursive https://github.com/pjreddie/darknet

2.
wget https://github.com/arnoldfychen/darknet/blob/master/src/convolutional_layer.c
replace ~/darknet/src/convolutional_layer.c with new one

How WIFI working from kernel to wpa_supplicant

Refer to:
1. http://fatalfeel.blogspot.com/2015/12/openocd-with-eclipse-debug-kernel-of.html
2. http://fatalfeel.blogspot.com/2013/09/debug-android-framework-and-service-in.html
3. https://www.cnblogs.com/mauricewei/p/10502300.html
4. https://zhuanlan.zhihu.com/p/344526925
5. http://www.mediafire.com/file/0adoj9isttdtod4/kernel_imx_aarch64.tar.gz

Kernel debug we  choosing jtag and wpa_supplicant choosing otg

1. rtl8723BU_WiFi module change to build in driver for debugging easier
gedit ~/OK8MM-android/vendor/nxp-opensource/kernel_imx/arch/arm64/configs/android_defconfig
CONFIG_RTL8723BU=m
//change to
CONFIG_RTL8723BU=y

2. cancel depmod module load in android
gedit ~/OK8MM-android/device/fsl/imx8m/evk_8mm/BoardConfig.mk
BOARD_VENDOR_KERNEL_MODULES += $(KERNEL_OUT)/drivers/net/wireless/realtek/rtl8723BU_WiFi/8723bu.ko
//comment to
# BOARD_VENDOR_KERNEL_MODULES += $(KERNEL_OUT)/drivers/net/wireless/realtek/rtl8723BU_WiFi/8723bu.ko

2013年12月20日 星期五

Build and debug ipmitool for mingw64 on linux

Refer to: https://tecadmin.net/install-wine-on-ubuntu

1.
echo 'deb http://us.archive.ubuntu.com/ubuntu trusty main universe' >> /etc/apt/sources.list
sudo apt update
sudo apt install mingw32 mingw32-binutils mingw32-runtime mingw-w64
sudo apt install mingw-w64

#mingw-w64 cimpiler can add -m32 in CFLAGS for 32bits

IPMI simulator build step

/////////////////////////////////////////////////////////////
////////////////build linux kernel and rootfs////////////////
/////////////////////////////////////////////////////////////
Refer to:
http://www.linux-kvm.org/images/7/76/03x08-Juniper-Corey_Minyard-UsingIPMIinQEMU.ods.pdf
https://morris821028.github.io/2016/01/21/realtime-system-qemu
https://www.cnblogs.com/zzb-Dream-90Time/p/7111242.html

1.
apt install libncurses5-dev

2.check openipmi linux kernel version
https://sourceforge.net/p/openipmi/linux-ipmi/ci/master/tree/Makefile
VERSION = 4
PATCHLEVEL = 10
SUBLEVEL = 0

3.
git clone --recursive git://git.code.sf.net/p/openipmi/linux-ipmi
cd linux-ipmi
make ARCH=x86_64 defconfig
make ARCH=x86_64 menuconfig

2013年12月17日 星期二

PPO cross platform with libtorch C++

Prepare install:
https://fatalfeel.blogspot.com/2020/06/building-libtorch-and-numpy-in-c.html

PPO C++ source:
https://github.com/fatalfeel/PPO_libtorch

Lessons:
(1) Backpropagation Practice:
source: http://www.mediafire.com/file/fccr43arjcxfgsb/backwardcpp.tar.gz

#If no cuda, eclipse need remove follow libs:
cublas, cudnn, cudart, nvToolsExt, cufft, curand, c10_cuda, torch_cuda

Tesla told in New York Herald: I prefer to be remembered as the inventor who succeeded in abolishing war. That will be my highest pride.
http://www.teslacollection.com/tesla_articles/1898/new_york_herald/f_l_christman/tesla_declares_he_will_abolish_war
(in middle section)

Albert Einstein: The release of atom power has changed everything except our way of thinking... the solution to this problem lies in the heart of mankind. If only I had known, I should have become a watchmaker.
https://atomictrauma.wordpress.com/the-scientists/albert-einstein

Artificial Intelligence Has an Enormous Carbon Footprint
https://www.analyticsvidhya.com/blog/2022/03/the-carbon-footprint-of-ai-and-deep-learning

2013年12月16日 星期一

opencv and dlib training

Refer to:
https://github.com/mrnugget/opencv-haar-classifier-training
https://github.com/davisking/dlib/tree/master/tools/imglab
https://speech.ee.ntu.edu.tw/~hylee/mlds/2015-fall.php
https://gitee.com/Heconnor/MRF
https://www.kaggle.com/mehmetlaudatekman/support-vector-machine-object-detection

#preinstall
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ xenial main'
sudo apt update
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DE19EB17684BA42D
apt install cmake cmake-qt-gui cmake-curses-gui
apt install libjpeg8-dev libpng12-dev libgtk2.0-dev libxext-dev libopenblas-dev liblapack-dev
apt install libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libavdevice-dev
apt install libv4l-dev zlib1g-dev
apt install ninja-build
pip3 install scikit-image

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////OpenCV/////////////////////////////////////////////////////////////
https://opencv.org/releases
download opencv-3.4.16.zip

libtorch cross compile on aarch64-linux-gnu-gcc include torchvision

Refer to:
https://github.com/pytorch/pytorch#get-the-pytorch-source
https://github.com/pytorch/pytorch/blob/master/docs/libtorch.rst
https://discuss.pytorch.org/t/compile-libtorch-c-api-from-source/81624/2
https://qiita.com/syoyo/items/360bcf15b9ee88eeeacd
https://github.com/ljk53/pytorch-android-cpp-demo
https://github.com/dpilger26/NumCpp/tree/master
https://github.com/t-kuha/mpsoc-library/wiki/How-to-build-libtorch-&-torchvision          
https://github.com/t-kuha/mpsoc-library/wiki/How-to-build-Caffe-%26-libtorch-dependencies 
https://fatalfeel.blogspot.com/2013/12/build-nrf9160dk-projects-with-zephyr-os.html      
https://fatalfeel.blogspot.com/2019/12/ai-with-cuda-install-step-and-yolov3-in.html

#install gcc compiler
sudo apt install build-essential

#install python3 version >= 3.7 need here are a lot of works.
https://fatalfeel.blogspot.com/2019/12/ai-with-cuda-install-step-and-yolov3-in.html

#install cmake 3.20.5
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ xenial main'
sudo apt update
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DE19EB17684BA42D
sudo apt install cmake cmake-qt-gui cmake-curses-gui
sudo apt install libjpeg8-dev libpng12-dev libgtk2.0-dev libxext-dev libopenblas-dev liblapack-dev
sudo apt install libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libavdevice-dev
sudo apt install libv4l-dev zlib1g-dev
sudo apt install ninja-build

Build OpenCV with Gstreamer in JetPack

Ref: https://github.com/AastaNV/JEP/blob/master/script/install_opencv4.1.1_Jetson.sh

//download arm64's libjasper1 libjasper-dev
https://launchpad.net/ubuntu/xenial/arm64/libjasper1/1.900.1-debian1-2.4ubuntu1.2
https://launchpad.net/ubuntu/xenial/arm64/libjasper-dev/1.900.1-debian1-2.4ubuntu1.2
gdebi ./libjasper1_1.900.1-debian1-2.4ubuntu1.2_arm64.deb
gdebi ./libjasper-dev_1.900.1-debian1-2.4ubuntu1.2_arm64.deb

2013年12月15日 星期日

Tesseract on ubuntu

refer to:
https://tesseract-ocr.github.io/tessdoc/Command-Line-Usage.html

preinstall:
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ xenial main'
sudo apt update
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DE19EB17684BA42D
apt install cmake cmake-qt-gui cmake-curses-gui
apt install automake autoconf libtool pkg-config libcurl4-gnutls-dev libjpeg8-dev libpng12-dev libtiff5-dev

1. font database
git clone --recursive https://github.com/tesseract-ocr/tessdata_best

PPO AI algorithm on PyTorch

1. Algorithm
https://spinningup.openai.com/en/latest/algorithms/ppo.html
https://zhuanlan.zhihu.com/p/108034550

2. Pytorch python source
https://github.com/fatalfeel/PPO_Pytorch (with full comment)

2013年12月7日 星期六

Slim yolov3 install step in pytorch

refer to https://arxiv.org/pdf/1907.11093.pdf
#clone ktian08-hyp branch not master branch
apt install git-coloa
run git-coloa
clone https://github.com/ultralytics/yolov3.git
actions
pull
enable rebase
origin/ktian08-hyp pull

TFTP upload to IPMI board

1. pc host
apt install tftpd-hpa
gedit /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/mnt/harddisk/upload"
TFTP_ADDRESS="192.168.59.228:69"
TFTP_OPTIONS="-c -l -s"

#-c: Allow new files to be created
#-l:  Run the server in standalone (listen) mode, rather than run from inetd.
#-s: Change  root  directory  on startup.

2013年12月3日 星期二

Install Nvidia cuda & python3.7/3.8 & Yolov3 in Pytorch

#######################################################################
#install nvidia driver + cuda 10.2 + cudnn 7.6.5
#######################################################################
1. remove old driver
sudo apt list --installed | grep cuda
sudo apt purge libcudnn7 libcudnn7-dev libcudnn7-doc
sudo rm -rf /usr/local/cuda-10.0

2. check gpu version and install driver
sudo lspci -v  #find VGA compatible controller

3. stop linux default driver if you are using
gedit /etc/modprobe.d/blacklist.conf
#necessary
blacklist nouveau
#option
blacklist lbm-nouveau
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off

#terminal check
echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf

update-initramfs -u
reboot

2013年12月1日 星期日

Qt Widgets C++ building

refer to: 
https://www.cntofu.com/book/46/qt/ubuntubian_yi_an_zhuang_qt5__0__1.md
https://codertw.com/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80/617555
https://blog.51cto.com/u_15295315/2997065
https://www.cnblogs.com/fengyaoyao/p/10549320.html

Preinstall:
sudo add-apt-repository ppa:levi-armstrong/qt-libraries-xenial
sudo apt update
sudo apt install bison build-essential flex gperf libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev libasound2-dev libatkmm-1.6-dev \
libbz2-dev libcap-dev libcups2-dev libdrm-dev \
libgl1-mesa-dev libglu1-mesa-dev libgl1-mesa-glx libfontconfig1-dev libfreetype6-dev \
libicu-dev libnss3-dev libpci-dev libpulse-dev libssl-dev libudev-dev \
libx11-dev libx11-xcb-dev libxcb-composite0 libxcb-composite0-dev libxcb-cursor-dev \
libxcb-cursor0 libxcb-damage0 libxcb-damage0-dev libxcb-dpms0 libxcb-dpms0-dev \
libxcb-dri2-0 libxcb-dri2-0-dev libxcb-dri3-0 libxcb-dri3-dev libxcb-ewmh-dev libxcb-ewmh2 \
libxcb-glx0 libxcb-glx0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-image0 libxcb-image0-dev \
libxcb-keysyms1 libxcb-keysyms1-dev libxcb-present-dev libxcb-present0 libxcb-randr0 \
libxcb-randr0-dev libxcb-record0 libxcb-record0-dev libxcb-render-util0 \
libxcb-render-util0-dev libxcb-render0 libxcb-render0-dev libxcb-res0 libxcb-res0-dev \
libxcb-screensaver0 libxcb-screensaver0-dev libxcb-shape0 libxcb-shape0-dev libxcb-shm0 \
libxcb-shm0-dev libxcb-sync-dev libxcb-sync-dev libxcb-sync1 libxcb-util-dev \
libxcb-util0-dev libxcb-util1 libxcb-xf86dri0 \
libxcb-xf86dri0-dev libxcb-xfixes0 libxcb-xfixes0-dev libxcb-xinerama0 \
libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xkb1 \
libxcb-xtest0 libxcb-xtest0-dev libxcb-xv0 libxcb-xv0-dev libxcb-xvmc0 libxcb-xvmc0-dev \
libxcb1 libxcb1-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxext-dev \
libxfixes-dev libxi-dev libxrandr-dev libxrender-dev libxslt1-dev libxss-dev \
libxtst-dev libgcrypt11-dev libsigc++-2.0-dev libgtk2.0-dev perl ruby
apt install qt5-default qt59creator
~~~run /opt/qt59/bin/qtcreator

Remote desktop multi-user connection

###########server###########
1. apt remove vino (another vnc sevrer)

2. apt install x11vnc

3. click -> application -> internet -> x11vnc server
port: 5900
File transfer: UltraVnc

Rtsp server for H264 / H265 / AAC

Refer to:
https://github.com/PHZ76/RtspServer
https://github.com/ImSjt/RtspServer
https://gitee.com/marcode/RtspServer-1
https://github.com/ChristianFeldmann/h264Bitstream
https://github.com/Dillon14281118/h265bitstream
https://github.com/BobCromwell/aac-stream-analyzer

Preinstall:
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ xenial main'
sudo apt update
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DE19EB17684BA42D
apt install cmake cmake-qt-gui cmake-curses-gui
apt install libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libavdevice-dev libsdl1.2-dev

Android studio Eclipse jni C/C++ debug

Eclipse jni C/C++ debug provide breakpoint, watchpoint, watch value, memory value,
Arm register value, disassembly code.

Please refer this first :
http://fatalfeel.blogspot.com/2013/09/debug-android-jni-with-eclipse-gui-on.html

1. Install Ubuntu 16.04 x64 and openjdk 8
sudo apt install openjdk-8-jdk openjdk-8-jre
#check version
root@homelinux:~/CardView/Application/src/main# java -version
openjdk version "1.8.0_222"
root@homelinux:~/CardView/Application/src/main# javac -version
javac 1.8.0_222
root@homelinux:~/CardView/Application/src/main# javadoc -J-version
openjdk version "1.8.0_222"

2. Eclipse dependency
sudo apt install gtk2.0 libgtk2.0-dev

3. Android Studio 3.6.2 install to /opt/android-studio

Arduino Jtag Debug (Mega2560)

1. Prepare
#Hardware
Arduino Mega 2560
Atmel ICE
#Software
Atmel Studio 7 install
Arduino IDE install

2013年9月30日 星期一

Android Board HAL Led control

Ref.
http://www.linuxforu.com/2010/12/writing-your-first-linux-driver
http://www.tldp.org/LDP/lkmpg/2.6/html/lkmpg.html

http://bbs.witech.com.cn/forum.php?mod=viewthread&tid=46598&extra=page%3D1%26filter%3Dtypeid%26typeid%3D28%26typeid%3D28

1.
///set serial number on android
android2.3.4_32bit/system/core/init/init.c
//property_set("ro.serialno", serialno[0] ? serialno : "");
property_set("ro.serialno", "OK1ATV800006"); //by stone

2.
//find define mk
/xxxxxx/android2.3.4_32bit/build/core/core/envsetup.mk
TARGET_OUT := $(PRODUCT_OUT)/system
TARGET_OUT_SHARED_LIBRARIES:= $(TARGET_OUT)/lib

3.
//////////////HAL files reference///////////
C:\xxxxxx\android2.3.4_32bit\frameworks\base\services
C:\xxxxxx\android2.3.4_32bit\hardware\libhardware
C:\xxxxxx\android2.3_kernel_v1.01\arch\arm
C:\xxxxxx\android2.3_kernel_v1.01\drivers\char


OpenAL HRTF 3d sound on Linux & Android

source code download on 2016/06/25

https://github.com/kcat/openal-soft
also refer to
https://github.com/soundsrc/openal-soft

///////////////////////Ubuntu 14.04 linux system///////////////////////
1. preinstall
sudo apt-get install cmake
sudo apt-get install libsdl-sound1.2-dev

sudo add-apt-repository ppa:adrozdoff/ffmpeg-opti
sudo apt-get update
sudo apt-get install libavformat-ffmpeg-dev libavcodec-ffmpeg-dev libavutil-ffmpeg-dev libavfilter-ffmpeg-dev libswscale-ffmpeg-dev libswresample-ffmpeg-dev libpostproc-ffmpeg-dev

2013年9月29日 星期日

Build OK6041 environment

http://note.jhpeng.com/2013/01/sudo-apt-get-install-git-core-gnupg.html
http://e-xiao.blogspot.tw/2011/10/resolve-build-errors-for-android-234.html

1.
gedit /etc/init.d/rc.local
//add
mount /dev/sda3 /extdriver

add-apt-repository ppa:sun-java-community-team/sun-java6
apt-get update
apt-get install sun-java6-jdk

//remove ppa:sun-java-community-team/sun-java6 list, option
gedit /etc/apt/sources.list

arm gdb trace u-boot to start_kernel on i.mx6

1.
In Eclipse right click project
Debug As -> Debug Configurations -> GDB Hardware Debugging

2.
click Startup tab
uncheck the all items on startup page
add those lines under [Halt] box but do not check [Halt]
add-symbol-file /root/project_board/free_imx/out/matrix_io/uboot/u-boot 0x4FF04000
start debugging and trace code
(ps: in u-boot os keyin [bdinfo] show relocaddr = 0x4FF04000)

How to debug android linux kernel or driver by KGTP

Ref. http://code.google.com/p/kgtp/wiki/HOWTOCN

1. install pci serial port card (option install)

2. Vmware add hardware serial port (option install)

3. serial port assign com9 (option install)

Jtag Openocd Eclipse debug

OpenOCD debugging is the most efficient than KGDB.

1.
Seeedstudio Bus Blaster price is less than 40 US$ on Ebay. Very cheap.
bus blaster v3 or v3c or v4 or v4.1 connect to i.mx6dq jtag pings.(Vtg, Vcc disconnect)
Blaster      - I.Mx6dq
TRST         - TRSTn (Test access port reset)
TDI            - TDI
TMS          - TMS
TCK          - TCK
TDO          - TDO
TSRST      - nSRST (System reset)
GND         - GND

http://dangerousprototypes.com/docs/Bus_Blaster
http://www.mediafire.com/view/ozh1f11zx8s2g5s/BusBlaster_jtag.png#
http://www.mediafire.com/view/9tbesr2g5j1bp82/IMX6dq_jtag.png#

2. arm-eabi-gdb dependency lib
add-apt-repository ppa:fkrull/deadsnakes
apt-get update
apt-get install python2.6 python2.6-dev

3. openocd pre-install lib
apt-get update
apt-get install libftdi-dev
apt-get install libusb-1.0-0-dev
apt-get install texinfo
apt-get install automake autoconf libtool pkg-config

4.
http://sourceforge.net/projects/openocd/files/openocd/0.9.0
download file openocd-0.9.0.tar.gz
extract to
[~home]/openocd-0.9.0
or
open terminal window -> git clone git://git.code.sf.net/p/openocd/code

2013年9月28日 星期六

Bus Blaster flash to Swd mode in OpenOcd

Refer to
https://yeah.nah.nz/embedded/busblaster-kt-link
https://bgamari.github.io/posts/2014-08-23-swd-with-busblaster-and-openocd.html
http://bgamari.github.io/posts/2013-07-24-flashing-busblaster-cpld-with-openocd.html
https://discuss.96boards.org/t/sdw-debugging-carbon-stm32-using-bus-blaster-v3/958
https://gist.github.com/natevw/14d1f1fe669ec6e201c5

1.
~circuit
Bus Blaster SWD connect to Target
TCK ──────────────────────── SWCK
TMS ──────────────────────── SWDAT
GND ──────────────────────── GND

Using Bus Blaster V3C or V4.1a
http://dangerousprototypes.com/docs/Bus_Blaster_v3_design_overview
http://dangerousprototypes.com/docs/Bus_Blaster_v4_design_overview

2.
~Preinstall openocd 
https://github.com/fatalfeel/openocd_integrated

GitServer GitWeb GitLab on Bitnami

1. download GitLab 7.2.1-1
https://bitnami.com/stack/gitlab/installer

2. install open ssh
apt-get install openssh-server
http://bojack.pixnet.net/blog/post/29040829-%E3%80%90linux%E3%80%91%E5%9C%A8-ubuntu-%E4%B8%8A%E5%AE%89%E8%A3%9D-ssh-server

2013年9月27日 星期五

Install ubuntu 14.04/16.04/20.04 and above looks like 10.04

1. update sabertooth z87 bios to latest version in boot setup menu

2. install ubuntu 12.04.5 or 14.04.2
http://releases.ubuntu.com/12.04/
http://old-releases.ubuntu.com/releases/14.04.2/

ubuntu 14.04.2 linux kernel version is 3.16.0-xxx

3. burn iso file in DVD

4. setting DVD first boot in motherboard bios

5. create primary partition assign mount / ([/] = root directory)
My PC: 1Tb Hard disk and 8gb physical ram
size         : 496gb
type         : Primary
use as      : Ext4
Mount point : /

2013年9月26日 星期四

Vivante 3d gc2000 work flow

///////////////////////////create device node /dev/galcore/////////////////////////////
$home/myandroid/kernel_imx/drivers/mxc/gpu-viv/Kbuild
MODULE_NAME ?= galcore
/* define node name*/
$home/myandroid/kernel_imx/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h
define DEVICE_NAME "galcore"

$home/myandroid/kernel_imx/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_probe.c
drv_init call
ret = register_chrdev(major, DEVICE_NAME, &driver_fops);

boot.img to image (binary vmlinux)

1. download image unpack tools
http://www.mediafire.com/file/2zcwc74bzjxej4b/android_bootimg_tools.tar.gz

2.
mkdir ./zimage
./unpackbootimg -i boot.img -o ./zimage

2013年9月24日 星期二

BaudRate setting for u-boot and kernel on i.mx6

gedit /root/project_board/free_imx/myandroid/bootable/bootloader/uboot-imx/include/configs/mx6_matrix_common.h
//#define CONFIG_BAUDRATE               115200 //by stone
#define CONFIG_BAUDRATE                  460800

gedit /root/project_board/free_imx/myandroid/bootable/bootloader/uboot-imx/include/config_fallbacks.h
//#define CONFIG_SYS_BAUDRATE_TABLE    { 9600, 19200, 38400, 57600, 115200 } //by stone
#define CONFIG_SYS_BAUDRATE_TABLE    { 9600, 19200, 38400, 57600, 115200, 230400, 460800 }

2013年9月22日 星期日

Task queue and ini

1.
using pthread_mutex_t for lock
using pthread_cond_t for signal
using std::vector for queue
using singleton in class
static TaskQueue*   Get();
static void         Free();

2. task queue source clip
int TaskQueue::Process(int type, NODE_YUV* node_yuv)
{
    int ret; //each thread own it's local variable address
    pthread_mutex_lock(&m_process_lock);

    switch(type)
    {
        case 0: //read first node
            if ( ret = m_vqueue.size() > 0 )
            {
                memcpy(node_yuv, &(*m_vqueue.begin()), sizeof(NODE_YUV));
                m_vqueue.erase(m_vqueue.begin());
            }
            break;

        case 1: //save last node
            m_vqueue.push_back(*node_yuv);
            break;
    }

    pthread_mutex_unlock(&m_process_lock);

    return ret;
}

void TaskQueue::TaskThreadLoop()
{
    int         ret;
    NODE_YUV    node_yuv;

    while(m_thread_work)
    {
        ret = Process(0, &node_yuv);
        if( ret )
        {
            //ur work start

            //ur work end
           
            printf("free %p size=%d\n", node_yuv.buf, node_yuv.size);
            free(node_yuv.buf);
        }
        else
        {
            //wait signal when queue empty
            pthread_mutex_lock(&m_taskqueue_work_lock);
            pthread_cond_wait(&m_taskqueue_work_cond, &m_taskqueue_work_lock);
            pthread_mutex_unlock(&m_taskqueue_work_lock);
        }
    }
}

3.
using std::ifstream for reading
using std::ofstream for writing

4. ini source clip
std::ifstream   inifile;
inifile.open(m_filepath, std::ifstream::in);

std::ofstream   inifile;
inifile.open(m_filepath, std::ofstream::out | std::ofstream::trunc);

source download:
https://www.mediafire.com/file/pry0z0x8pdsnm29/taskqueueini.tar.gz

Arm MCR command explain

MCR p15,0,<Rd>,<CRn>,<CRm>,<Opcode_2>
<CRm>和<Opcode_2>兩者組合決定對協處理器寄存器進行所需要的操作,如果沒有指定則<CRm>為C0,<Opcode_2>為0, 否則導致不可預知的結果.

Build web site and get free server Firebase

1.
Download  web server Nginx
http://nginx.org

this local server is for html response

2.
Register Firebase remote server
https://firebase.google.com

Firebase can create chat and webrtc server free
Peer to peer authenticate through the Firebase remote server.

3.
Go to Firebase control panel
https://console.firebase.google.com

Uart to LinBus on Android

Ref.
1. https://rtime.felk.cvut.cz/can/lin-bus/
    for Uart to linbus

2. https://github.com/linux-can/can-utils
    for slcan_attach modify

3. https://github.com/karelzak/util-linux
    for ldattach

4. https://github.com/shemminger/iproute2
    for ip link set up in C code
  
///// Linux Kernel /////
1. Copy sllin.c to kernel_imx/drivers/net/can

2. gedit kernel_imx/include/uapi/linux/tty.h
//add
#define N_SLLIN            25

Client HID of Bluez for Bluetooth Qualification

Download client HID sample code
http://anselm.hoffmeister.be/computer/hidclient/hidclient-20120728.tar.bz2

HID report descriptor sample
http://www.instructables.com/id/USB-Wii-Classic-Controller/step13/Bonus-Keyboard-and-Mouse

Register record to SDP sample
http://blog.csdn.net/huipengzhao/article/details/18268201

2013年9月21日 星期六

Eclipse debug Android framework and service

To prepare Eclipse:
http://fatalfeel.blogspot.tw/2013/09/eclipse-setting-for-ubuntu-imx6-android.html

//////////////////////////////////////////////
////////Debug surfaceflinger////////
//////////////////////////////////////////////
1.
gedit ~/OK8MM-android-source/frameworks/native/services/surfaceflinger/Android.mk
//add
LOCAL_CFLAGS += -O0 -g
LOCAL_CPPFLAGS += -O0 -g
LOCAL_STRIP_MODULE := false

2013年9月20日 星期五

Python debug with Eclipse ide

ref. https://kodi.wiki/view/HOW-TO:Debug_Python_Scripts_with_Eclipse

1.
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk

2. (if you have another version hava do this)
update-alternatives --config java
update-alternatives --config javac
update-alternatives --config javadoc

java -version
javac -version
javadoc -J-version

Build Eclipse debug environment for Android on Ubuntu

//////////////Install OpenJdk 7.0
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-7-jdk

update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-6-oracle/jre/bin/java 1100
update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1101
update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-6-oracle/bin/javac 1100
update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-7-openjdk-amd64/bin/javac 1101
update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/java-6-oracle/bin/javadoc 1100
update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/java-7-openjdk-amd64/bin/javadoc 1101

update-alternatives --config java
update-alternatives --config javac
update-alternatives --config javadoc
or
update-alternatives --set java /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
update-alternatives --set javac /usr/lib/jvm/java-7-openjdk-amd64/bin/javac
update-alternatives --set javadoc /usr/lib/jvm/java-7-openjdk-amd64/bin/javadoc

//check version
java -version
javac -version
javadoc -J-version

Using arm gdb to find crash line of source file

1.
Make sure in default config
#CONFIG_ARM_UNWIND is not set
CONFIG_DEBUG_INFO=y
CONFIG_FRAME_POINTER=y
CONFIG_FRAME_POINTER depend on follows
CONFIG_CC_OPTIMIZE_FOR_SIZE=n
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_TRACING_SUPPORT=y
CONFIG_FTRACE=y
CONFIG_FUNCTION_TRACER=y
CONFIG_DYNAMIC_FTRACE=y

2.check structure~myandroid/kernel_imx/arch/arm/include/uapi/asm/ptrace.h
struct pt_regs
{
  long uregs[18];
};

#define ARM_pc uregs[15]
#define ARM_lr uregs[14]

Start another process independent in linux

Android startup app from init.rc

1. facerecognition.sh
#!/system/bin/sh /system/bin/am start -n com.luxand.facerecognition/com.luxand.facerecognition.MainActivity

2. topeet_6dq.mk
gedit /mnt/ssd/iTOP-iMX6_android4.4.2/device/fsl/imx6/topeet_6dq.mk
#add
PRODUCT_COPY_FILES += \
device/fsl/matrix_io/etc/facerecognition.sh:system/etc/facerecognition.sh

Git2 lib for Win32 and Linux

///////////Win32/////////////
1. git2 source
https://github.com/libgit2/libgit2
Revision: eb5f03461fbcaa3fef8e63d1b0f7c682708fadd2 / Date: 2014/7/11 下午 06:22:48
installed

2. download cmake
http://www.cmake.org/cmake/resources/software.html
installed

3. install zlib - Complete package, except sources
http://gnuwin32.sourceforge.net/packages/zlib.htm
installed

2013年9月19日 星期四

Selinux from user-space to kernel

//build in debug mode
modify $home/myandroid/system/core/init/property_service.h
int property_get(const char *name, char *value)
{
    /*size_t value_len = __builtin_object_size(value, 0);
    if (value_len != PROP_VALUE_MAX)
        __property_get_size_error();*/

    return __property_get(name, value);
}

$home/myandroid/external/libselinux/src/avc.c
int avc_has_perm_noaudit(...)
{
...
...

Android App communication through binder to user-space (IPC)

Ref.
http://wangkuiwu.github.io/2014/09/03/Binder-ServiceManager-Daemon/

[The example is a system app send message through binder to mediaserver audio]
Target:
1.
external/sepolicy/system_app.te

type system_app, domain;
app_domain(system_app)
net_domain(system_app)
### begin issue: ###
binder_use(system_app)
binder_call(system_app, binderservicedomain)
binder_call(system_app, appdomain)
### end issue: ###
binder_service(system_app)

Install libgtk2 and libwxgtk3 in Ubuntu

1. install gtk
download libglib2.0-dev deb
https://ftp.nsysu.edu.tw/Ubuntu/ubuntu/pool/main/g/glib2.0

gdebi ./libglib2.0-dev_2.40.0-2_amd64.deb

2013年9月18日 星期三

Eclipse debug Android jni c/c++ of system app on Ubuntu

To prepare Eclipse:
https://fatalfeel.blogspot.tw/2013/09/build-eclipse-debug-environment-for.html
//////////////////////////////////////////////
Debug LinbusConfig App
//////////////////////////////////////////////
1.
~myandroid/frameworks/base/cmds/app_process/Android.mk
LOCAL_PATH:= $(call my-dir)
.
.
LOCAL_MODULE:= app_process
.
.
LOCAL_CFLAGS                := -O1 -g
LOCAL_CPPFLAGS             := -O1 -g
LOCAL_STRIP_MODULE    := false
include $(BUILD_EXECUTABLE)

Eclipse debug Android jni c/c++ of App on NDK R13

Include NDK R13 Method
////////////////eclipse setting//////////////////
http://www.eclipse.org/downloads/packages/release/Kepler/SR2
Eclipse Standard 4.3.2 -> linux 64bits
install eclipse-standard-kepler-SR2-linux-gtk-x86_64.tar.gz
extract to /opt/eclipse
chmod 755 -R /opt/eclipse

gedit /opt/eclipse.ini
-XX:PermSize=64m
-XX:MaxPermSize=256m
-Xms128m
-Xmx4096m

Solve Ubuntu 12.04/14.04 can not login to desktop

Reason why is lightdm or ubuntu-desktop damage

1. install gdm
after startup press ctrl+alt+F1 and login
apt-get -f install gdm
dpkg-reconfigure gdm  -> select gdm
reboot

2.
After startup
gdm simple mode login
open terminal
(If terminal all black or all white then setting forground color
Ternimal -> 編輯 -> 設定組合偏好設定 -> 顏色 -> 文字顏色 -> 白色)

Cross platform Secs/Gem open source

////////////////////////////////////////////////
///////////Project Download
////////////////////////////////////////////////
http://www.mediafire.com/file/khpjkq4fgssh3yp/GemHsms2018.zip

1.This project can build on VC++ on Win32 and Eclipse CDT on Linux.
2.Need preinstall ACE Wrappers and Xerces
3.Memory leak fixed
4.File secs.xsd grammar fixed

2013年9月16日 星期一

Openal 3D sound for tinyalsa android sound

Openal tinyalsa for android 6.0 fit for all android sound stream
It's for android low level sound stream. Processing After android Audioflinger.

1.
tinyalsa put in ~myandroid/external/tinyalsa

2.
OpenalConfig put in ~myandroid/packages/apps

3.
add this line in system_app.te
allow system_app default_prop:property_service set;

add this line in mediaserver.te
allow mediaserver default_prop:property_service set;

make sure remove this line in all *.te
neverallow { ... -system_app } default_prop:property_service set;

download:
http://www.mediafire.com/file/w8hh29ck0apnep2/tinyalsa_openal.tar.gz

Building 3d game Doom1 on Ubuntu 16.04

1.
apt-get install freedoom

2.
wget https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.0.18.tar.gz
#mirror site https://github.com/libsdl-org/SDL/tags
tar -xvf ./release-2.0.18.tar.gz
cd SDL-release-2.0.18
./configure --prefix=/usr
make -j8 && make install

3.
rm -f /usr/lib/x86_64-linux-gnu/libSDL2-*
cp -fP /usr/lib/libSDL2* /usr/lib/x86_64-linux-gnu

HelloWorld cross compile on Mingw64

#install mingw64
apt install gcc-mingw-w64

#install wine
ubuntu 18.04
apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'
ubuntu 16.04
apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main'

apt update
apt install --install-recommends winehq-stable

2013年9月15日 星期日

KdeSvn (Gui Svn) in ubuntu 12.04/14.04

KdeSvn was written by C++ good and fast~~~

Download kdesvn-master.zip
https://github.com/KDE/kdesvn

apt-get install cmake
apt-get install kdelibs5-dev kdelibs5-plugins
apt-get install libapr1-dev libaprutil1-dev
apt-get install libsvn-dev
apt-get install oxygen-icon-theme

2013年9月14日 星期六

Android camera yuv to rgb rgba with arm neon

///
///n21 to rgb
///
static uint8x8_t const loaduv(unsigned char const* uv)
{
   return vld1_u8(uv);
}

static void store_pixel_block(unsigned char* dst, uint8x8x3_t& pblock, uint8x8_t const& r, uint8x8_t const& g, uint8x8_t const& b)
{
   pblock.val[0] = r;
   pblock.val[1] = g;
   pblock.val[2] = b;
   vst3_u8(dst, pblock);
}

2013年9月12日 星期四

Json to Xml and Xml to Json open source

Refer to:
1. https://github.com/DaveGamble/cJSON
2. https://github.com/aMonst/json_xml_transf

Dts Dtsi device tree setting and code

Device tree .dts parser, it's like Tinyxml

///////////////paser dts
gedit /root/project_board/free_imx/myandroid/kernel_imx/drivers/of/fdt.c
void __init unflatten_device_tree(void)
{
    //of_allnodes get full Tree
    __unflatten_device_tree(initial_boot_params, &of_allnodes, early_init_dt_alloc_memory_arch);
   
    of_alias_scan(early_init_dt_alloc_memory_arch); //start parser
}

2013年9月11日 星期三

Start a independent process in C

There are 3 id in you process
getpid(), getpgid(getpid()), getsid(getpid()).

1. caller side
#use posix_spawn get spawn id and wait until target independently

pid_t spawnid;
pid_t targetid;
char* args[] = {"targetname", "usb", "1", "2", NULL};

posix_spawn(&spawnid, "/root/hdapi/targetname/bin/targetname", NULL, NULL, args, environ);

targetid = 0;
while( targetid != spawnid ) //wait targetname totally independent    {
targetid = getsid(spawnid);
usleep(1000);
}

2013年9月10日 星期二

Device node building

/* Given the minor device number and name,
     Tell Linux how many device numbers to apply for,
     Linux system help you find the major device number*/
if((alloc_chrdev_region(&devno, 0, 1, "hello_driver")) <0){
    pr_err("Cannot allocate major number\n");
    return -1;
}

Psychology of programming - How to place the left brace

After read Allman Style, K&R style, GNU style
https://en.wikipedia.org/wiki/Indentation_style

ISO C99, ISO C++ 2011, ISO C++ 2014, ISO C++ 2020
https://www.mediafire.com/file/3xy4u72o4g9uft2/ISO_C_and_C%252B%252B__International_Standard.zip

Hungarian notation & its history
https://idleloop.com/hungarian/
https://en.wikipedia.org/wiki/Talk%3AHungarian_notation
https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/general-naming-conventions

The Psychology of Computer Programming & An Introduction to General Systems Thinking by Weinberg
https://en.wikipedia.org/wiki/Gerald_Weinberg

Also wrote in many system:
Linux kernel, Zephyr, C#, Inline assembly, Android framework & App, IOS Object-C App, Python3 for AI, Scala for Risc-V, Buildroot, Bash, Makefile and trace GNU gcc source. Then post this topic.

2013年9月6日 星期五

TCP nonblock socket server and client

Server:
static void Init_Server(int port)
{
  int                             err, flags;
  struct sockaddr_in    server_addr;

  s_server_fd = socket(AF_INET, SOCK_STREAM, 0);
  if (s_server_fd < 0)
      on_error("Could not create server_addr socket: %s\n", strerror(errno))

  server_addr.sin_family = AF_INET;
  server_addr.sin_port = htons(port);
  server_addr.sin_addr.s_addr = htonl(INADDR_ANY);

2013年9月3日 星期二

simple Httpd server Mongoose

ref http://code.google.com/p/mongoose/downloads/list

1. search all download find mongoose-2.8

2. here I build all sample in vs2008, download it
http://www.mediafire.com/?0k3vrk6tvz104v9

Android Horizon Scroll TAB extends Activity only

/////////////in main.xml
xml version="1.0" encoding="utf-8"
RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="#C0000000"
android:cacheColorHint="#00000000"

TabHost
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">


Cross platform inter thread communication

//////////////function pointer//////////////
template class IEventFunctorBase
{
public:
virtual void Call(ParamType& event) = 0;
virtual void* GetThis() = 0;
};

Proton 3d engine open source on android, ios, win32, macos

Ref:
http://www.rtsoft.com/wiki/doku.php?id=proton:android_projects#v2_styles
http://www.rtsoft.com/wiki/doku.php?id=proton:linux_setup

/////////////////////////////Android win32/////////////////////
1.Install Cygwin
http://www.cygwin.com/
switch item Devel [Default] to [Install]

H264 high profile decoder in VC9 include sse3 asm

H264 decode in VC9 include sse3 asm codec

1. download file high_profile_h264.zip from
http://www.mediafire.com/?932mmcx6lb79lyb

2. install MinGW

3. set executable files path for VC9 EX. C:\Program Files\MinGW\bin

4. build path name only in ascii code, can not unicode EX. c:\hi_ff264 or d:\hi_ff264 is good

5. Choice register in config.h #define HAVE_MMX 1 #define HAVE_MMX2 1 #define HAVE_SSE 1 #define HAVE_SSSE3 1

6. this code extract from ffmpeg-r26400-swscale-r32676 can decode h.264 high profile format

7. output use YUV420_TO_RGBA32_MMX() for opengl format you can modify this function for directx

8. GBRA32 MMX code reference
http://www.mediafire.com/?8u2gam3jfecgdb7

Motodev Studio 5.0 in linux(help you debug native c++)

ref. http://fatalfeel.blogspot.tw/2013/09/debug-cocos2d-in-c-android-ndk-eclipse.html
ref. http://www.motorola.com/sites/motodev/library/motodev_core_plugins.html
ref. http://developer.android.com/tools/devices/emulator.html#acceleration


1. Download Android-Sdk, Sdk Platform-tools, Ndk
http://dl.google.com/android/android-sdk_r20.0.3-linux.tgz
http://dl.google.com/android/repository/platform-tools_r12-linux.zip
extract to /usr/local/android-sdk-linux

http://www.crystax.net/en/download
download android-ndk-r7-crystax-5.beta3-linux-x86.tar.bz2
extract to /usr/local/android-ndk-r7-crystax-5.beta3

gtk 2.17.2+dfb drag and drop function fixed

gdkdnd-directfb.c

//refer to _gdk_windowing_window_get_pointer in gdkwindow-directfb.c
//and gdk_directfb_child_at in gdkevents-directfb.c
GdkWindow*
dnd_windowing_window_get_child (GdkWindow* node, GdkWindow* dragwin, gint x, gint y)
{
GdkWindowObject *win;
GdkWindowObject *private;
GList *list;

private = GDK_WINDOW_OBJECT (node);

Fixed iOS Simulator trouble from Xcode 3.X to 4.X

!!Notice do not use "root" login

#Xcode 3 ver in Xcode 4 project modify
cd into the PROJECT_NAME.xcodeproj directory
delete all previous [LoginUserName] files and directories
Reopen Xcode4 and build

#solve simulator-> error: failed to attach to process ID 0
Basically it means Xcode is not able to attach a build of your app to the simulator.
To solve this problem, simply do the following:

1.Click on Simulator and reset the simulator by going to the > OS Simulator > main menu choose > Reset Content and Settings

2."Product" > "Edit Scheme". On the left menu panel, click on "Run Project_Name.app".
The info display on the right should have the "Debug Process As" radio button picked as "Me (user-name)".
If not, make sure you do not login as "root".

3.Xcode, go to the menu "Window" > "Organizer". On the top menu, click on "Projects". Go ahead and delete "Derived Data".

4.delete "~/Library/Application Support/iPhone Simulator/6.0/Applications"

Poco with cocos2d in Android and Ios

//////////////build poco-1.4.4-all with Android NDK in Linux

root@ubuntu:~# /usr/local/android-ndk-r7-crystax-5.beta2/build/tools/make-standalone-toolchain.sh --platform=android-9 --install-dir=/usr/local/android-toolchain

//Poco build command line
#Need full path configure, Otherwise you'll get an error saying "Current working directory not under $PROJECT_BASE."

export PATH=$PATH:/usr/local/android-toolchain/bin
/root/poco-1.4.4-alllinux/configure --prefix=/usr/local/poco-1.4.4 --config=Android --no-samples --no-tests --omit=NetSSL_OpenSSL,Crypto,Data/ODBC,Data/MySQL,PageCompiler

make

make install


Server and clients MultiPlayer Ryzom Source code

1. Download source code in c:\ or d:\
http://www.mediafire.com/?ikbz8l233wy7wj2

2. Download
http://sourceforge.net/projects/ryzom/files/ryzom_client.7z
then extract ryzom_client.7z to
C:\Documents and Settings\JesseStone\Application Data\Ryzom

Server and clients MultiPlayer ManaWorld Source code

Ref:
https://github.com/mana/manaserv
https://github.com/themanaworld/tmwa
https://github.com/tales/sourceoftales/wiki/How-to-setup-a-local-server

1. Preinstall codeblocks
https://sourceforge.net/projects/codeblocks/files/Binaries/13.12

2. codeblocks->Settings->Environment->General Settings,
uncheck "Allow only one running instance",
uncheck "Use an already running instance", and restart.
For debug 3 projects simultaniously.

Debug Cocos2d in C + Android NDK + Eclipse in Ubuntu

Ubuntu Linux Version

//////////////////////////////////////////////////////
Ref.
http://blog.plicatibu.com/how-to-debug-cocos2d-x-and-java-code-using-eclipse
http://ibeyond.blog.51cto.com/1988404/1109559
http://developer.android.com/guide/developing/device.html
http://blog.csdn.net/luoshengyang/article/details/6768304
////////////////////////////////////////////////////////

Concept:
begin break point in java debug first
then start ndk-gdb-eclipse server
use MOTODEV C++ debug > arm-linux-androideabi-gdb connect it
and continue java debug

Cocos2d + Android NDK + Eclipse in Win32

Ref.
http://www.eoeandroid.com/thread-156516-1-1.html
http://www.eoeandroid.com/thread-93743-1-1.html
http://www.cocos2d-x.org/projects/cocos2d-x/wiki/How_to_run_test_cases_on_android-ndk

1.JDK 6
jdk-6u16-windows-i586.exe

2.Eclipse
eclipse-java-helios-SR2-win32.zip
http://www.eclipse.org/downloads/packages/release/helios/sr2

Linux inline asm and Macro expansion

Macro expansion:
vc:
cl /P panic.c

linux:
C:\Progra~1\MinGW\bin\mingw32-g++ -E -P panic.c -o panic.i
~~~or
C:\Progra~1\MinGW\bin\mingw32-g++ -save-temps=obj

prototype generate:
vc:
cl /Zg panic.c

linux:
C:\Progra~1\MinGW\bin\mingw32-g++ -c -P panic.c -aux-info panic.i

Ubuntu + OpenAl-static

//refer to http://hi.baidu.com/%CF%B5%B4%C7%CF%C2%B4%CE/blog/item/f14cb71d375ae36adab4bd11.html

//put openal-soft-1.12.854.tbz2 in home

apt-get install cmake


How ot make .a and .so and use it

//refer to http://blog.yam.com/ytha/article/16636287

Generally, gcc is used to compile C language programs under Linux. By default, the compiler will only search for the standard C99 library.
Such as stdio.h, math.h, etc., while standard Linux system functions are usually stored in /lib and /usr/lib, So it is necessary to tell the compiler (linker) which function library to search, and the name of the function library under Linux always starts with lib,
Subsequent names are determined according to the library (m stands for math library), and the extension .a refers to the static library, and .so refers to the shared library.

Vmware+Ubuntu+wxWidgets-2.8.11+sqlite3-3.6.22+wxsqlite3+openGl

ref. http://converse-2008.blogspot.com/2010/09/how-to-building-opengl-in-ubuntu.html

apt-get install build-essential
apt-get install libgl1-mesa-dev
apt-get install libglu1-mesa-dev
apt-get install freeglut3-dev

In example.c


Gtk 2.17.2 drag and drop background bug fixed part 2

gdkdrawable-directfb.c

static void
gdk_directfb_draw_rectangle (GdkDrawable *drawable,
GdkGC *gc,
gint filled,
gint x,
gint y,
gint width,
gint height)
{

gint i;
gint pitch;
GdkRegion clip;
GdkDrawableImplDirectFB *impl;
GdkGCDirectFB *gc_private = NULL;
IDirectFBSurface *surface = NULL;
guchar* ucbits;
//GdkWindowImplDirectFB* wimpl;
//GdkWindowObject* private;
GdkDrawableImplDirectFB* bgimpl;


Gtk 2.17.2 drag and drop background bug fixed part 1

gdkpixbuf-render.c

void
gdk_pixbuf_render_threshold_alpha (GdkPixbuf *pixbuf,
GdkBitmap *bitmap,
int src_x, int src_y,
int dest_x, int dest_y,
int width, int height,
int alpha_threshold)
{
GdkGC *gc;
GdkColor color;
int x, y;
guchar *p;
int start, start_status;
int status;


Gtk+-2.17.2 + dfb words wrong update fixed

Modify as follows

static void gdk_window_impl_directfb_end_paint (GdkPaintable *paintable)
{
gint i;
GdkDrawableImplDirectFB *impl;

impl = GDK_DRAWABLE_IMPL_DIRECTFB (paintable);

D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", __FUNCTION__, paintable );


static gtk+-2.17.2 your single file make Part 3

4.gedit /gtk+-2.17.2/dndtest/Makefile

FBDEV_OBJS = /usr/ubuntufb/lib/directfb-1.3-0/wm/libdirectfbwm_default.o\
/usr/ubuntufb/lib/directfb-1.3-0/systems/libdirectfb_fbdev.o\
/usr/ubuntufb/lib/directfb-1.3-0/inputdrivers/libdirectfb_linux_input.o\
/usr/ubuntufb/lib/directfb-1.3-0/inputdrivers/libdirectfb_keyboard.o\
/usr/ubuntufb/lib/directfb-1.3-0/inputdrivers/libdirectfb_ps2mouse.o

srcdir = .
top_srcdir = ..

pkgdatadir = $(datadir)/gtk+
pkglibdir = $(libdir)/gtk+
pkgincludedir = $(includedir)/gtk+
top_builddir = ..


static gtk+-2.17.2 your single file make Part 2

3.gedit /gtk+-2.17.2/dndtest/dndtest.Po

dndtest.o: dndtest.c /usr/include/stdio.h /usr/include/features.h \
/usr/include/bits/predefs.h /usr/include/sys/cdefs.h \
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
/usr/include/gnu/stubs-32.h \
/usr/lib/gcc/i486-linux-gnu/4.4.3/include/stddef.h \
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
/usr/lib/gcc/i486-linux-gnu/4.4.3/include/stdarg.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \
/usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/bits/byteswap.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/bits/time.h /usr/include/sys/sysmacros.h \
/usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
/usr/include/unistd.h /usr/include/bits/posix_opt.h \
/usr/include/bits/confname.h /usr/include/getopt.h /usr/include/string.h \
/usr/include/xlocale.h ../config.h ../gtk/gtk.h ../gdk/gdk.h \
../gdk/gdkapplaunchcontext.h /usr/ubuntufb/include/glib-2.0/gio/gio.h \

static gtk+-2.17.2 your single file make Part 1

Target is make a dndtest execute file

1.make directory in /gtk+-2.17.2/dndtest

///////////////////////////////////////////////////////////

2.gedit /gtk+-2.17.2/dndtest/dndtest.c

#include
#include
#include
#include
#include "config.h"
#include "gtk/gtk.h"


Gtk+-2.17.2 + directfb Scroll black area bug fixed

Modify gdkgeometry-directfb.c will fixed

/*if (gdk_rectangle_intersect (&rect, &clip_rect, &rect) &&
(!private->update_area ||
!gdk_region_rect_in (private->update_area, &rect)))
{
GdkRegion *region;

region = gdk_region_rectangle (&rect);
gdk_region_subtract (invalidate_region, region);
gdk_region_destroy (region);

if (impl->surface)
{
DFBRegion update = { rect.x, rect.y,
rect.x + rect.width - 1,
rect.y + rect.height - 1 };

impl->surface->SetClip (impl->surface, &update);
impl->surface->Blit (impl->surface, impl->surface, NULL, dx, dy);
impl->surface->SetClip (impl->surface, NULL);
impl->surface->Flip(impl->surface,&update,0);
}
}*/

Set eclipse to debug Gtk+directfb in Ubuntu

Refer to:
1. http://www.eit.name/blog/read.php?447
2. http://hi.baidu.com/googlekongjianddd/blog/item/09ea538bcc38d818c9fc7a4a.html

1.
apt-get install eclipse
To use only  jdk and jre packages for eclipse-c/c+
so go to synaptic remove contain name that include eclipse
or
add-apt-repository ppa:sun-java-community-team/sun-java6
apt-get update
apt-get install sun-java6-jdk

If meet "ca-certificates-java depends on openjdk-6-jre-headless"
then
sudo dpkg --purge bleachbit ca-certificates-java icedtea-6-plugin icedtea-netx
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer


2. Remove sun server (option).
gedit /etc/apt/sources.list
remove ppa:sun-java-community-team/sun-java6

Static gtk+-2.17.2 + Directfb cross compile on Ubuntu

In Ubuntu 10.4 Desktop and "root" login

apt-get install build-essential libncurses5-dev

apt-get install autoconf

apt-get install libtool

apt-get install gettext

apt-get install libglib2.0-dev

apt-get install libgtk2.0-dev

cd zlib-1.2.3

//zlib-1.2.3


Enable Framebuffer mode in Ubuntu 12.04/14.04 of Vmware

Check fb type
dmesg | grep vesa

//ver 12.04
gedit /boot/grub/grub.cfg
//ver 14.04
gedit /etc/default/grub

quiet splash
change to
quiet splash vga=792

Static build in VC9 GtK+-2.90.0 / GtK+-2.21.1

Refer to http://xullicious.com/gtk-win32.php

1.Need Gnuwin32 by fatalfeel
http://www.pudn.com/downloads264/sourcecode/windows/control/detail1213704.html

2.fatalfeel's all GTK package
http://www.pudn.com/downloads264/sourcecode/windows/control/detail1212874.html

Static cross compile gtk-2.16.6+gtk-directfb+arm-linux (arm-linux-gcc-3.4.3+uClibc-0.9.28)

Refer to zsfly.cublog.cn GTK+/DirectFB

Donwload address:
1. libiconv-1.9.2 http://ftp.gnu.org/pub/gnu/libiconv/

2. gettext-0.14.6 http://ftp.gnu.org/pub/gnu/gettext/

In Ubuntu 10.4 Desktop and "root" login

mkdir usr/local/armlinux, extract arm-linux-gcc-3.4.4-glib-2.3.5-static.tar.gz to usr/local/armlinux
edit /etc environment document file add /usr/local/armlinux/bin

Static cross compile gtk-2.16.6+gtk-directfb+arm-linux (arm-linux-gcc-3.4.4+glib-2.3.5)

Refer to zsfly.cublog.cn GTK+/DirectFB

In Ubuntu 10.4 Desktop and "root" login

apt-get install build-essential libncurses5-dev

apt-get install autoconf

apt-get install libtool

apt-get install gettext

apt-get install libglib2.0-dev

apt-get install libgtk2.0-dev

Arm Linux Debug IDE Eclipse

////////////////////// All unbuntu fourm ////////////////////////////////////
http://wiki.ubuntu-tw.org/

//////////install Vmware7.1 + Ubuntu 10.4 install Guide ////////////////////////////////////////////
http://www.vcbeta.net/read.php/424.htm
http://releases.ubuntu.com/

http://os.51cto.com/art/200901/104983.htm
http://www.cnitblog.com/aimilo2008/archive/2009/07/22/60286.html (reference red hat install)

///////// Gcc install recommand use root to work ////////////////////////////////////////////
sudo passwd root
then logout and login with root
apt-get install build-essential

cross compile gtk+gtk-directfb+arm-linux (arm-linux-gcc-3.4.4+glib-2.3.5)

Refer to 一生逍遙
2010年7月1日 by Jesse Stone Taiwan fatalfeel@hotmail.com

參考文獻1:http://blog.csdn.net/kendych/archive/2008/09/18/2947638.aspx
參考文獻2:https://wiki.mozilla.org/Mobile/DFBPorting
參考文獻3:http://blog.csdn.net/absurd/category/228434.aspx
參考文獻4:http://hi.baidu.com/chinalmy/blog/item/da814a5450a9e352574e0046.html
參考文獻5:http://www.docin.com/p-44613303.html
address1:http://hi.baidu.com/wstone_h/blog/item/e415151f82a45564f724e46d.html
address2:http://hi.baidu.com/wstone_h/blog/item/9cd8a010061bf6fbc3ce7901.html