<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5807842345457637093</id><updated>2026-04-13T05:04:56.145+08:00</updated><category term="linux"/><category term="MCU"/><category term="8051"/><category term="android"/><category term="PIC"/><category term="RaspBerry Pi"/><category term="embedded"/><category term="porting"/><category term="Basic"/><category term="arm"/><category term="camera"/><category term="pidora"/><category term="DM368"/><category term="EDA"/><category term="IP camera"/><category term="LCD"/><category term="USB"/><category term="UVC"/><category term="Zigbee"/><category term="code"/><category term="editor"/><category term="fedora"/><category term="gcc"/><category term="kernel"/><category term="kicad"/><category term="python"/><category term="source"/><category term="單晶片、8051、PIC"/><category term="單晶片開發板製作"/><category term="基礎篇"/><category term="攝影機"/><category term="CC2530"/><category term="CC2630"/><category term="DC"/><category term="DM355"/><category term="DS1821"/><category term="Davinci"/><category term="DirectShow"/><category term="Free"/><category term="GPIO"/><category term="JP60"/><category term="Japan"/><category term="LED"/><category term="MSP430"/><category term="OCR"/><category term="OV5647"/><category term="Open Source"/><category term="OrCAD"/><category term="OrCAD.Protel"/><category term="Protel"/><category term="RTSP"/><category term="S3C2440A"/><category term="SAMSUNG"/><category term="TI"/><category term="Toolkit"/><category term="avr"/><category term="barcode"/><category term="beagleboard"/><category term="codeblocks"/><category term="cross-compile"/><category term="cscope"/><category term="decode"/><category term="digital clock"/><category term="display"/><category term="driver"/><category term="ecb"/><category term="emacs"/><category term="gputils"/><category term="image analysis"/><category term="image processing"/><category term="kscope"/><category term="live555"/><category term="mjpg-streamer"/><category term="morot"/><category term="notes"/><category term="omap3530"/><category term="radio clock"/><category term="sdcc"/><category term="software"/><category term="speaker、music note、PIC"/><category term="stepper motor"/><category term="thermometer"/><category term="touch screen"/><category term="ubuntu"/><category term="uclibc"/><category term="wireless"/><category term="z80"/><category term="嵌入式"/><category term="移植"/><category term="軟體"/><category term="開發包"/><title type='text'>Wizign</title><subtitle type='html'>Simple is nice!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>32</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-5168281422739434108</id><published>2017-07-20T23:31:00.001+08:00</published><updated>2017-07-20T23:31:38.460+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="arm"/><category scheme="http://www.blogger.com/atom/ns#" term="CC2630"/><category scheme="http://www.blogger.com/atom/ns#" term="LCD"/><category scheme="http://www.blogger.com/atom/ns#" term="MCU"/><category scheme="http://www.blogger.com/atom/ns#" term="wireless"/><category scheme="http://www.blogger.com/atom/ns#" term="Zigbee"/><title type='text'>BCD LCD + CC2630</title><content type='html'>&amp;nbsp;&amp;nbsp;&amp;nbsp; This is a demo, how to transmit image data to a BCD LCD panel. This system includes:&lt;br /&gt;
1) PC base software : It reads image files, then convert it to black-white image format, finally, send the image data to CC2630 control board.&lt;br /&gt;
2) CC2630 zigbee coordinator with USB&amp;nbsp; connector : This device connect to a PC, it will communicate with PC base software by USB virtual COM port.&lt;br /&gt;
3) CC2630 zigbee&amp;nbsp; device : This device is powered by battery, it will receive image data from CC2630 zigbee coordinator, then display the image on the BCD LCD panel.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbeEvScogNqGf9cY67Dn4WuMCnkZk8QqOm-Y_KUg3tE51I9TVozXjC8JQWHeXoOFZ-qxQDP-fu0wKDNb6Tssy4TI_cB6K5OHbrL6wStip0zvCLyUGcimKuhoy0T78vInhOqoKyuDHh5fs/s1600/IMG_0529.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1196&quot; data-original-width=&quot;1600&quot; height=&quot;239&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbeEvScogNqGf9cY67Dn4WuMCnkZk8QqOm-Y_KUg3tE51I9TVozXjC8JQWHeXoOFZ-qxQDP-fu0wKDNb6Tssy4TI_cB6K5OHbrL6wStip0zvCLyUGcimKuhoy0T78vInhOqoKyuDHh5fs/s320/IMG_0529.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBM3WbxhDryWQYMceDwCJ2i51Rv5eqvVmTBQVsI1Oq5B2q0U3ZczO8XwiT91i4J43VMPRdkRmbwqhH-WEOpr2TkuV11froUBIK_BjvPl7Hw-6xGVuRuCgZMtfoZwpgi95HNUY7zXymZ-k/s1600/20170509-ehospital02.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1106&quot; data-original-width=&quot;1482&quot; height=&quot;238&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBM3WbxhDryWQYMceDwCJ2i51Rv5eqvVmTBQVsI1Oq5B2q0U3ZczO8XwiT91i4J43VMPRdkRmbwqhH-WEOpr2TkuV11froUBIK_BjvPl7Hw-6xGVuRuCgZMtfoZwpgi95HNUY7zXymZ-k/s320/20170509-ehospital02.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/5168281422739434108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/5168281422739434108' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/5168281422739434108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/5168281422739434108'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2017/07/bcd-lcd-cc2630.html' title='BCD LCD + CC2630'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbeEvScogNqGf9cY67Dn4WuMCnkZk8QqOm-Y_KUg3tE51I9TVozXjC8JQWHeXoOFZ-qxQDP-fu0wKDNb6Tssy4TI_cB6K5OHbrL6wStip0zvCLyUGcimKuhoy0T78vInhOqoKyuDHh5fs/s72-c/IMG_0529.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-4038514118358806641</id><published>2015-08-03T06:39:00.000+08:00</published><updated>2015-08-03T06:53:34.074+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="IP camera"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="mjpg-streamer"/><category scheme="http://www.blogger.com/atom/ns#" term="OV5647"/><category scheme="http://www.blogger.com/atom/ns#" term="pidora"/><category scheme="http://www.blogger.com/atom/ns#" term="RaspBerry Pi"/><title type='text'>Pidora - Use Raspberry Pi as an IP Camera (mjpg-streamer)</title><content type='html'>&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; This is a practice, I use Raspberry Pi (Raspberry Pi Model B+ not work?) as an IP camera.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Prepare Hardwares&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Raspberry Pi&lt;br /&gt;
P5V04AA (SUNNY CMOS camera module, image sensor is OV5647)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Install Packages (by root user)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
# yum install &#39;raspberrypi-vc-*&#39;&lt;br /&gt;
&lt;br /&gt;
# vcgencmd get_camera&lt;br /&gt;
supported=1 &lt;span style=&quot;color: red;&quot;&gt;detected=1&lt;/span&gt; &amp;lt;== it means that camera has worked!&lt;!-----&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;


&lt;style type=&quot;text/css&quot;&gt;
    li { list-style: none;  margin: 0; }
    p { margin: 0; }

    span.l { color: red; font-weight: bold; }

    a.mapnode:link {text-decoration: none; color: black; }
    a.mapnode:visited {text-decoration: none; color: black; }
    a.mapnode:active {text-decoration: none; color: black; }
    a.mapnode:hover {text-decoration: none; color: black; background: #eeeee0; }

&lt;/style&gt;



&lt;br /&gt;
&lt;span style=&quot;font-family: SansSerif,sans-serif;&quot;&gt;# yum install libjpeg-turbo-devel&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: SansSerif,sans-serif;&quot;&gt;# yum install libv4l-dev&lt;/span&gt;el &lt;br /&gt;
&lt;br /&gt;
# ln -s /usr/include/linux/videodev2.h /usr/include/linux/videodev.h&lt;br /&gt;
&lt;br /&gt;
# cd /usr/src&lt;br /&gt;
# git clone https://github.com/jacksonliam/mjpg-streamer.git ./mjpg-streamer-git&lt;br /&gt;
# cd mjpg-streamer-git/mjpg-streamer-experimental&lt;br /&gt;
# make clean all&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;
    li { list-style: none;  margin: 0; }
    p { margin: 0; }

    span.l { color: red; font-weight: bold; }

    a.mapnode:link {text-decoration: none; color: black; }
    a.mapnode:visited {text-decoration: none; color: black; }
    a.mapnode:active {text-decoration: none; color: black; }
    a.mapnode:hover {text-decoration: none; color: black; background: #eeeee0; }

&lt;/style&gt;



&lt;br /&gt;
# cp mjpg_streamer /usr/local/bin
&lt;br /&gt;
# cp input_raspicam.so output_http.so /usr/local/lib/.&lt;br /&gt;
# cp -R www /usr/local/www&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Run mjpeg streamer server&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
# LD_LIBRARY_PATH=/usr/local/lib mjpg_streamer -i &quot;input_raspicam.so -fps 15 -q 50 -x 640 -y 480&quot; -o &quot;output_http.so -w /usr/local/www&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; It will display message as following: &lt;br /&gt;
&amp;nbsp;i: fps.............: 15&lt;br /&gt;
&amp;nbsp;i: resolution........: 640 x 480&lt;br /&gt;
&amp;nbsp;i: camera parameters..............:&lt;br /&gt;
&lt;br /&gt;
Sharpness 0, Contrast 0, Brightness 50&lt;br /&gt;
Saturation 0, ISO 400, Video Stabilisation No, Exposure compensation 0&lt;br /&gt;
Exposure Mode &#39;auto&#39;, AWB Mode &#39;auto&#39;, Image Effect &#39;none&#39;&lt;br /&gt;
Metering Mode &#39;average&#39;, Colour Effect Enabled No with U = 128, V = 128&lt;br /&gt;
Rotation 0, hflip No, vflip No&lt;br /&gt;
&amp;nbsp;o: www-folder-path...: /usr/local/www/&lt;br /&gt;
&amp;nbsp;o: HTTP TCP port.....: 8080&lt;br /&gt;
&amp;nbsp;o: username:password.: disabled&lt;br /&gt;
&amp;nbsp;o: commands..........: enabled&lt;br /&gt;
&amp;nbsp;i: Starting Camera&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Test&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
View on your browser by URL:&lt;br /&gt;
&lt;br /&gt;
http://{IP address}:8080&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnkcI_k4l8eaulFtOi4X3U9kZunETFlIQKVM-bjLIEmTBu0YIv2g8aTKLy4f8lMbn5wsV5PsoxpJoaxAOpJrWnSeWonge3jtwHur6NPsNxxBEXc4XgKPsxANo6MKetPX1LSEBavOvCSQQ/s1600/20150803-raspi-p5v04aa.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;219&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnkcI_k4l8eaulFtOi4X3U9kZunETFlIQKVM-bjLIEmTBu0YIv2g8aTKLy4f8lMbn5wsV5PsoxpJoaxAOpJrWnSeWonge3jtwHur6NPsNxxBEXc4XgKPsxANo6MKetPX1LSEBavOvCSQQ/s320/20150803-raspi-p5v04aa.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Reference&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://miguelmota.com/blog/raspberry-pi-camera-board-video-streaming/&quot; target=&quot;_blank&quot;&gt;Raspberry Pi camera board video streaming&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/4038514118358806641/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/4038514118358806641' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/4038514118358806641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/4038514118358806641'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2015/08/pidora-use-raspberry-pi-as-ip-camera.html' title='Pidora - Use Raspberry Pi as an IP Camera (mjpg-streamer)'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnkcI_k4l8eaulFtOi4X3U9kZunETFlIQKVM-bjLIEmTBu0YIv2g8aTKLy4f8lMbn5wsV5PsoxpJoaxAOpJrWnSeWonge3jtwHur6NPsNxxBEXc4XgKPsxANo6MKetPX1LSEBavOvCSQQ/s72-c/20150803-raspi-p5v04aa.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-3338741778341364149</id><published>2015-07-24T23:54:00.000+08:00</published><updated>2015-07-24T23:54:05.809+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="image analysis"/><category scheme="http://www.blogger.com/atom/ns#" term="image processing"/><category scheme="http://www.blogger.com/atom/ns#" term="IP camera"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="live555"/><category scheme="http://www.blogger.com/atom/ns#" term="OCR"/><category scheme="http://www.blogger.com/atom/ns#" term="RTSP"/><title type='text'>Monitor IP camera on PC by RTSP</title><content type='html'>&amp;nbsp;&amp;nbsp;&amp;nbsp; This test program is an extension of my previous test program (article &quot;&lt;a href=&quot;http://wizign.blogspot.tw/2013/12/use-usb-camera-as-barcode-reader-image.html&quot; target=&quot;_blank&quot;&gt;Use USB camera as barcode reader - image resolution is 1280 x 720&lt;/a&gt;&quot;), I replace the USB communication interface by RTSP communication interface.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; The RTSP communication implements live555 library, all my programming environment is done by VC++.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Except the capturing image from IP camera, some image processing (image filters - gray, noise, negative, contour, histogram) is done, and image analysis (OCR, optical character recognition) is tested, too.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe width=&quot;320&quot; height=&quot;266&quot; class=&quot;YOUTUBE-iframe-video&quot; data-thumbnail-src=&quot;https://i.ytimg.com/vi/Ybl0FZ6Hyto/0.jpg&quot; src=&quot;https://www.youtube.com/embed/Ybl0FZ6Hyto?feature=player_embedded&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/3338741778341364149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/3338741778341364149' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/3338741778341364149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/3338741778341364149'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2015/07/monitor-ip-camera-on-pc-by-rtsp.html' title='Monitor IP camera on PC by RTSP'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/Ybl0FZ6Hyto/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-489774167638632640</id><published>2015-07-07T11:16:00.003+08:00</published><updated>2015-07-07T11:35:37.290+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GPIO"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="pidora"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="RaspBerry Pi"/><title type='text'>Python - GPIO control on Pidora for Raspberry Pi Model B+</title><content type='html'>&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkc-xgs1AgIXqqIk3-O-yfbKfPoFWtdA0P3VcPTqdthoW3-20TcAqe-cKLyPJULO3jhSZqclS7-ij2HLxS0tCotRMZ85_yeVPhBS7DBM8YvjOS8cnY4LigccYxtBmgYMtVJXEOl6dNun4/s1600/GPIO.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkc-xgs1AgIXqqIk3-O-yfbKfPoFWtdA0P3VcPTqdthoW3-20TcAqe-cKLyPJULO3jhSZqclS7-ij2HLxS0tCotRMZ85_yeVPhBS7DBM8YvjOS8cnY4LigccYxtBmgYMtVJXEOl6dNun4/s320/GPIO.png&quot; width=&quot;306&quot; /&gt;&lt;/a&gt;On the Raspberry Pi Model B+ board, there are many GPIO ports, here we make a simple test, and try to understand how to control GPIO ports by python?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Concept of hardware control&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Generally, an IO port of an IC (e.g. MCU, ARM, GPU) could be have multiple functions. So, when we write a control program to control these IO ports, it can be in 3 steps:&lt;br /&gt;
1) Configure the hardware function&lt;br /&gt;
2) Execute the control function&lt;br /&gt;
3) Release the hardware function&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: right;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Install RPi.GPIO package&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
There are many libraries(such as RPi.GPIO, WiringPi, or pigpio library) can do the GPIO control. At here, we are using RPi.GPIO library.&lt;br /&gt;
&lt;br /&gt;
Usually, read or write GPIO, the user must be root.&lt;br /&gt;
&lt;br /&gt;
Install packages:&lt;br /&gt;
# yum update
&lt;br /&gt;
# yum install python-setuptools
&lt;br /&gt;
# yum install python-pip
&lt;br /&gt;
&lt;span style=&quot;font-family: SansSerif,sans-serif;&quot;&gt;# easy_install pyerial &amp;nbsp; &amp;lt;== serial communication package&lt;/span&gt;&lt;br /&gt;
# yum install python-devel
&lt;br /&gt;
&lt;span style=&quot;font-family: SansSerif,sans-serif;&quot;&gt;# pip install RPi.GPIO &amp;nbsp; &amp;lt;== GPIO control package&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: SansSerif,sans-serif;&quot;&gt;&lt;/span&gt;

# pip install cython
&lt;br /&gt;
&lt;span style=&quot;font-family: SansSerif,sans-serif;&quot;&gt;# reboot&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Write a GPIO input/output control program&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
We write a simple test program to test the GPIO functions. We define functions:&lt;br /&gt;
GPIO12 (pin32) - output pin&lt;br /&gt;
GPIO13 (pin33) - input pin&lt;br /&gt;
&lt;br /&gt;
Example code:&lt;br /&gt;
====================================================================&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;import time&lt;br /&gt;import RPi.GPIO as GPIO&lt;br /&gt;import kbhit # read keybard value, source code is at bottom&lt;br /&gt;&lt;br /&gt;def InputEvent(channel):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    # got input event&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;print &quot;[INPUT] Got input event.&quot;&lt;br /&gt;&lt;br /&gt;if __name__ == &#39;__main__&#39;:&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;# configure the GPIO hardware condition&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;GPIO.setmode(GPIO.BCM)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;GPIO.setup(12, GPIO.OUT) # GPIO12, pin32, output control&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;GPIO.setup(13, GPIO.IN, pull_up_down=GPIO.PUD_UP) # GPIO13, pin33, input control&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; G&lt;/span&gt;PIO.add_event_detect(13, GPIO.FALLING, callback=InputEvent)&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;kb = KBHit()&lt;br /&gt;    &lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;bPin32On = False&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;while True:&lt;br /&gt;        &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;# if the &#39;ESC&#39; key is pressed, stop the while loop&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;if kb.kbhit():&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;c = kb.getch()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;if ord(c) == 27: # ESC&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;break&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;# Set On/Off pin32&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;print &quot;[OUTPUT] Set output event.&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;if bPin32On: # True&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;GPIO.output(12,GPIO.HIGH)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;else: # False&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;            GPIO.output(12,GPIO.LOW)&lt;br /&gt;        &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;# switch signal&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;bPin32On = not bPin32On&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;time.sleep(2.0)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;kb.set_normal_term()&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;# release the hardware configuration&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPIO.cleanup()&lt;/span&gt;&lt;br /&gt;
====================================================================&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Get the keyboard value&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The KBHit class is used to monitor the non-blocking keyboard event.&lt;br /&gt;
Source code: &lt;br /&gt;
====================================================================&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;import os&lt;br /&gt;&lt;br /&gt;# Windows&lt;br /&gt;if os.name == &#39;nt&#39;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; import msvcrt&lt;br /&gt;# Posix (Linux, OS X)&lt;br /&gt;else:&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;import sys&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;import termios&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;import atexit&lt;br /&gt;    &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;from select import select&lt;br /&gt;&lt;br /&gt;class KBHit:&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;    def __init__(self):&lt;br /&gt;        &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&#39;&#39;&#39;Creates a KBHit object that you can call to do various keyboard things.&lt;br /&gt;        &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&#39;&#39;&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;if os.name == &#39;nt&#39;:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;pass&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;else:&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;# Save the terminal settings&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;self.fd = sys.stdin.fileno()&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;self.new_term = termios.tcgetattr(self.fd)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;self.old_term = termios.tcgetattr(self.fd)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;# New terminal setting unbuffered&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;self.new_term[3] = (self.new_term[3] &amp;amp; ~termios.ICANON &amp;amp; ~termios.ECHO)&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;termios.tcsetattr(self.fd, termios.TCSAFLUSH, self.new_term)&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;# Support normal-terminal reset at exit&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;atexit.register(self.set_normal_term)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;def set_normal_term(self):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&#39;&#39;&#39; Resets to normal terminal.  On Windows this is a no-op.&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;        &#39;&#39;&#39;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;if os.name == &#39;nt&#39;:&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;pass&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;else:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;termios.tcsetattr(self.fd, termios.TCSAFLUSH, self.old_term)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;def set_curses_term(self):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&#39;&#39;&#39;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;        switch to unbuffered terminal&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;:return:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&#39;&#39;&#39;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;if os.name == &#39;nt&#39;:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;pass&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;else:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;termios.tcsetattr(self.fd, termios.TCSAFLUSH, self.new_term)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;def putch(self, ch):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;if os.name == &#39;nt&#39;:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;msvcrt.putch(ch.encode(&#39;ascii&#39;, &#39;ignore&#39;))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;else:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;sys.stdout.write(ch)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;def getch(self):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&#39;&#39;&#39; Returns a keyboard character after kbhit() has been called.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;            Should not be called in the same program as getarrow().&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&#39;&#39;&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;s = &#39;&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; i&lt;/span&gt;&lt;/span&gt;f os.name == &#39;nt&#39;:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;return msvcrt.getch().decode(&#39;utf-8&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;else:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;return sys.stdin.read(1)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;def getche(self):&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;ch = self.getch()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;self.putch(ch)&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;return ch&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;def getarrow(self):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&#39;&#39;&#39; Returns an arrow-key code after kbhit() has been called. Codes are&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;0 : up&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;1 : right&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;2 : down&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;3 : left&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;Should not be called in the same program as getch().&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&#39;&#39;&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;if os.name == &#39;nt&#39;:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;msvcrt.getch() # skip 0xE0&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;c = msvcrt.getch()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;vals = [72, 77, 80, 75]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;else:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;c = sys.stdin.read(3)[2]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;vals = [65, 67, 66, 68]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;return vals.index(ord(c.decode(&#39;utf-8&#39;)))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;def kbhit(self):&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&#39;&#39;&#39; Returns True if keyboard character was hit, False otherwise.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&#39;&#39;&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;if os.name == &#39;nt&#39;:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;return msvcrt.kbhit()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;else:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;dr,dw,de = select([sys.stdin], [], [], 0)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;return dr != []&lt;/span&gt;&lt;br /&gt;
==================================================================== &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Python is a powerful programming tool, it can satisfy the most requirements of our daily tasks. If you want to get the high performance of a program, assember, C, or C++ would be the best choice.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Reference&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;https://pypi.python.org/pypi/RPi.GPIO&quot; target=&quot;_blank&quot;&gt;RPi.GPIO&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://www.python.org/&quot; target=&quot;_blank&quot;&gt;Python.org&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/489774167638632640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/489774167638632640' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/489774167638632640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/489774167638632640'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2015/07/python-gpio-control-on-pidora-for.html' title='Python - GPIO control on Pidora for Raspberry Pi Model B+'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkc-xgs1AgIXqqIk3-O-yfbKfPoFWtdA0P3VcPTqdthoW3-20TcAqe-cKLyPJULO3jhSZqclS7-ij2HLxS0tCotRMZ85_yeVPhBS7DBM8YvjOS8cnY4LigccYxtBmgYMtVJXEOl6dNun4/s72-c/GPIO.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-5463438535915488498</id><published>2015-07-02T21:15:00.001+08:00</published><updated>2015-07-02T21:42:54.269+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="embedded"/><category scheme="http://www.blogger.com/atom/ns#" term="fedora"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="pidora"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="RaspBerry Pi"/><title type='text'>Run Pidora on Raspberry Pi Model B+</title><content type='html'>&lt;span style=&quot;font-size: large;&quot;&gt;Inroduction&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Pidora is a Fedora Remix optimized for the Raspberry Pi computer. So, it is a good candidate choice for implementation if you are familiar with Fedora.&lt;br /&gt;
Here, I present the installation steps of installing Pidora 20 on Raspberry Pi Model B+ board. All the preparing works are done on Fedora 20.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Download image file&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://pidora.ca/pidora/releases/20/images/Pidora-2014-R3.zip&quot;&gt;http://pidora.ca/pidora/releases/20/images/Pidora-2014-R3.zip&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Write image file to SD card&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
dd (convert and copy a file) is a command-line utility for Unix/Linux, I use dd to write Pidora-2014-R3.img file to SD card.&lt;br /&gt;
&lt;br /&gt;
# unzip Pidora-2014-R3.zip (uncompress to Pidora-2014-R3.img)&lt;br /&gt;
# dd if=Pidora-2014-R3.img of=/dev/sdb bs=4M (The SD card is at /dev/sdb)&lt;br /&gt;
&lt;br /&gt;
On Windows, you can write image file by &lt;a href=&quot;http://sourceforge.net/projects/win32diskimager/&quot; target=&quot;_blank&quot;&gt;Win32 Disk Image&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
After the dd command has done, remove the SD card and plug into socket, again. It would be mounted at 2 path:&lt;br /&gt;
/run/media/{user}/BOOT&lt;br /&gt;
/run/media/{user}/rootfs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Extra works&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The default running job is display X window on TV/Monitor via HDMI interface, and the default network is using dynamic IP address. If you want to run it on console mode with static IP address, there is some extra work that you should do.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;# vi /run/media/{user}/BOOT/headless&lt;/b&gt;&lt;br /&gt;
IPADDR=192.168.1.19&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # the static IP address&lt;br /&gt;
NETMASK=255.255.255.0 &lt;br /&gt;
GATEWAY=192.168.1.1 &lt;br /&gt;
RESIZE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # extend the SD card size to its real size&lt;br /&gt;
SWAP=512&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;# vi /run/media/&lt;/b&gt;&lt;b&gt;&lt;b&gt;{user}&lt;/b&gt;/rootfs/etc/sysconfig/network-scripts/ifcfg-Wired_connection_1&lt;/b&gt;&lt;br /&gt;
TYPE=Ethernet&lt;br /&gt;
BOOTPROTO=none&lt;br /&gt;
IPADDR0=192.168.1.19&amp;nbsp;&amp;nbsp;&amp;nbsp; # the static IP address&lt;br /&gt;
PREFIX0=24&lt;br /&gt;
GATEWAY0=192.168.1.1&lt;br /&gt;
DNS1=168.95.1.1&lt;br /&gt;
DNS2=168.95.192.1&lt;br /&gt;
DEFROUTE=yes&lt;br /&gt;
IPV4_FAILURE_FATAL=yes&lt;br /&gt;
IPV6INIT=yes&lt;br /&gt;
IPV6_AUTOCONF=yes&lt;br /&gt;
IPV6_DEFROUTE=yes&lt;br /&gt;
IPV6_PEERDNS=yes&lt;br /&gt;
IPV6_PEERROUTES=yes&lt;br /&gt;
IPV6_FAILURE_FATAL=no&lt;br /&gt;
NAME=&quot;Wired connection 1&quot;&lt;br /&gt;
UUID=b2df4348-a75e-4e80-ab3f-470154e1fc8c&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Install/Update application packages&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Some of my works is done by python with serial communication, therefore, I have to install some packages:&lt;br /&gt;
&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;
    li { list-style: none;  margin: 0; }
    p { margin: 0; }

    span.l { color: red; font-weight: bold; }

    a.mapnode:link {text-decoration: none; color: black; }
    a.mapnode:visited {text-decoration: none; color: black; }
    a.mapnode:active {text-decoration: none; color: black; }
    a.mapnode:hover {text-decoration: none; color: black; background: #eeeee0; }

&lt;/style&gt;



&lt;br /&gt;
# yum update
&lt;br /&gt;
# yum install python-setuptools
&lt;br /&gt;
# yum install python-pip
&lt;br /&gt;
&lt;span style=&quot;font-family: SansSerif,sans-serif;&quot;&gt;# easy_install pyerial &amp;nbsp; &amp;lt;== serial communication package&lt;!------&gt;&lt;!------&gt;&lt;/span&gt;&lt;br /&gt;
# yum install python-devel
&lt;br /&gt;
# yum install libxml2 libxslt
&lt;br /&gt;
# yum install libxslt-devel
&lt;br /&gt;
&lt;span style=&quot;font-family: SansSerif,sans-serif;&quot;&gt;# pip install RPi.GPIO &amp;nbsp; &amp;lt;== GPIO control package&lt;!------&gt;&lt;!------&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: SansSerif,sans-serif;&quot;&gt;&lt;/span&gt;

# pip install cython
&lt;br /&gt;
&lt;span style=&quot;font-family: SansSerif,sans-serif;&quot;&gt;# reboot&lt;/span&gt;


&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Conclusion&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Except the write image to SD card process and disk partition policy is different from Fedora on PC, other works are same as you work on Fedora environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Reference&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://pidora.ca/&quot; target=&quot;_blank&quot;&gt;Pidroa official site&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://sourceforge.net/projects/win32diskimager/&quot; target=&quot;_blank&quot;&gt;Win32 Disk Image&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/5463438535915488498/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/5463438535915488498' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/5463438535915488498'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/5463438535915488498'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2015/07/run-pidora-on-raspberry-pi-model-b.html' title='Run Pidora on Raspberry Pi Model B+'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-4630428092729585141</id><published>2013-12-10T17:34:00.001+08:00</published><updated>2015-07-25T00:17:46.030+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="barcode"/><category scheme="http://www.blogger.com/atom/ns#" term="camera"/><category scheme="http://www.blogger.com/atom/ns#" term="DirectShow"/><category scheme="http://www.blogger.com/atom/ns#" term="DM368"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="USB"/><category scheme="http://www.blogger.com/atom/ns#" term="UVC"/><category scheme="http://www.blogger.com/atom/ns#" term="攝影機"/><title type='text'>Use USB camera as barcode reader - image resolution is 1280 x 720</title><content type='html'>&amp;nbsp;&amp;nbsp;&amp;nbsp; This is a test, I use my USB camera (1280x720 pixels) to analyze barcode informaiton. It works!&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; This test program implements DirectShow filters, capture USB camera image by UVC(USB video class) interface.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/1h9OkfKW0-4?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjveUdEFa9t-orOhswWX7VATMXrdzbf3HB1qr0FnLhgv3NULbjp72Asb81xsdAcWlAsIgldHADAiVDtAbBGueJkkcReWsQuoYCEYymH4FjjCt8WXKxw6G2coFsDFm4rfkACsMNQSaKaj5o/s1600/code-39-2-640.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;206&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjveUdEFa9t-orOhswWX7VATMXrdzbf3HB1qr0FnLhgv3NULbjp72Asb81xsdAcWlAsIgldHADAiVDtAbBGueJkkcReWsQuoYCEYymH4FjjCt8WXKxw6G2coFsDFm4rfkACsMNQSaKaj5o/s1600/code-39-2-640.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWjayrhm3aR0PgPkuoXPS8Yc8t5Mv3OnNAM_oLBdWbqW6sdH0yOe0MTrfmNDelXnQHKGkc9syr_9YILoB77GsfU1-Kz1YFtivmEvKun8ufnU74i_KswMcsSVUn33X4IdxpERyHaIzYo7o/s1600/code-39-640.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;204&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWjayrhm3aR0PgPkuoXPS8Yc8t5Mv3OnNAM_oLBdWbqW6sdH0yOe0MTrfmNDelXnQHKGkc9syr_9YILoB77GsfU1-Kz1YFtivmEvKun8ufnU74i_KswMcsSVUn33X4IdxpERyHaIzYo7o/s1600/code-39-640.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi493sJETa3r4BVJp-wSwOoXftWm34pUTBhqXFpnlfZJ42sX65TPRQAfQBzq98D6XLf1ZtzTj33c-mK6n_wgx8lR18zI1JfbXGeYW6chX8yc0SaAhew1BCjQc4oaVHcKO7gy3SjcDklRQM/s1600/code-ean-8-640.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;205&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi493sJETa3r4BVJp-wSwOoXftWm34pUTBhqXFpnlfZJ42sX65TPRQAfQBzq98D6XLf1ZtzTj33c-mK6n_wgx8lR18zI1JfbXGeYW6chX8yc0SaAhew1BCjQc4oaVHcKO7gy3SjcDklRQM/s1600/code-ean-8-640.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/4630428092729585141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/4630428092729585141' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/4630428092729585141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/4630428092729585141'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2013/12/use-usb-camera-as-barcode-reader-image.html' title='Use USB camera as barcode reader - image resolution is 1280 x 720'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjveUdEFa9t-orOhswWX7VATMXrdzbf3HB1qr0FnLhgv3NULbjp72Asb81xsdAcWlAsIgldHADAiVDtAbBGueJkkcReWsQuoYCEYymH4FjjCt8WXKxw6G2coFsDFm4rfkACsMNQSaKaj5o/s72-c/code-39-2-640.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-603051635879316850</id><published>2013-12-05T16:54:00.001+08:00</published><updated>2014-06-14T22:13:16.512+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="beagleboard"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="omap3530"/><title type='text'>Porting Android 4.0.1 on BeagleBoard Rev C3</title><content type='html'>&amp;nbsp;&amp;nbsp;&amp;nbsp; I try to port android 4.0.1 on BeagleBoard Rev C3, it works!&lt;br /&gt;
The video of system booting is on youtube:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/6J4tAc3vvVc?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; I download the android source code from site: https://bitbucket.org/sola/android_manifest, here, &lt;a href=&quot;http://www.cnx-software.com/2011/11/24/android-4-0-on-beagleboard-and-beagleboard-xm/&quot; target=&quot;_blank&quot;&gt;Android 4.0 on BeagleBoard and Beagleboard-xM&lt;/a&gt;, is a good tutorial of building linux kernel, android, and root file system.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; The BeagleBoard Rev C3 (CPU is OMAP3530 includes ARM Cortex A8).&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB2-0CXN7ZNHNnrY-f92SBiuVQ7WqJu0ya8zefEbQs8emaNXdSFZIy-IWt5EMWT0CvzC0lIFMl6IOi_enoxirOn7O-eboGno3557PAmGetISq_4DpdnQWv2y9Xku59PtYlY4Cq6dQ2D1g/s1600/DSCN8211-480x360.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB2-0CXN7ZNHNnrY-f92SBiuVQ7WqJu0ya8zefEbQs8emaNXdSFZIy-IWt5EMWT0CvzC0lIFMl6IOi_enoxirOn7O-eboGno3557PAmGetISq_4DpdnQWv2y9Xku59PtYlY4Cq6dQ2D1g/s1600/DSCN8211-480x360.jpg&quot; height=&quot;240&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; The locked screen.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOqQlHrHMVQdc_-aL2R28cwfnxx4yep_856Zgx6AUm7gJfSYfMWhaIK6GT-ePQojVnb9rVoQ0lt6IEZDE-hsrmgVxAwmSayEw4NwipJdjEsx-sWsNtTvx17oX6g3hWkLNbxySaq3Ljy8k/s1600/DSCN8214-480x360.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOqQlHrHMVQdc_-aL2R28cwfnxx4yep_856Zgx6AUm7gJfSYfMWhaIK6GT-ePQojVnb9rVoQ0lt6IEZDE-hsrmgVxAwmSayEw4NwipJdjEsx-sWsNtTvx17oX6g3hWkLNbxySaq3Ljy8k/s1600/DSCN8214-480x360.jpg&quot; height=&quot;240&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; The apps list.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJaKITml2qmDiExW3LE31d5GLIPkBYX6fX-KEGFdExFMaIvC4OhHeNSc_BlM_NI2ykXhxUjIKEx74gCBW8sGcjn7GkWlYvUFX2Z7-A4m1ZiZ9oJ5du53vndp5r-C9S6ijpaA7F09R7jg8/s1600/DSCN8215-480x360.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJaKITml2qmDiExW3LE31d5GLIPkBYX6fX-KEGFdExFMaIvC4OhHeNSc_BlM_NI2ykXhxUjIKEx74gCBW8sGcjn7GkWlYvUFX2Z7-A4m1ZiZ9oJ5du53vndp5r-C9S6ijpaA7F09R7jg8/s1600/DSCN8215-480x360.jpg&quot; height=&quot;240&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; OS kernel version.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHxZb6juN8zDDoYaYY6X9-nMBnpIeoiIbjUgL5nQEIU7-V5NA6bxm0YFt8neccTgkOJjuS95he9OCVCbUJvUYlVjb9URkbBd1Zt6YeUgZhTvZweZ32gy6xl9_IH8gw7TWT4PGe2WU9FOY/s1600/DSCN8217-480x360.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHxZb6juN8zDDoYaYY6X9-nMBnpIeoiIbjUgL5nQEIU7-V5NA6bxm0YFt8neccTgkOJjuS95he9OCVCbUJvUYlVjb9URkbBd1Zt6YeUgZhTvZweZ32gy6xl9_IH8gw7TWT4PGe2WU9FOY/s1600/DSCN8217-480x360.jpg&quot; height=&quot;240&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/603051635879316850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/603051635879316850' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/603051635879316850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/603051635879316850'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2013/12/porting-android-401-on-beagleboard-rev.html' title='Porting Android 4.0.1 on BeagleBoard Rev C3'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB2-0CXN7ZNHNnrY-f92SBiuVQ7WqJu0ya8zefEbQs8emaNXdSFZIy-IWt5EMWT0CvzC0lIFMl6IOi_enoxirOn7O-eboGno3557PAmGetISq_4DpdnQWv2y9Xku59PtYlY4Cq6dQ2D1g/s72-c/DSCN8211-480x360.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-1313610020246729431</id><published>2013-10-21T08:53:00.001+08:00</published><updated>2014-06-14T21:46:56.821+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="8051"/><category scheme="http://www.blogger.com/atom/ns#" term="arm"/><category scheme="http://www.blogger.com/atom/ns#" term="CC2530"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="MSP430"/><category scheme="http://www.blogger.com/atom/ns#" term="RaspBerry Pi"/><category scheme="http://www.blogger.com/atom/ns#" term="Zigbee"/><title type='text'>Sensory System by Zigbee and Embedded Linux</title><content type='html'>&amp;nbsp;&amp;nbsp;&amp;nbsp; This is a prototype of sensory system that it integrates sensor devices, embedded linux device, and zigbee wireless communication.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/pgj0Y6nT66g?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; The application is portable, it can run on Windows, Linux, and embedded linux.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKqQjbz5jL6SJL-vE1nCxsJP7wqgY769TW2zaDMfs3cKpFrfdGhMOobJKhDlnZm6rEpw6yjrV8O5xrTjtd_yiRPHC13wnx0MkJVK4Hmaxf0qN2GKjeBPl5RiwRbYAqGSeqdMTyEtX3P4Y/s1600/20131020-aide.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKqQjbz5jL6SJL-vE1nCxsJP7wqgY769TW2zaDMfs3cKpFrfdGhMOobJKhDlnZm6rEpw6yjrV8O5xrTjtd_yiRPHC13wnx0MkJVK4Hmaxf0qN2GKjeBPl5RiwRbYAqGSeqdMTyEtX3P4Y/s1600/20131020-aide.jpg&quot; height=&quot;196&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; The sensor devices are light sensor and power meter. The development kits are TI ZNP mini kit and CC2530 module.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJVrsDij9MpTMctqFFHVYyUwiPQn1MLzSq8uK5IQi0EmsQdwQu2V5Sca6ry-OLZwOjLNtL2ocUw2s6gZDW-8R2sFhLTAK8hkPsXmIJ_dJMDlU4pos1L3ycxdby-V4OK14kqdLgyb_xKg4/s1600/20131020-powermeter.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJVrsDij9MpTMctqFFHVYyUwiPQn1MLzSq8uK5IQi0EmsQdwQu2V5Sca6ry-OLZwOjLNtL2ocUw2s6gZDW-8R2sFhLTAK8hkPsXmIJ_dJMDlU4pos1L3ycxdby-V4OK14kqdLgyb_xKg4/s1600/20131020-powermeter.jpg&quot; height=&quot;240&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5U4Dxo9y1zUtaQj5iqe3rjlwzlBGMx1ZzGm8IQ3yjojZC9dEyab5qKUJjTPGkwWoVSwGieOuiLjosTzPF_mzXDddrOK79POrwymv7iSoMC-S26Pe4WDBsgJBPLkdm3g8P8SPrAI7FzZk/s1600/20131020-sensorysystem.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5U4Dxo9y1zUtaQj5iqe3rjlwzlBGMx1ZzGm8IQ3yjojZC9dEyab5qKUJjTPGkwWoVSwGieOuiLjosTzPF_mzXDddrOK79POrwymv7iSoMC-S26Pe4WDBsgJBPLkdm3g8P8SPrAI7FzZk/s1600/20131020-sensorysystem.jpg&quot; height=&quot;240&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; The embedded linux is running on RaspBerry Pi board, almost all the application functions could be run except the performance is poor.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwqxhKZoZCobJnMqj2uPwzO6gSnzx7xKta_Ff9Hdjr_Ke0b9Icq5g4aJ0YgiYKlXNcvBSuzGNAUrB1bT3J3rx4YK_udsazR-IDO4giFsyY9om6hxg9FD9laSu-5SDwdPkqX9l3Owf32tk/s1600/20131020-pi.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwqxhKZoZCobJnMqj2uPwzO6gSnzx7xKta_Ff9Hdjr_Ke0b9Icq5g4aJ0YgiYKlXNcvBSuzGNAUrB1bT3J3rx4YK_udsazR-IDO4giFsyY9om6hxg9FD9laSu-5SDwdPkqX9l3Owf32tk/s1600/20131020-pi.jpg&quot; height=&quot;240&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.wizign.com/&quot; target=&quot;_blank&quot;&gt;Wizign Co., Ltd.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Email: sales@wizign.com&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/1313610020246729431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/1313610020246729431' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/1313610020246729431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/1313610020246729431'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2013/10/sensory-system-by-zigbee-and-embedded.html' title='Sensory System by Zigbee and Embedded Linux'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKqQjbz5jL6SJL-vE1nCxsJP7wqgY769TW2zaDMfs3cKpFrfdGhMOobJKhDlnZm6rEpw6yjrV8O5xrTjtd_yiRPHC13wnx0MkJVK4Hmaxf0qN2GKjeBPl5RiwRbYAqGSeqdMTyEtX3P4Y/s72-c/20131020-aide.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-226917126998997261</id><published>2012-11-28T22:48:00.000+08:00</published><updated>2015-04-23T11:57:06.688+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="camera"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Toolkit"/><category scheme="http://www.blogger.com/atom/ns#" term="軟體"/><category scheme="http://www.blogger.com/atom/ns#" term="開發包"/><title type='text'>Capture Image Toolkit for UVC Camera</title><content type='html'>&amp;nbsp;&amp;nbsp;&amp;nbsp; Develop an application to capture image from an UVC camera for Windows 7/XP is a complex processing steps.&lt;br /&gt;
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Base on DirectShow APIs, the major processes are:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Source Filter &lt;--- camera=&quot;&quot; p=&quot;&quot;&gt;&amp;nbsp;| &lt;br /&gt;
V&lt;br /&gt;
Filters&lt;br /&gt;
&amp;nbsp;|&lt;br /&gt;
V&lt;br /&gt;
Video Render Filter ---&amp;gt; Display&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; For easily capturing image from a camera device, I have developed a toolkit to simplify the programming steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;!-------&gt;&lt;!-------&gt;&lt;/---&gt;</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/226917126998997261/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/226917126998997261' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/226917126998997261'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/226917126998997261'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2012/11/capture-image-toolkit-for-uvc-camera.html' title='Capture Image Toolkit for UVC Camera'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-4567318702763207295</id><published>2012-11-04T14:27:00.002+08:00</published><updated>2015-04-23T11:58:53.645+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="camera"/><category scheme="http://www.blogger.com/atom/ns#" term="DM368"/><category scheme="http://www.blogger.com/atom/ns#" term="embedded"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="USB"/><category scheme="http://www.blogger.com/atom/ns#" term="UVC"/><category scheme="http://www.blogger.com/atom/ns#" term="攝影機"/><title type='text'>USB camera and image processing + image analysis</title><content type='html'>&amp;nbsp;&amp;nbsp;&amp;nbsp; The experience of developing an USB camera and the demo program is an exciting activities. Here I show that I have done for it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; After the decision of chipset solution, functions, and components size, I began to design the circuit schematics.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1N4DjaD5_zjXcHJS1tRZq3IWv-mgjAD6GFyBVUWNpoM8dfZ3eelJvrYLkS75Y9tDLjMvqQbSjj4u7EymPoTlWu5L6aGLUB-_eWWzoB5W8Gg6X54Qc2liANObihIY6gf5cvHYiGHdf76M/s1600/CameraDemo-schematics1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1N4DjaD5_zjXcHJS1tRZq3IWv-mgjAD6GFyBVUWNpoM8dfZ3eelJvrYLkS75Y9tDLjMvqQbSjj4u7EymPoTlWu5L6aGLUB-_eWWzoB5W8Gg6X54Qc2liANObihIY6gf5cvHYiGHdf76M/s320/CameraDemo-schematics1.jpg&quot; height=&quot;226&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; One of the components is the development board, all my development and test are done by this development board. &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihxC7gP56zgHbhp9AxbNDOtVE5SV2reFriyMu_BXzqDODGaj7u9Hu-18svYWntHVJAjIqH6NbSDPuaNYj7gdUSZDoY30HaZXTfro3EjECr03PNzeMhfQ24ZYGSQ2kdw53ImklEfOlKqgQ/s1600/CameraDemo-DevBoard1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihxC7gP56zgHbhp9AxbNDOtVE5SV2reFriyMu_BXzqDODGaj7u9Hu-18svYWntHVJAjIqH6NbSDPuaNYj7gdUSZDoY30HaZXTfro3EjECr03PNzeMhfQ24ZYGSQ2kdw53ImklEfOlKqgQ/s320/CameraDemo-DevBoard1.jpg&quot; height=&quot;185&quot; width=&quot;320&quot; /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Finally, the finished USB camera. &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvcWxmaC_0Ed8tVQabRMDq8meaBx-KQ5HfxMf875Tqd97fA97Y6OIznIRWX1yyT2doD-_J-HV93Xa7VGyzogHRS2H_5-RjiVZKEVnFMe0FkG_m5lVgXu8_WXTilTkaePh4td1CyCoaNz0/s1600/CameraDemo-small.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvcWxmaC_0Ed8tVQabRMDq8meaBx-KQ5HfxMf875Tqd97fA97Y6OIznIRWX1yyT2doD-_J-HV93Xa7VGyzogHRS2H_5-RjiVZKEVnFMe0FkG_m5lVgXu8_WXTilTkaePh4td1CyCoaNz0/s320/CameraDemo-small.jpg&quot; height=&quot;266&quot; width=&quot;320&quot; /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; After I had made the USB camera work, the next step is to develop a demo program. You can download it, CameraCaptureDemo.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigewCFqqCmJ1FVMalVLioJDkgBoEbxdnRVqA8-OVysnO9jesCsxhzk-vn_cX42GTkMm0irAAcUAD6STOy4OuwLY-Dm9Zyuw-iCMOjRB0lSRgfptdXdJ4uZyYgrIop8a4fVHq4as7eK09k/s1600/CameraDemo-Contour.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigewCFqqCmJ1FVMalVLioJDkgBoEbxdnRVqA8-OVysnO9jesCsxhzk-vn_cX42GTkMm0irAAcUAD6STOy4OuwLY-Dm9Zyuw-iCMOjRB0lSRgfptdXdJ4uZyYgrIop8a4fVHq4as7eK09k/s320/CameraDemo-Contour.jpg&quot; height=&quot;320&quot; width=&quot;277&quot; /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Special functions for Wizign&#39;s USB camera: external/software triggering one shot mode capture.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlkWt08EFB9oZfGt6YfyyBoAbRGkqcR3D7ZlatQkymMA8vOIHyoHOAz-gLRRN_8o8rj5a_6UwSkC4ZIQb6_LTt4-zUE86k0etovsJPeLbEq2dX5YbOJfCSgOKK_jJAnpcxKxLNWZNX3s4/s1600/CameraDemo-SWTrigger.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlkWt08EFB9oZfGt6YfyyBoAbRGkqcR3D7ZlatQkymMA8vOIHyoHOAz-gLRRN_8o8rj5a_6UwSkC4ZIQb6_LTt4-zUE86k0etovsJPeLbEq2dX5YbOJfCSgOKK_jJAnpcxKxLNWZNX3s4/s320/CameraDemo-SWTrigger.jpg&quot; height=&quot;320&quot; width=&quot;278&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhE0XFQ9LmXo58zVA3cH0yB2x71Pd4A0eXNXl-wW0Jy6fG0fKlf2gbg1XC7hC8Zs9EgfeUzIoHfZSbEX4q8vwzYwkiuPT5WKB-x17QtTCHPF9Ms-UKs0ChHVQAUH3YygdoILdzwDGt7Hzw/s1600/CameraDemo-ExternalIO.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhE0XFQ9LmXo58zVA3cH0yB2x71Pd4A0eXNXl-wW0Jy6fG0fKlf2gbg1XC7hC8Zs9EgfeUzIoHfZSbEX4q8vwzYwkiuPT5WKB-x17QtTCHPF9Ms-UKs0ChHVQAUH3YygdoILdzwDGt7Hzw/s320/CameraDemo-ExternalIO.jpg&quot; height=&quot;266&quot; width=&quot;320&quot; /&gt;&lt;/a&gt; &lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/4567318702763207295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/4567318702763207295' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/4567318702763207295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/4567318702763207295'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2012/11/usb-camera-and-image-processing-image.html' title='USB camera and image processing + image analysis'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1N4DjaD5_zjXcHJS1tRZq3IWv-mgjAD6GFyBVUWNpoM8dfZ3eelJvrYLkS75Y9tDLjMvqQbSjj4u7EymPoTlWu5L6aGLUB-_eWWzoB5W8Gg6X54Qc2liANObihIY6gf5cvHYiGHdf76M/s72-c/CameraDemo-schematics1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-5208326872291615787</id><published>2012-04-04T00:32:00.002+08:00</published><updated>2015-04-23T12:00:48.275+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><title type='text'>The Image Data Flow on AV Server of TI DM36x</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
The image data flow on AV Server of TI DM36x:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuTuAhK8QeZ3x43hCEpx3RKbuQZj1kTJNzVvINZZ3mQ0vFxPprp1RSTXfcCK2TZaTd3oG5jHpoP4vDUh2swJVS2vSyp20LmExAgi-qKjhLWcXXECQtIyBtF_vQlrQ7KwuqAV-75WVuTc8/s1600/20110803-avserver-threadNbuffer.jpg&quot; height=&quot;640&quot; width=&quot;500&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/5208326872291615787/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/5208326872291615787' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/5208326872291615787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/5208326872291615787'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2012/04/av-server-ti-dm36x.html' title='The Image Data Flow on AV Server of TI DM36x'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuTuAhK8QeZ3x43hCEpx3RKbuQZj1kTJNzVvINZZ3mQ0vFxPprp1RSTXfcCK2TZaTd3oG5jHpoP4vDUh2swJVS2vSyp20LmExAgi-qKjhLWcXXECQtIyBtF_vQlrQ7KwuqAV-75WVuTc8/s72-c/20110803-avserver-threadNbuffer.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-21287496709725146</id><published>2009-07-13T16:46:00.002+08:00</published><updated>2015-04-23T12:19:35.368+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="decode"/><category scheme="http://www.blogger.com/atom/ns#" term="Japan"/><category scheme="http://www.blogger.com/atom/ns#" term="JP60"/><category scheme="http://www.blogger.com/atom/ns#" term="MCU"/><category scheme="http://www.blogger.com/atom/ns#" term="radio clock"/><title type='text'>Radio Clock - Decode JP60 Radio for Japan</title><content type='html'>Use MCU PIC16F877A + radio clock receiver module, the decoding process is coding by C language.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&quot;&quot; class=&quot;YOUTUBE-iframe-video&quot; data-thumbnail-src=&quot;https://i.ytimg.com/vi/wrrgA1bUsUs/0.jpg&quot; frameborder=&quot;0&quot; height=&quot;266&quot; src=&quot;https://www.youtube.com/embed/wrrgA1bUsUs?feature=player_embedded&quot; width=&quot;320&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/21287496709725146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/21287496709725146' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/21287496709725146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/21287496709725146'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2009/07/jp60.html' title='Radio Clock - Decode JP60 Radio for Japan'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/wrrgA1bUsUs/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-3114147121798281639</id><published>2009-02-21T00:04:00.003+08:00</published><updated>2015-04-23T12:28:55.957+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Basic"/><category scheme="http://www.blogger.com/atom/ns#" term="Free"/><category scheme="http://www.blogger.com/atom/ns#" term="Open Source"/><category scheme="http://www.blogger.com/atom/ns#" term="software"/><title type='text'>Some free software that you may considering</title><content type='html'>If you are worried about business software license fee, you can considering software as following:&lt;br /&gt;
Development tools&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://www.netbeans.org/&quot; target=&quot;_blank&quot;&gt;N e t B e a n s&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://www.eclipse.org/&quot; target=&quot;_blank&quot;&gt;E c l i p s e&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://www.junit.org/&quot; target=&quot;_blank&quot;&gt;J U n i t&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://httpunit.sourceforge.net/&quot; target=&quot;_blank&quot;&gt;H t t p u n i t&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://pmd.sourceforge.net/&quot; target=&quot;_blank&quot;&gt;P M D&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://valgrind.org/&quot; target=&quot;_blank&quot;&gt;V a l g r i n d&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://findbugs.sourceforge.net/&quot; target=&quot;_blank&quot;&gt;F i n d B u g s&lt;/a&gt;&lt;br /&gt;
Database and mapping tools&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://www.hibernate.org/&quot; target=&quot;_blank&quot;&gt;H i b e r n a t e&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://www.sqlite.org/&quot; target=&quot;_blank&quot;&gt;S Q L i t e&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://www.mysql.com/&quot; target=&quot;_blank&quot;&gt;M y S Q L&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://db.apache.org/derby&quot; target=&quot;_blank&quot;&gt;A p a c h e&amp;nbsp;&amp;nbsp; D e r b y&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://www.postgresql.org/&quot; target=&quot;_blank&quot;&gt;P o s t g r e S Q L&lt;/a&gt;&lt;br /&gt;
Kernel tools&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://www.zlib.net/&quot; target=&quot;_blank&quot;&gt;z l i b&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://www.libpng.org/pub/png/libpng.html&quot; target=&quot;_blank&quot;&gt;l i b p n g&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://ffmpeg.mplayerhq.hu/&quot; target=&quot;_blank&quot;&gt;F F m p e g&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://www.freetype.org/&quot; target=&quot;_blank&quot;&gt;F r e e t y p e&lt;/a&gt;&lt;br /&gt;
Report and chart&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://www.jfree.org/jfreechart/&quot; target=&quot;_blank&quot;&gt;J F r e e C h a r t &lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://velocity.apache.org/&quot; target=&quot;_blank&quot;&gt;V e l o c i t y&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://reporting.pentaho.org/&quot; target=&quot;_blank&quot;&gt;P e n t a h o&amp;nbsp;&amp;nbsp; R e p o r t i n g&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://jasperforge.org/plugins/project/project_home.php?group_id=102&quot; target=&quot;_blank&quot;&gt;J a s p e r R e p o r t s&lt;/a&gt;&lt;br /&gt;
Web 2.0&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://www.prototypejs.org/&quot; target=&quot;_blank&quot;&gt;P r o t o t y p e&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://script.aculo.us/&quot; target=&quot;_blank&quot;&gt;s c r i p t . a c u l o . u s&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://directwebremoting.org/&quot; target=&quot;_blank&quot;&gt;D i r e c t&amp;nbsp;&amp;nbsp; W e b&amp;nbsp;&amp;nbsp; R e m o t i n g&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://developer.yahoo.com/yui/&quot; target=&quot;_blank&quot;&gt;Y a h o o !&amp;nbsp;&amp;nbsp; U s e r&amp;nbsp;&amp;nbsp; I n t e r f a c e&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://www.jquery.com/&quot; target=&quot;_blank&quot;&gt; j Q u e r y&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
Reference:&lt;br /&gt;
&lt;a href=&quot;http://www.palamida.com/blogs/25-hot-open-source-projects-organizations-should-be-using-today&quot; target=&quot;_blank&quot;&gt;In a Time of Less, Do More with Open Source: Top 25 Open Source Projects That Will Help Trim Development Budgets&lt;/a&gt;，December 15, 2008</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/3114147121798281639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/3114147121798281639' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/3114147121798281639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/3114147121798281639'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2009/02/blog-post.html' title='Some free software that you may considering'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-6299344487544119342</id><published>2008-12-10T10:21:00.001+08:00</published><updated>2015-04-23T16:08:10.718+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="driver"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="porting"/><category scheme="http://www.blogger.com/atom/ns#" term="touch screen"/><title type='text'>TouchScreen driver has been done - porting Linux kernel 2.6.25 (Android version) to SAMSUNG S3C2440A</title><content type='html'>About writing touch screen driver, this URL is a good reference:&lt;br /&gt;
&lt;a href=&quot;http://ccoolloorr.blogspot.com/2008/06/touch-screen-driver.html&quot;&gt;[轉錄帥哥] Touch Screen Driver&lt;/a&gt;&lt;br /&gt;
&lt;pre class=&quot;vc_log&quot;&gt;The patch file of S3C2410 touch screen, download path:
&lt;a href=&quot;http://svnweb.openmoko.org/branches/src/target/kernel/2.6.24.x/patches/s3c2410_touchscreen.patch?rev=3966&amp;amp;sortby=rev&amp;amp;sortdir=down&amp;amp;view=markup&quot;&gt;s3c2410_touchscreen.patch&lt;/a&gt;&lt;/pre&gt;
In patch file, modified files include:&lt;br /&gt;
arch/arm/plat-s3c24xx/devs.c&lt;br /&gt;
include/asm-arm/plat-s3c24xx/devs.h&lt;br /&gt;
arch/arm/mach-s3c2410/mach-h1940.c&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;drivers/input/touchscreen/Kconfig&lt;br /&gt;
drivers/input/touchscreen/Makefile&lt;br /&gt;
drivers/input/touchscreen/s3c2410_ts.c&lt;br /&gt;
include/asm-arm/arch-s3c2410/ts.h&lt;br /&gt;
&lt;br /&gt;
then, modifies the following files,&lt;br /&gt;
arch/arm/mach-s3c2440/mach-smdk2440.c&lt;br /&gt;
arch/arm/plat-s3c24xx/devs.c&lt;br /&gt;
arch/arm/plat-s3c24xx/s3c244x.c&lt;br /&gt;
&lt;br /&gt;
works are done.&lt;br /&gt;
&lt;br /&gt;
Burn the recompiled kernel file to board, the booting message:&lt;br /&gt;
&lt;br /&gt;
Starting kernel ...&lt;br /&gt;
&lt;br /&gt;
Uncompressing Linux........................................................................................................... done, booting the kernel.&lt;br /&gt;
Linux version 2.6.25 (armdev@test.intra.wizign.com) (gcc version 4.1.2) #14 Tue Dec 9 15:23:52 CST 2008&lt;br /&gt;
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177&lt;br /&gt;
Machine: SBZ2440&lt;br /&gt;
Memory policy: ECC disabled, Data cache writeback&lt;br /&gt;
CPU S3C2440A (id 0x32440001)&lt;br /&gt;
S3C244X: core 399.651 MHz, memory 133.217 MHz, peripheral 66.608 MHz&lt;br /&gt;
S3C24XX Clocks, (c) 2004 Simtec Electronics&lt;br /&gt;
CLOCK: Slow mode (2.116 MHz), fast, MPLL on, UPLL on&lt;br /&gt;
CPU0: D VIVT write-back cache&lt;br /&gt;
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets&lt;br /&gt;
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets&lt;br /&gt;
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256&lt;br /&gt;
Kernel command line: root=/dev/nfs rw noinitrd console=ttySAC0,115200 init=/linuxrc nfsroot=192.168.1.12:/vdisk/armdev_fs ip=192.168.1.30:192.168.1.12:192.168f&lt;br /&gt;
irq: clearing pending ext status 00000080&lt;br /&gt;
irq: clearing subpending status 00000003&lt;br /&gt;
irq: clearing subpending status 00000002&lt;br /&gt;
PID hash table entries: 256 (order: 8, 1024 bytes)&lt;br /&gt;
timer tcon=00500000, tcnt d8d2, tcfg 00000200,00000000, usec 0000170f&lt;br /&gt;
Console: colour dummy device 80x30&lt;br /&gt;
console [ttySAC0] enabled&lt;br /&gt;
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)&lt;br /&gt;
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)&lt;br /&gt;
Memory: 64MB = 64MB total&lt;br /&gt;
Memory: 61184KB available (3044K code, 508K data, 144K init)&lt;br /&gt;
Mount-cache hash table entries: 512&lt;br /&gt;
CPU: Testing write buffer coherency: ok&lt;br /&gt;
net_namespace: 152 bytes&lt;br /&gt;
NET: Registered protocol family 16&lt;br /&gt;
S3C2410 Power Management, (c) 2004 Simtec Electronics&lt;br /&gt;
S3C2440: Initialising architecture&lt;br /&gt;
S3C2440: IRQ Support&lt;br /&gt;
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics&lt;br /&gt;
DMA channel 0 at c4800000, irq 33&lt;br /&gt;
DMA channel 1 at c4800040, irq 34&lt;br /&gt;
DMA channel 2 at c4800080, irq 35&lt;br /&gt;
DMA channel 3 at c48000c0, irq 36&lt;br /&gt;
S3C244X: Clock Support, DVS off&lt;br /&gt;
usbcore: registered new interface driver usbfs&lt;br /&gt;
usbcore: registered new interface driver hub&lt;br /&gt;
usbcore: registered new device driver usb&lt;br /&gt;
NET: Registered protocol family 2&lt;br /&gt;
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)&lt;br /&gt;
TCP established hash table entries: 2048 (order: 2, 16384 bytes)&lt;br /&gt;
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)&lt;br /&gt;
TCP: Hash tables configured (established 2048 bind 2048)&lt;br /&gt;
TCP reno registered&lt;br /&gt;
NetWinder Floating Point Emulator V0.97 (double precision)&lt;br /&gt;
JFFS2 version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.&lt;br /&gt;
fuse init (API version 7.9)&lt;br /&gt;
io scheduler noop registered&lt;br /&gt;
io scheduler anticipatory registered (default)&lt;br /&gt;
io scheduler deadline registered&lt;br /&gt;
io scheduler cfq registered&lt;br /&gt;
Console: switching to colour frame buffer device 30x40&lt;br /&gt;
fb0: s3c2410fb frame buffer device&lt;br /&gt;
lp: driver loaded but no devices found&lt;br /&gt;
ppdev: user-space parallel port driver&lt;br /&gt;
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled&lt;br /&gt;
s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440&lt;br /&gt;
s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440&lt;br /&gt;
s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440&lt;br /&gt;
brd: module loaded&lt;br /&gt;
loop: module loaded&lt;br /&gt;
dm9000 Ethernet Driver, V1.30&lt;br /&gt;
eth0: dm9000 at c485e300,c4860304 IRQ 51 MAC: 08:00:3e:26:0a:5b (chip)&lt;br /&gt;
Uniform Multi-Platform E-IDE driver&lt;br /&gt;
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx&lt;br /&gt;
BAST NOR-Flash Driver, (c) 2004 Simtec Electronics&lt;br /&gt;
S3C24XX NAND Driver, (c) 2004 Simtec Electronics&lt;br /&gt;
s3c2440-nand s3c2440-nand: Tacls=1, 7ns Twrph0=4 30ns, Twrph1=1 7ns&lt;br /&gt;
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)&lt;br /&gt;
Scanning device for bad blocks&lt;br /&gt;
Creating 2 MTD partitions on &quot;NAND 64MiB 3,3V 8-bit&quot;:&lt;br /&gt;
0x00000000-0x00200000 : &quot;Kernel&quot;&lt;br /&gt;
0x00200000-0x04000000 : &quot;root partition&quot;&lt;br /&gt;
usbmon: debugfs is not available&lt;br /&gt;
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI&lt;br /&gt;
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1&lt;br /&gt;
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000&lt;br /&gt;
usb usb1: configuration #1 chosen from 1 choice&lt;br /&gt;
hub 1-0:1.0: USB hub found&lt;br /&gt;
hub 1-0:1.0: 2 ports detected&lt;br /&gt;
mice: PS/2 mouse device common for all mice&lt;br /&gt;
&lt;span style=&quot;color: #cc0000;&quot;&gt;s3c2410 TouchScreen successfully loaded&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;input: s3c2410 TouchScreen as /class/input/input0&lt;/span&gt;&lt;br /&gt;
S3C24XX RTC, (c) 2004,2006 Simtec Electronics&lt;br /&gt;
s3c2440-i2c s3c2440-i2c: slave address 0x10&lt;br /&gt;
s3c2440-i2c s3c2440-i2c: bus frequency set to 378 KHz&lt;br /&gt;
s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter&lt;br /&gt;
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics&lt;br /&gt;
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled&lt;br /&gt;
logger: created 64K log &#39;log_main&#39;&lt;br /&gt;
logger: created 64K log &#39;log_events&#39;&lt;br /&gt;
logger: created 64K log &#39;log_radio&#39;&lt;br /&gt;
TCP cubic registered&lt;br /&gt;
NET: Registered protocol family 1&lt;br /&gt;
RPC: Registered udp transport module.&lt;br /&gt;
RPC: Registered tcp transport module.&lt;br /&gt;
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)&lt;br /&gt;
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1&lt;br /&gt;
IP-Config: Complete:&lt;br /&gt;
device=eth0, addr=192.168.1.30, mask=255.255.255.0, gw=192.168.1.1,&lt;br /&gt;
host=android, domain=, nis-domain=(none),&lt;br /&gt;
bootserver=192.168.1.12, rootserver=192.168.1.12, rootpath=&lt;br /&gt;
Looking up port of RPC 100003/2 on 192.168.1.12&lt;br /&gt;
Looking up port of RPC 100005/1 on 192.168.1.12&lt;br /&gt;
VFS: Mounted root (nfs filesystem).&lt;br /&gt;
Freeing init memory: 144K&lt;br /&gt;
--------mount /proc as proc&lt;br /&gt;
--------mount /sys as sysfs&lt;br /&gt;
--------mount /dev/shm as tmpfs&lt;br /&gt;
init started: BusyBox v1.12.1 (2008-11-25 00:32:40 CST)&lt;br /&gt;
starting pid 784, tty &#39;&#39;: &#39;/etc/rc.d/startup&#39;&lt;br /&gt;
--------start mdev&lt;br /&gt;
--------mount tmpfs&lt;br /&gt;
OK&lt;br /&gt;
--------mount devpts&lt;br /&gt;
OK&lt;br /&gt;
Setting system clock: hwclock: can&#39;t open &#39;/dev/misc/rtc&#39;: No such file or directory&lt;br /&gt;
FAIL&lt;br /&gt;
Setting hostname: OK&lt;br /&gt;
Cleaning up system: OK&lt;br /&gt;
Setting up interface lo: OK&lt;br /&gt;
Running start scripts.&lt;br /&gt;
Starting syslogd: syslogd: invalid number &#39;80kb&#39;&lt;br /&gt;
FAIL&lt;br /&gt;
Starting klogd: OK&lt;br /&gt;
Setting up interface eth0: OK&lt;br /&gt;
starting pid 805, tty &#39;&#39;: &#39;-/bin/login&#39;&lt;br /&gt;
android login: root&lt;br /&gt;
Jan  1 00:00:18 login[805]: root login on &#39;console&#39;&lt;br /&gt;
EMB#</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/6299344487544119342/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/6299344487544119342' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/6299344487544119342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/6299344487544119342'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2008/12/touchscreen-driver-has-been-done-linux.html' title='TouchScreen driver has been done - porting Linux kernel 2.6.25 (Android version) to SAMSUNG S3C2440A'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-4202277809139788437</id><published>2008-11-26T15:11:00.002+08:00</published><updated>2015-04-23T15:21:38.443+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="embedded"/><category scheme="http://www.blogger.com/atom/ns#" term="kernel"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="porting"/><category scheme="http://www.blogger.com/atom/ns#" term="嵌入式"/><category scheme="http://www.blogger.com/atom/ns#" term="移植"/><title type='text'>Mounting File system - Porting Linux kernel 2.6.25 (Android version) to SAMSUNG S3C2440A</title><content type='html'>　　Previous time, when linux kernel run at:&lt;br /&gt;
&lt;br /&gt;
Freeing init memory: 140K&lt;br /&gt;
&lt;br /&gt;
the system is halted, after some test, I find that it is the problem of cross-compiled gcc.&lt;br /&gt;
&lt;br /&gt;
　　The ARM core of SAMSUNG S3C2440A is ARM920T, therefore, I rebuild the cross-compiled gcc of generic arm with little endian version, the problem has fixed.&lt;br /&gt;
&lt;br /&gt;
The success process of booting linux:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Starting kernel ...&lt;br /&gt;
&lt;br /&gt;
Uncompressing Linux........................................................................................................... done, booting the kernel.&lt;br /&gt;
Linux version 2.6.25 (armdev@test.intra.wizign.com) (gcc version 4.1.2) #3 Tue Nov 25 01:55:06 CST 2008&lt;br /&gt;
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177&lt;br /&gt;
Machine: SBZ2440&lt;br /&gt;
Memory policy: ECC disabled, Data cache writeback&lt;br /&gt;
CPU S3C2440A (id 0x32440001)&lt;br /&gt;
S3C244X: core 399.651 MHz, memory 133.217 MHz, peripheral 66.608 MHz&lt;br /&gt;
S3C24XX Clocks, (c) 2004 Simtec Electronics&lt;br /&gt;
CLOCK: Slow mode (2.116 MHz), fast, MPLL on, UPLL on&lt;br /&gt;
CPU0: D VIVT write-back cache&lt;br /&gt;
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets&lt;br /&gt;
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets&lt;br /&gt;
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256&lt;br /&gt;
Kernel command line: root=/dev/nfs rw noinitrd console=ttySAC0,115200 init=/linuxrc nfsroot=192.168.1.12:/vdisk/armdev_fs ip=192.168.1.30:192.168.1.12:1&lt;br /&gt;
92.168.1.1:255.255.255.0:android:eth0:off&lt;br /&gt;
irq: clearing pending ext status 00000080&lt;br /&gt;
irq: clearing subpending status 00000003&lt;br /&gt;
irq: clearing subpending status 00000002&lt;br /&gt;
PID hash table entries: 256 (order: 8, 1024 bytes)&lt;br /&gt;
timer tcon=00500000, tcnt d8d2, tcfg 00000200,00000000, usec 0000170f&lt;br /&gt;
Console: colour dummy device 80x30&lt;br /&gt;
console [ttySAC0] enabled&lt;br /&gt;
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)&lt;br /&gt;
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)&lt;br /&gt;
Memory: 64MB = 64MB total&lt;br /&gt;
Memory: 61184KB available (3040K code, 507K data, 140K init)&lt;br /&gt;
Mount-cache hash table entries: 512&lt;br /&gt;
CPU: Testing write buffer coherency: ok&lt;br /&gt;
net_namespace: 152 bytes&lt;br /&gt;
NET: Registered protocol family 16&lt;br /&gt;
S3C2410 Power Management, (c) 2004 Simtec Electronics&lt;br /&gt;
S3C2440: Initialising architecture&lt;br /&gt;
S3C2440: IRQ Support&lt;br /&gt;
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics&lt;br /&gt;
DMA channel 0 at c4800000, irq 33&lt;br /&gt;
DMA channel 1 at c4800040, irq 34&lt;br /&gt;
DMA channel 2 at c4800080, irq 35&lt;br /&gt;
DMA channel 3 at c48000c0, irq 36&lt;br /&gt;
S3C244X: Clock Support, DVS off&lt;br /&gt;
usbcore: registered new interface driver usbfs&lt;br /&gt;
usbcore: registered new interface driver hub&lt;br /&gt;
usbcore: registered new device driver usb&lt;br /&gt;
NET: Registered protocol family 2&lt;br /&gt;
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)&lt;br /&gt;
TCP established hash table entries: 2048 (order: 2, 16384 bytes)&lt;br /&gt;
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)&lt;br /&gt;
TCP: Hash tables configured (established 2048 bind 2048)&lt;br /&gt;
TCP reno registered&lt;br /&gt;
NetWinder Floating Point Emulator V0.97 (double precision)&lt;br /&gt;
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.&lt;br /&gt;
fuse init (API version 7.9)&lt;br /&gt;
io scheduler noop registered&lt;br /&gt;
io scheduler anticipatory registered (default)&lt;br /&gt;
io scheduler deadline registered&lt;br /&gt;
io scheduler cfq registered&lt;br /&gt;
Console: switching to colour frame buffer device 30x40&lt;br /&gt;
fb0: s3c2410fb frame buffer device&lt;br /&gt;
lp: driver loaded but no devices found&lt;br /&gt;
ppdev: user-space parallel port driver&lt;br /&gt;
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled&lt;br /&gt;
s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440&lt;br /&gt;
s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440&lt;br /&gt;
s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440&lt;br /&gt;
brd: module loaded&lt;br /&gt;
loop: module loaded&lt;br /&gt;
dm9000 Ethernet Driver, V1.30&lt;br /&gt;
eth0: dm9000 at c485e300,c4860304 IRQ 51 MAC: 08:00:3e:26:0a:5b (chip)&lt;br /&gt;
Uniform Multi-Platform E-IDE driver&lt;br /&gt;
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx&lt;br /&gt;
BAST NOR-Flash Driver, (c) 2004 Simtec Electronics&lt;br /&gt;
S3C24XX NAND Driver, (c) 2004 Simtec Electronics&lt;br /&gt;
s3c2440-nand s3c2440-nand: Tacls=1, 7ns Twrph0=4 30ns, Twrph1=1 7ns&lt;br /&gt;
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)&lt;br /&gt;
Scanning device for bad blocks&lt;br /&gt;
Creating 2 MTD partitions on &quot;NAND 64MiB 3,3V 8-bit&quot;:&lt;br /&gt;
0x00000000-0x00200000 : &quot;Kernel&quot;&lt;br /&gt;
0x00200000-0x04000000 : &quot;root partition&quot;&lt;br /&gt;
usbmon: debugfs is not available&lt;br /&gt;
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI&lt;br /&gt;
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1&lt;br /&gt;
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000&lt;br /&gt;
usb usb1: configuration #1 chosen from 1 choice&lt;br /&gt;
hub 1-0:1.0: USB hub found&lt;br /&gt;
hub 1-0:1.0: 2 ports detected&lt;br /&gt;
mice: PS/2 mouse device common for all mice&lt;br /&gt;
S3C24XX RTC, (c) 2004,2006 Simtec Electronics&lt;br /&gt;
s3c2440-i2c s3c2440-i2c: slave address 0x10&lt;br /&gt;
s3c2440-i2c s3c2440-i2c: bus frequency set to 378 KHz&lt;br /&gt;
s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter&lt;br /&gt;
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics&lt;br /&gt;
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled&lt;br /&gt;
logger: created 64K log &#39;log_main&#39;&lt;br /&gt;
logger: created 64K log &#39;log_events&#39;&lt;br /&gt;
logger: created 64K log &#39;log_radio&#39;&lt;br /&gt;
TCP cubic registered&lt;br /&gt;
NET: Registered protocol family 1&lt;br /&gt;
RPC: Registered udp transport module.&lt;br /&gt;
RPC: Registered tcp transport module.&lt;br /&gt;
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)&lt;br /&gt;
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1&lt;br /&gt;
IP-Config: Complete:&lt;br /&gt;
device=eth0, addr=192.168.1.30, mask=255.255.255.0, gw=192.168.1.1,&lt;br /&gt;
host=android, domain=, nis-domain=(none),&lt;br /&gt;
bootserver=192.168.1.12, rootserver=192.168.1.12, rootpath=&lt;br /&gt;
Looking up port of RPC 100003/2 on 192.168.1.12&lt;br /&gt;
Looking up port of RPC 100005/1 on 192.168.1.12&lt;br /&gt;
VFS: Mounted root (nfs filesystem).&lt;br /&gt;
Freeing init memory: 140K&lt;br /&gt;
--------mount /proc as proc&lt;br /&gt;
--------mount /sys as sysfs&lt;br /&gt;
init started: BusyBox v1.12.1 (2008-11-25 00:32:40 CST)&lt;br /&gt;
starting pid 777, tty &#39;&#39;: &#39;/etc/rc.d/startup&#39;&lt;br /&gt;
mkdir: cannot create directory &#39;/dev/pts&#39;: File exists&lt;br /&gt;
mkdir: cannot create directory &#39;/dev/shm&#39;: File exists&lt;br /&gt;
--------start mdev&lt;br /&gt;
--------mount tmpfs&lt;br /&gt;
OK&lt;br /&gt;
--------mount devpts&lt;br /&gt;
mount: mounting devpts on /dev/pts failed: No such file or directory&lt;br /&gt;
FAIL&lt;br /&gt;
Setting system clock: hwclock: can&#39;t open &#39;/dev/misc/rtc&#39;: No such file or directory&lt;br /&gt;
FAIL&lt;br /&gt;
Setting hostname: OK&lt;br /&gt;
Cleaning up system: OK&lt;br /&gt;
Setting up interface lo: OK&lt;br /&gt;
Running start scripts.&lt;br /&gt;
Starting syslogd: syslogd: invalid number &#39;80kb&#39;&lt;br /&gt;
FAIL&lt;br /&gt;
Starting klogd: OK&lt;br /&gt;
Setting up interface eth0: OK&lt;br /&gt;
starting pid 800, tty &#39;&#39;: &#39;-/bin/login&#39;&lt;br /&gt;
android login: root&lt;br /&gt;
ash: id -u: bad number&lt;br /&gt;
# uname -a&lt;br /&gt;
Linux android 2.6.25 #3 Tue Nov 25 01:55:06 CST 2008 armv4tl unknown&lt;br /&gt;
# hostname&lt;br /&gt;
android</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/4202277809139788437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/4202277809139788437' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/4202277809139788437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/4202277809139788437'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2008/11/file-system-linux-kernel-2625-android.html' title='Mounting File system - Porting Linux kernel 2.6.25 (Android version) to SAMSUNG S3C2440A'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-1577068655533634015</id><published>2008-11-23T10:26:00.003+08:00</published><updated>2015-04-23T15:33:50.511+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="notes"/><title type='text'>Linux Notes</title><content type='html'>Some notes about linux:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sites.google.com/site/compassfun/docs/20080111-2OSs.pdf&quot;&gt;To install 2 OSs on a PC&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sites.google.com/site/compassfun/docs/linux-account.pdf&quot;&gt;Account management&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sites.google.com/site/compassfun/docs/linux-bash.pdf&quot;&gt;Bash shell&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sites.google.com/site/compassfun/docs/linux-disk.pdf&quot;&gt;Hard disk management&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sites.google.com/site/compassfun/docs/linux-filesystem.pdf&quot;&gt;File system architecture&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sites.google.com/site/compassfun/docs/linux-gcc.pdf&quot;&gt;GCC&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sites.google.com/site/compassfun/docs/linux-gdb.pdf&quot;&gt;GDB&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sites.google.com/site/compassfun/docs/linux-make.pdf&quot;&gt;GNU make&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sites.google.com/site/compassfun/docs/linux-network.pdf&quot;&gt;Network management&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sites.google.com/site/compassfun/docs/linux-package.pdf&quot;&gt;Package management&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sites.google.com/site/compassfun/docs/linux-vim.pdf&quot;&gt;Vim editor&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sites.google.com/site/compassfun/docs/linux-xwin-fedoracore.pdf&quot;&gt;Fedora GUI applications&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sites.google.com/site/compassfun/docs/linux-xwin-ubuntu.pdf&quot;&gt;Ubuntu GUI applications&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/1577068655533634015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/1577068655533634015' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/1577068655533634015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/1577068655533634015'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2008/11/linux.html' title='Linux Notes'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-2244901398772287092</id><published>2008-11-19T10:28:00.003+08:00</published><updated>2015-04-23T15:59:05.557+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="kernel"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="porting"/><category scheme="http://www.blogger.com/atom/ns#" term="S3C2440A"/><category scheme="http://www.blogger.com/atom/ns#" term="SAMSUNG"/><title type='text'>Porting Linux kernel 2.6.25 (Android version) to SAMSUNG S3C2440A</title><content type='html'>It is fun! Last time, I was porting android to TI Davinci DM355 failed.&lt;br /&gt;
&lt;br /&gt;
This time, I am porting android to SAMSUNG S3C2440A, successfully.&lt;br /&gt;
&lt;br /&gt;
Now, the kernel is bootable, my next step has works:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Mounting file system (Temporarily, I can ping to OS, it means that the OS has worked) &lt;/li&gt;
&lt;li&gt;Tuning GUI and some hardware related driver&lt;/li&gt;
&lt;li&gt;Porting android&#39;s OS environment and demo APs &lt;/li&gt;
&lt;li&gt;Developing applications&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Following list describes basic configuration in the build process; for tuning in detail, some hardware related configuration is a must step, the good references are as following:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://blog.chinaunix.net/u2/79779/showart_1217018.html&quot;&gt;linux-2.6.26内核移植到S3C2440平台 &lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://blog.chinaunix.net/u2/79779/showart_1216559.html&quot;&gt;linux-2.6.25内核移植到S3C2440平台 &lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://blog.csdn.net/yang_dk/archive/2008/04/17/2300712.aspx&quot;&gt;移植内核2.6.24.4到S3C2440&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://blog.csdn.net/zhang810413/archive/2008/02/08/2086984.aspx&quot;&gt;《Linux系统移植》 &lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;A simple description of porting steps: &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
CPU is SAMSUNG S3C2440A&lt;br /&gt;
Linux kernel Android version 2.6.25.&lt;br /&gt;
Cross compiled GCC and build basic OS eviroment, please check this site:&lt;br /&gt;
&lt;a href=&quot;http://cross-lfs.org/view/clfs-embedded/arm/&quot;&gt;Cross-Compiled Linux From Scratch - Embedded (Version SVN-0.0.1-20080109-arm)&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;() Busybox-1.12.1 - OS&#39;s working environment&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
cd ${ARMDEV}/build&lt;br /&gt;
tar -jxvf ${ARMDEV}/sources/busybox-1.12.1.tar.bz2&lt;br /&gt;
cd busybox-1.12.1&lt;br /&gt;
patch -Np1 -i ../busybox-1.12.1-fixes-1.patch&lt;br /&gt;
patch -Np1 -i ../busybox-1.12.1-iptunnel_headers-1.patch&lt;br /&gt;
make defconfig&lt;br /&gt;
&lt;br /&gt;
BUSYBOX_OPTIONS=&quot;CONFIG_DMALLOC CONFIG_BUILD_AT_ONCE CONFIG_BUILD_LIBBUSYBOX&lt;br /&gt;
CONFIG_FEATURE_SH_IS_NONE CONFIG_LOCALE_SUPPORT CONFIG_TFTP CONFIG_FTPGET&lt;br /&gt;
CONFIG_FTPPUT CONFIG_IPCALC CONFIG_TFTP CONFIG_HUSH CONFIG_LASH&lt;br /&gt;
CONFIG_MSH CONFIG_INETD CONFIG_DPKG CONFIG_RPM2CPIO CONFIG_RPM&lt;br /&gt;
CONFIG_FOLD CONFIG_LOGNAME CONFIG_OD CONFIG_CRONTAB CONFIG_UUDECODE&lt;br /&gt;
CONFIG_UUENCODE CONFIG_SULOGIN CONFIG_DC CONFIG_DEBUG_YANK_SUSv2&lt;br /&gt;
CONFIG_DEBUG_INIT CONFIG_DEBUG_CROND_OPTION CONFIG_FEATURE_UDHCP_DEBUG&lt;br /&gt;
CONFIG_TASKSET CONFIG_CHATTR CONFIG_FSCK CONFIG_LSATTR CONFIG_CHPST&lt;br /&gt;
CONFIG_SETUIDGID CONFIG_ENVUIDGID CONFIG_ENVDIR CONFIG_SOFTLIMIT&lt;br /&gt;
CONFIG_FEATURE_2_4_MODULES&quot;&lt;br /&gt;
for config in $BUSYBOX_OPTIONS; do&lt;br /&gt;
cp .config{,.orig}&lt;br /&gt;
sed -e &quot;s:${config}=y:${config}=n:&quot; .config.orig &amp;gt; .config&lt;br /&gt;
done&lt;br /&gt;
BUSYBOX_OPTIONS=&quot;CONFIG_FEATURE_SH_IS_ASH CONFIG_FEATURE_TRACEROUTE_VERBOSE CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE&quot;&lt;br /&gt;
for config in $BUSYBOX_OPTIONS; do&lt;br /&gt;
cp .config{,.orig}&lt;br /&gt;
sed -e &quot;s:# ${config} is not set:${config}=y:&quot; .config.orig &amp;gt; .config&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
make ARCH=arm CROSS_COMPILE=&quot;${ARM_TARGET}-&quot;&lt;br /&gt;
make ARCH=arm CROSS_COMPILE=&quot;${ARM_TARGET}-&quot; CONFIG_PREFIX=&quot;${ARMDEV}&quot; install&lt;br /&gt;
&lt;br /&gt;
cp examples/depmod.pl ${ARMDEV}/cross-tools/bin&lt;br /&gt;
chmod 755 ${ARMDEV}/cross-tools/bin/depmod.pl&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;() Ext2 - file system tool &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
cd ${ARMDEV}/build&lt;br /&gt;
tar -zxvf ${ARMDEV}/sources/e2fsprogs-1.39.tar.gz&lt;br /&gt;
cd e2fsprogs-1.39&lt;br /&gt;
mkdir -v build&lt;br /&gt;
cd build&lt;br /&gt;
CC=&quot;${CC} -Os&quot; ../configure --build=${ARM_HOST} --host=${ARM_TARGET} --prefix=/usr --with-root-prefix=&quot;&quot; --with-cc=&quot;${CC} -Os&quot; --with-linker=${LD}&lt;br /&gt;
make&lt;br /&gt;
make DESTDIR=${ARMDEV} install&lt;br /&gt;
make DESTDIR=${ARMDEV} install-libs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;() Iana-Etc-2.20 - network services and communication protocol &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
cd ${ARMDEV}/build&lt;br /&gt;
tar -jxvf ${ARMDEV}/sources/iana-etc-2.20.tar.bz2&lt;br /&gt;
cd iana-etc-2.20&lt;br /&gt;
make&lt;br /&gt;
make DESTDIR=${ARMDEV} install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;() Zlib-1.2.3 0 - compress and uncompress program &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
cd ${ARMDEV}/build&lt;br /&gt;
tar -zxvf ${ARMDEV}/sources/zlib-1.2.3.tar.gz&lt;br /&gt;
cd zlib-1.2.3&lt;br /&gt;
patch -Np1 -i ${ARMDEV}/sources/zlib-1.2.3-DESTDIR-1.patch&lt;br /&gt;
cp configure{,.orig}&lt;br /&gt;
sed -e &#39;s/-O3/-Os/g&#39; configure.orig &amp;gt; configure&lt;br /&gt;
&lt;br /&gt;
CC=&quot;${CC}&quot; ./configure --prefix=/usr --shared&lt;br /&gt;
make&lt;br /&gt;
make DESTDIR=${ARMDEV} install&lt;br /&gt;
mv -v ${ARMDEV}/usr/lib/libz.so.* ${ARMDEV}/lib&lt;br /&gt;
ln -svf ../../lib/libz.so.1 ${ARMDEV}/usr/lib/libz.so&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;() Build password protection mechanics&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
echo &quot;Create /etc/shadow file&quot;&lt;br /&gt;
cat &amp;gt; ${ARMDEV}/etc/shadow &amp;lt;&amp;lt; &quot;EOF&quot;&lt;br /&gt;
root:$1$BQY1.ACn$rvcsFmggQFH.jyCD/X/NV1:13553:0:99999:7:::&lt;br /&gt;
bin:x:13553:0:99999:7:::&lt;br /&gt;
daemon:x:13553:0:99999:7:::&lt;br /&gt;
adm:x:13553:0:99999:7:::&lt;br /&gt;
lp:x:13553:0:99999:7:::&lt;br /&gt;
mail:x:13553:0:99999:7:::&lt;br /&gt;
news:x:13553:0:99999:7:::&lt;br /&gt;
uucp:x:13553:0:99999:7:::&lt;br /&gt;
operator:x:13553:0:99999:7:::&lt;br /&gt;
postmaster:x:13553:0:99999:7:::&lt;br /&gt;
nobody:x:13553:0:99999:7:::&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;() cramfs-1.1 - tool for building file system &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
cd ${ARMDEV}/build&lt;br /&gt;
tar -zxvf ${ARMDEV}/sources/cramfs-1.1.tar.gz&lt;br /&gt;
cd cramfs-1.1&lt;br /&gt;
make&lt;br /&gt;
&lt;br /&gt;
$ su&lt;br /&gt;
# cp mkcramfs /usr/bin&lt;br /&gt;
# cp cramfsck /usr/bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;() JFFS2 - manage file system of Flash memory&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
cd ${ARMDEV}/sources&lt;br /&gt;
cvs -d :pserver:anoncvs@cvs.infradead.org:/home/cvs login    #password: anoncvs&lt;br /&gt;
cvs -d :pserver:anoncvs@cvs.infradead.org:/home/cvs co mtd&lt;br /&gt;
cd mtd/util/&lt;br /&gt;
make clean&lt;br /&gt;
make&lt;br /&gt;
cp mkfs.jffs /sbin&lt;br /&gt;
cp mkfs.jffs2 /sbin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;() /etc/fstab &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
cat &amp;gt; ${ARMDEV}/etc/fstab &amp;lt;&amp;lt; &quot;EOF&quot;&lt;br /&gt;
# Begin /etc/fstab&lt;br /&gt;
&lt;br /&gt;
# Help information&lt;br /&gt;
# man 5 fstab&lt;br /&gt;
&lt;br /&gt;
# file system        mount-point    type        options            dump    fsck&lt;br /&gt;
#                                                         order&lt;br /&gt;
&lt;br /&gt;
/dev/ram                /                            ext2            defaults        1        1&lt;br /&gt;
proc                        /proc                    proc            defaults        0        0&lt;br /&gt;
sysfs                        /sys                        sysfs            defaults        0        0&lt;br /&gt;
devpts                    /dev/pts                devpts        gid=4,mode=620    0        0&lt;br /&gt;
shm                        /dev/shm            tmpfs            defaults        0        0&lt;br /&gt;
none                        /proc/bus/usb    usbdevfs    defaults        0        0&lt;br /&gt;
&lt;br /&gt;
# End /etc/fstab&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;() Linux-2.6.25 (android version) &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
cd ${ARMDEV}/build&lt;br /&gt;
tar -jxvf ${ARMDEV}/sources/linux-2.6.25-android-1.0_r1.tar.gz&lt;br /&gt;
mv kernel.git linux-android-2.6.25&lt;br /&gt;
cd linux-android-2.6.25&lt;br /&gt;
make mrproper&lt;br /&gt;
&lt;br /&gt;
make ARCH=arm CROSS_COMPILE=${ARM_TARGET}- s3c2410_defconfig&lt;br /&gt;
make ARCH=arm CROSS_COMPILE=${ARM_TARGET}- gconfig&lt;br /&gt;
&lt;br /&gt;
The following configuration is only for my evaluation board, just for reference.&lt;br /&gt;
&lt;span style=&quot;font-size: 85%;&quot;&gt;Device Drivers&lt;br /&gt;  Block Devices                                                                    BLK_DEV&lt;br /&gt;    RAM block device support                                                BLK_DEV_RAM&lt;br /&gt;    (2) Default number of RAM disks                                    BLK_DEV_RAM_COUNT&lt;br /&gt;    (41984) Default RAM disk size (kbytes)                        BLK_DEV_RAM_SIZE&lt;br /&gt;    (1024) Default RAM disk block size (bytes)                BLK_DEV_RAM_BLOCKSIZE&lt;br /&gt;&lt;br /&gt;File systems&lt;br /&gt;  Kernel automounter support                                            AUTOFS_FS&lt;br /&gt;  kernel automounter version 4 support                            AUTOFS4_FS&lt;br /&gt;  Filesystem in Userspace support                                    FUSE_FS&lt;br /&gt;  Pseudo filesystems &lt;br /&gt;    /dev/ file system support                                                DEVFS_FS&lt;br /&gt;    Virtual memory file system support (former shm fs)    TMPFS&lt;br /&gt;    Userspace-driven configuration filesystem                CONFIGFS_FS&lt;br /&gt;  Miscellaneous filesystems &lt;br /&gt;    YAFFS2 file system support                                            YAFFS_FS&lt;br /&gt;    512 byte / page devices                                                YAFFS_YAFFS1&lt;br /&gt;    2048 byte / page devices                                                YAFFS_YAFFS2&lt;br /&gt;  Network File Systems                                                        NETWORK_FILESYSTEMS&lt;br /&gt;    NFS file system support                                                    NFS_FS&lt;br /&gt;        Provide NFSv3 client support                                    NFS_V3&lt;br /&gt;    Root file system on NFS                                                    ROOT_NFS&lt;br /&gt;  Journalling Flash File System v2 (JFFS2) support            JFFS2_FS&lt;br /&gt;    JFFS2 debugging verbosity (0 = quiet, 2 = noisy)        JFFS2_FS_DEBUG&lt;br /&gt;    JFFS2 write-buffering support                                        JFFS2_FS_WRITEBUFFER&lt;br /&gt;    Advanced compression options for JFFS2                    JFFS2_COMPRESSION_OPTIONS&lt;br /&gt;      JFFS2 ZLIB compression support                                JFFS2_ZLIB&lt;br /&gt;      JFFS2 RTIME compression support                                JFFS2_RTIME&lt;br /&gt;      JFFS2 RUBIN compression support                                JFFS2_RUBIN&lt;br /&gt;&lt;br /&gt;Boot options&lt;br /&gt;  Default kernel command string                                        CMDLINE            {command}&lt;br /&gt;{command}&lt;br /&gt;root=/dev/hda1 rw rootfstype=cramfs noinitrd init=/linuxrc console=ttySAC0,115200 mem=64M&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;() /linuxrc &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
cd ${ARMDEV}&lt;br /&gt;
mv linuxrc linuxrc.busybox&lt;br /&gt;
cat &amp;gt; ${ARMDEV}/linuxrc &amp;lt;&amp;lt; &quot;EOF&quot;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
echo &quot;mount /etc as ramfs&quot;&lt;br /&gt;
/bin/mount -n -t ramfs ramfs /etc&lt;br /&gt;
/bin/cp -a /mnt/etc/* /etc&lt;br /&gt;
&lt;br /&gt;
# re-create the /etc/mtab entries&lt;br /&gt;
echo &quot;re-create the /etc/mtab entries&quot;&lt;br /&gt;
/bin/mount -f -t cramfs -o remount,ro /dev/mtdblock1 /&lt;br /&gt;
&lt;br /&gt;
# mount some file system&lt;br /&gt;
echo &quot;--------munt /dev/shm as tmpfs&quot;&lt;br /&gt;
/bin/mount -n -t tmpfs tmpfs /dev/shm&lt;br /&gt;
&lt;br /&gt;
# mount /proc as proc file system&lt;br /&gt;
echo &quot;--------mount /proc as proc&quot;&lt;br /&gt;
/bin/mount -n -t proc none /proc&lt;br /&gt;
&lt;br /&gt;
# mount /sys as sysfs file system&lt;br /&gt;
echo &quot;--------mount /sys as sysfs&lt;br /&gt;
/bin/mount -n -t sysfs none /sys&lt;br /&gt;
&lt;br /&gt;
#input command to LCD&lt;br /&gt;
#sh &amp;lt; /dev/ttyS0&lt;br /&gt;
&lt;br /&gt;
exec /sbin/init&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
chmod 775 ${ARMDEV}/linuxrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;() /etc/inetd.conf &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
cat &amp;gt; ${ARMDEV}/etc/inetd.conf &amp;lt;&amp;lt; &quot;EOF&quot;&lt;br /&gt;
# &lt;service_name&gt; &lt;sock_type&gt; &lt;proto&gt; &lt;flags&gt; &lt;user&gt; &lt;server_path&gt; &lt;args&gt;&lt;br /&gt;telnet           stream      tcp     nowait  root   /usr/sbin/telnetd&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;() CLFS-Bootscripts-1.0-pre4 &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;cd ${ARMDEV}/build&lt;br /&gt;tar -jxvf ${ARMDEV}/sources/clfs-embedded-bootscripts-1.0-pre4.tar.bz2&lt;br /&gt;cd clfs-embedded-bootscripts&lt;br /&gt;make DESTDIR=${ARMDEV} install&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;() /etc/mdev.conf &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;cat &amp;gt; ${ARMDEV}/etc/mdev.conf &amp;lt;&amp;lt; &quot;EOF&quot;&lt;br /&gt;# /etc/mdev/conf&lt;br /&gt;SLEEP=10&lt;br /&gt;&lt;br /&gt;# Symlinks:&lt;br /&gt;# Syntax: %s -&amp;gt; %s&lt;br /&gt;&lt;br /&gt;MAKEDEV -&amp;gt; ../sbin/MAKEDEV&lt;br /&gt;/proc/core -&amp;gt; kcore&lt;br /&gt;fd -&amp;gt; /proc/self/fd&lt;br /&gt;mcdx -&amp;gt; mcdx0&lt;br /&gt;radio -&amp;gt; radio0&lt;br /&gt;ram -&amp;gt; ram1&lt;br /&gt;sbpcd -&amp;gt; sbpcd0&lt;br /&gt;sr0 -&amp;gt; scd0&lt;br /&gt;sr1 -&amp;gt; scd1&lt;br /&gt;sr10 -&amp;gt; scd10&lt;br /&gt;sr11 -&amp;gt; scd11&lt;br /&gt;sr12 -&amp;gt; scd12&lt;br /&gt;sr13 -&amp;gt; scd13&lt;br /&gt;sr14 -&amp;gt; scd14&lt;br /&gt;sr15 -&amp;gt; scd15&lt;br /&gt;sr16 -&amp;gt; scd16&lt;br /&gt;sr2 -&amp;gt; scd2&lt;br /&gt;sr3 -&amp;gt; scd3&lt;br /&gt;sr4 -&amp;gt; scd4&lt;br /&gt;sr5 -&amp;gt; scd5&lt;br /&gt;sr6 -&amp;gt; scd6&lt;br /&gt;sr7 -&amp;gt; scd7&lt;br /&gt;sr8 -&amp;gt; scd8&lt;br /&gt;sr9 -&amp;gt; scd9&lt;br /&gt;stderr -&amp;gt; fd/2&lt;br /&gt;stdin -&amp;gt; fd/0&lt;br /&gt;stdout -&amp;gt; fd/1&lt;br /&gt;&lt;br /&gt;# Remove these devices, if using a headless system&lt;br /&gt;# You will see an error mdev: Bad line 35&lt;br /&gt;vbi -&amp;gt; vbi0&lt;br /&gt;vcs -&amp;gt; vcs0&lt;br /&gt;vcsa -&amp;gt; vcsa0&lt;br /&gt;video -&amp;gt; video0&lt;br /&gt;# Stop Remove for headless system&lt;br /&gt;&lt;br /&gt;# Devices:&lt;br /&gt;# Syntax: %s %d:%d %s&lt;br /&gt;# devices user:group mode&lt;br /&gt;&lt;br /&gt;null 0:0 777&lt;br /&gt;zero 0:0 666&lt;br /&gt;&lt;br /&gt;urandom 0:0 444&lt;br /&gt;&lt;br /&gt;console 0:5 0600&lt;br /&gt;fd0 0:11 0660&lt;br /&gt;hdc 0:6 0660&lt;br /&gt;kmem 0:9 000&lt;br /&gt;mem 0:9 0640&lt;br /&gt;port 0:9 0640&lt;br /&gt;ptmx 0:5 0660&lt;br /&gt;&lt;br /&gt;sda* 0:6 0660&lt;br /&gt;sdb* 0:6 0660&lt;br /&gt;hda* 0:6 0660&lt;br /&gt;hdb* 0:6 0660&lt;br /&gt;&lt;br /&gt;tty 0:5 0660&lt;br /&gt;tty0* 0:5 0660&lt;br /&gt;tty1* 0:5 0660&lt;br /&gt;tty2* 0:5 0660&lt;br /&gt;tty3* 0:5 0660&lt;br /&gt;tty4* 0:5 0660&lt;br /&gt;tty5* 0:5 0660&lt;br /&gt;tty6* 0:5 0660&lt;br /&gt;&lt;br /&gt;ttyS* 0:20 640&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;() /etc/profile &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;cat &amp;gt; ${ARMDEV}/etc/profile &amp;lt;&amp;lt; &quot;EOF&quot;&lt;br /&gt;# /etc/profile&lt;br /&gt;&lt;br /&gt;# Set the initial path&lt;br /&gt;export PATH=/bin:/usr/bin&lt;br /&gt;&lt;br /&gt;if [ &#39;id -u&#39; -eq 0 ] ; then&lt;br /&gt;        PATH=/bin:/sbin:/usr/bin:/usr/sbin&lt;br /&gt;        unset HISTFILE&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;# Setup some environment variables.&lt;br /&gt;export USER=&#39;id -un&#39;&lt;br /&gt;export LOGNAME=$USER&lt;br /&gt;export HOSTNAME=&#39;/bin/hostname&#39;&lt;br /&gt;export HISTSIZE=1000&lt;br /&gt;export HISTFILESIZE=1000&lt;br /&gt;export PAGER=&#39;/bin/more &#39;&lt;br /&gt;export EDITOR=&#39;/bin/vi&#39;&lt;br /&gt;export INPUTRC=/etc/inputrc&lt;br /&gt;&lt;br /&gt;# End /etc/profile&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;() Creating the /etc/inputrc File &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;cat &amp;gt; ${ARMDEV}/etc/inputrc &amp;lt;&amp;lt; &quot;EOF&quot;&lt;br /&gt;# Begin /etc/inputrc&lt;br /&gt;# Modified by Chris Lynn &lt;roryo roryo.dynup.net=&quot;&quot;&gt;&lt;br /&gt;&lt;br /&gt;# Allow the command prompt to wrap to the next line&lt;br /&gt;set horizontal-scroll-mode Off&lt;br /&gt;&lt;br /&gt;# Enable 8bit input&lt;br /&gt;set meta-flag On&lt;br /&gt;set input-meta On&lt;br /&gt;&lt;br /&gt;# Turns off 8th bit stripping&lt;br /&gt;set convert-meta Off&lt;br /&gt;&lt;br /&gt;# Keep the 8th bit for display&lt;br /&gt;set output-meta On&lt;br /&gt;&lt;br /&gt;# none, visible or audible&lt;br /&gt;set bell-style none&lt;br /&gt;&lt;br /&gt;# All of the following map the escape sequence of the&lt;br /&gt;# value contained inside the 1st argument to the&lt;br /&gt;# readline specific functions&lt;br /&gt;&lt;br /&gt;&quot;\eOd&quot;: backward-word&lt;br /&gt;&quot;\eOc&quot;: forward-word&lt;br /&gt;&lt;br /&gt;# for linux console&lt;br /&gt;&quot;\e[1~&quot;: beginning-of-line&lt;br /&gt;&quot;\e[4~&quot;: end-of-line&lt;br /&gt;&quot;\e[5~&quot;: beginning-of-history&lt;br /&gt;&quot;\e[6~&quot;: end-of-history&lt;br /&gt;&quot;\e[3~&quot;: delete-char&lt;br /&gt;&quot;\e[2~&quot;: quoted-insert&lt;br /&gt;&lt;br /&gt;# for xterm&lt;br /&gt;&quot;\eOH&quot;: beginning-of-line&lt;br /&gt;&quot;\eOF&quot;: end-of-line&lt;br /&gt;&lt;br /&gt;# for Konsole&lt;br /&gt;&quot;\e[H&quot;: beginning-of-line&lt;br /&gt;&quot;\e[F&quot;: end-of-line&lt;br /&gt;&lt;br /&gt;# End /etc/inputrc&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;() /etc/inittab &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;cat &amp;gt; ${ARMDEV}/etc/inittab &amp;lt;&amp;lt; &quot;EOF&quot;&lt;br /&gt;# /etc/inittab&lt;br /&gt;&lt;br /&gt;::sysinit:/etc/rc.d/startup&lt;br /&gt;&lt;br /&gt;::respawn:/usr/sbin/telnetd&lt;br /&gt;&lt;br /&gt;tty1::respawn:/sbin/getty 38400 tty1&lt;br /&gt;tty2::respawn:/sbin/getty 38400 tty2&lt;br /&gt;tty3::respawn:/sbin/getty 38400 tty3&lt;br /&gt;tty4::respawn:/sbin/getty 38400 tty4&lt;br /&gt;tty5::respawn:/sbin/getty 38400 tty5&lt;br /&gt;tty6::respawn:/sbin/getty 38400 tty6&lt;br /&gt;&lt;br /&gt;# Put a getty on the serial line (for a terminal)&lt;br /&gt;# uncomment this line if your using a serial console&lt;br /&gt;#::respawn:/sbin/getty -L ttyS0 115200 vt100&lt;br /&gt;::respawn:/sbin/getty -L ttySAC0 115200 vt100&lt;br /&gt;#T0:12345:respawn:/sbin/getty -n -l /usr/local/sbin/autologin -L /dev/tts/1 115200 vt100&lt;br /&gt;&lt;br /&gt;::shutdown:/etc/rc.d/shutdown&lt;br /&gt;::ctrlaltdel:/sbin/reboot&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;() Setting Hostname &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;echo &quot;android&quot; &amp;gt; ${ARMDEV}/etc/HOSTNAME&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;() /etc/hosts File &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  Has network card&lt;br /&gt;&lt;br /&gt;cat &amp;gt; ${ARMDEV}/etc/hosts &amp;lt;&amp;lt; &quot;EOF&quot;&lt;br /&gt;# Begin /etc/hosts (network card version)&lt;br /&gt;&lt;br /&gt;127.0.0.1 localhost&lt;br /&gt;192.168.1.30 android.wizign.com android&lt;br /&gt;&lt;br /&gt;# End /etc/hosts (network card version)&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;  Without network card&lt;br /&gt;&lt;br /&gt;cat &amp;gt; ${ARMDEV}/etc/hosts &amp;lt;&amp;lt; &quot;EOF&quot;&lt;br /&gt;# Begin /etc/hosts (no network card version)&lt;br /&gt;&lt;br /&gt;127.0.0.1 dpf-dev.wizign.com dpf-dev localhost&lt;br /&gt;&lt;br /&gt;# End /etc/hosts (no network card version)&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;() Configuring the network Script &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;cat &amp;gt; ${ARMDEV}/etc/network.conf &amp;lt;&amp;lt; &quot;EOF&quot;&lt;br /&gt;# /etc/network.conf&lt;br /&gt;# Global Networking Configuration&lt;br /&gt;# interface configuration is in /etc/network.d/&lt;br /&gt;&lt;br /&gt;# set to yes to enable networking&lt;br /&gt;NETWORKING=yes&lt;br /&gt;&lt;br /&gt;# set to yes to set default route to gateway&lt;br /&gt;USE_GATEWAY=no&lt;br /&gt;&lt;br /&gt;# set to gateway IP address&lt;br /&gt;GATEWAY=192.168.1.1&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;() creates a sample interface.eth0  file for the eth0 device: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;mkdir ${ARMDEV}/etc/network.d &amp;amp;&amp;amp;&lt;br /&gt;cat &amp;gt; ${ARMDEV}/etc/network.d/interface.eth0 &amp;lt;&amp;lt; &quot;EOF&quot;&lt;br /&gt;# Network Interface Configuration&lt;br /&gt;&lt;br /&gt;# network device name&lt;br /&gt;INTERFACE=eth0&lt;br /&gt;&lt;br /&gt;# set to yes to use DHCP instead of the settings below&lt;br /&gt;DHCP=no&lt;br /&gt;&lt;br /&gt;# IP address&lt;br /&gt;IPADDRESS=192.168.1.30&lt;br /&gt;&lt;br /&gt;# netmask&lt;br /&gt;NETMASK=255.255.255.0&lt;br /&gt;&lt;br /&gt;# broadcast address&lt;br /&gt;BROADCAST=192.168.1.255&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;() Creating the ${ARMDEV}/etc/resolv.conf File &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;cat &amp;gt; ${ARMDEV}/etc/resolv.conf &amp;lt;&amp;lt; &quot;EOF&quot;&lt;br /&gt;# Begin /etc/resolv.conf&lt;br /&gt;&lt;br /&gt;domain wizign.com&lt;br /&gt;nameserver 168.95.1.1&lt;br /&gt;nameserver 168.95.192.1&lt;br /&gt;&lt;br /&gt;# End /etc/resolv.conf&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;() Copy the clean OS system, preparing to port on the evaluation board &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;su -&lt;br /&gt;&lt;br /&gt;if [ ! -d /mnt/armdev_fs ]; then&lt;br /&gt;    mkdir /mnt/armdev_fs&lt;br /&gt;fi&lt;br /&gt;mount --bind /vdisk/armdev_fs /mnt/armdev_fs&lt;br /&gt;&lt;br /&gt;export ARMDEV=&quot;/mnt/armdev&quot;&lt;br /&gt;export ARMDEV_FS=&quot;/mnt/armdev_fs&quot;&lt;br /&gt;&lt;br /&gt;for dir in $(ls &quot;${ARMDEV}&quot;); do&lt;br /&gt;    if [ &quot;$dir&quot; == &#39;sources&#39; ]; then&lt;br /&gt;        echo &quot;Skip $dir&quot;&lt;br /&gt;    elif [ &quot;$dir&quot; == &#39;build&#39; ]; then&lt;br /&gt;        echo &quot;Skip $dir&quot;&lt;br /&gt;    elif [ &quot;$dir&quot; == &#39;cross-tools&#39; ]; then&lt;br /&gt;        echo &quot;Skip $dir&quot;&lt;br /&gt;    else&lt;br /&gt;        cp -avr &quot;&quot;${ARMDEV}&quot;/$dir&quot; &quot;${ARMDEV_FS}/.&quot;&lt;br /&gt;    fi&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;rm -rfv ${ARMDEV_FS}/usr/src/*&lt;br /&gt;rm -rfv ${ARMDEV_FS}/usr/include&lt;br /&gt;rm -rfv ${ARMDEV_FS}/usr/man&lt;br /&gt;rm -rfv ${ARMDEV_FS}/usr/share/man&lt;br /&gt;&lt;br /&gt;FILES=&quot;&#39;ls ${ARMDEV_FS}/lib/*.a ${ARMDEV_FS}/usr/lib/*.a&#39;&quot;&lt;br /&gt;for file in $FILES; do&lt;br /&gt;    rm -fv $file&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;chown -Rv root:root ${ARMDEV_FS}&lt;br /&gt;chgrp -v utmp ${ARMDEV_FS}/var/run/utmp ${ARMDEV_FS}/var/log/lastlog&lt;br /&gt;mknod -m 0666 ${ARMDEV_FS}/dev/null c 1 3&lt;br /&gt;mknod -m 0600 ${ARMDEV_FS}/dev/console c 5 1&lt;br /&gt;&lt;br /&gt;  If using cramfs&lt;br /&gt;mkcramfs ${ARMDEV_FS} /mnt/rootfs.cramfs&lt;br /&gt;cp /mnt/rootfs.cramfs /var/lib/tftpboot/ramdisk-android-2.6.25.cramfs&lt;br /&gt;&lt;br /&gt;If using jffs2&lt;br /&gt;mkfs.jffs2 -d ${ARMDEV_FS} -p -s 0x200 -e 0x4000 -n -l -U -o ramdisk.jffs2&lt;br /&gt;cp /mnt/ramdisk.jffs2 /var/lib/tftpboot/ramdisk-android-2.6.25.jffs2&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;() This shell script is used to build RAM disk&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;cat &amp;gt; /mnt/mkramdisk.sh &amp;lt;&amp;lt; &quot;EOF&quot;&lt;br /&gt;#! /bin/bash&lt;br /&gt;&lt;br /&gt;# Remove files&lt;br /&gt;echo &quot;remove files&quot;&lt;br /&gt;rm -f ramdisk.img.gz&lt;br /&gt;rm -f ramdisk32.img&lt;br /&gt;rm -f ramdisk.img&lt;br /&gt;rm -fr ramdisk&lt;br /&gt;&lt;br /&gt;# Create ramdisk32&lt;br /&gt;echo &quot;create ramdisk32&quot;&lt;br /&gt;cd /mnt&lt;br /&gt;dd if=/dev/zero of=ramdisk32.img bs=1024 count=40960&lt;br /&gt;mke2fs -F -vm0 ramdisk32.img&lt;br /&gt;mkdir ramdisk&lt;br /&gt;mount -o loop ramdisk32.img ramdisk&lt;br /&gt;cd ramdisk/&lt;br /&gt;cp -arv ${ARMDEV_FS}/* .&lt;br /&gt;cd ..&lt;br /&gt;umount ramdisk&lt;br /&gt;&lt;br /&gt;# Make ram disk image&lt;br /&gt;echo &quot;make ram disk image&quot;&lt;br /&gt;cp ramdisk32.img ramdisk.img&lt;br /&gt;gzip ramdisk.img&lt;br /&gt;./mkimage -A arm -O linux -T ramdisk -C gzip -a 30080000 -e 30080000 -d ramdisk.img.gz -n &#39;SBZ2440 Ramdisk&#39; ram.img&lt;br /&gt;&lt;br /&gt;# copy files&lt;br /&gt;echo &quot;Copy RAM disk file&quot;&lt;br /&gt;cp ram.img /var/lib/tftpboot/ramdisk-android-2.6.25.s&lt;br /&gt;echo &quot;Copy uImage file&quot;&lt;br /&gt;cp ${ARMDEV}/build/linux-android-2.6.25/arch/arm/boot/uImage /var/lib/tftpboot/uImage-android-s3c2440&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;() The booting processes is as following: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Starting kernel ...&lt;br /&gt;&lt;br /&gt;Uncompressing Linux........................................................................................................... done, booting the kerne.&lt;br /&gt;Linux version 2.6.25 (armdev@test.intra.wizign.com) (gcc version 4.1.2) #54 Wed Nov 19 09:19:00 CST 2008&lt;br /&gt;CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177&lt;br /&gt;Machine: SBZ2440&lt;br /&gt;Memory policy: ECC disabled, Data cache writeback&lt;br /&gt;CPU S3C2440A (id 0x32440001)&lt;br /&gt;S3C244X: core 399.651 MHz, memory 133.217 MHz, peripheral 66.608 MHz&lt;br /&gt;S3C24XX Clocks, (c) 2004 Simtec Electronics&lt;br /&gt;CLOCK: Slow mode (2.116 MHz), fast, MPLL on, UPLL on&lt;br /&gt;CPU0: D VIVT write-back cache&lt;br /&gt;CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets&lt;br /&gt;CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets&lt;br /&gt;Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256&lt;br /&gt;Kernel command line: root=/dev/nfs rw noinitrd console=ttySAC0,115200 init=/linuxrc nfsroot=192.168.1.12:/vdisk/armdev_fs ip=192.168.1.30:192.168.1.12f&lt;br /&gt;irq: clearing pending ext status 00000080&lt;br /&gt;irq: clearing subpending status 00000003&lt;br /&gt;irq: clearing subpending status 00000002&lt;br /&gt;PID hash table entries: 256 (order: 8, 1024 bytes)&lt;br /&gt;timer tcon=00500000, tcnt d8d2, tcfg 00000200,00000000, usec 0000170f&lt;br /&gt;Console: colour dummy device 80x30&lt;br /&gt;console [ttySAC0] enabled&lt;br /&gt;Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)&lt;br /&gt;Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)&lt;br /&gt;Memory: 64MB = 64MB total&lt;br /&gt;Memory: 61184KB available (3040K code, 507K data, 144K init)&lt;br /&gt;Mount-cache hash table entries: 512&lt;br /&gt;CPU: Testing write buffer coherency: ok&lt;br /&gt;net_namespace: 152 bytes&lt;br /&gt;NET: Registered protocol family 16&lt;br /&gt;S3C2410 Power Management, (c) 2004 Simtec Electronics&lt;br /&gt;S3C2440: Initialising architecture&lt;br /&gt;S3C2440: IRQ Support&lt;br /&gt;S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics&lt;br /&gt;DMA channel 0 at c4800000, irq 33&lt;br /&gt;DMA channel 1 at c4800040, irq 34&lt;br /&gt;DMA channel 2 at c4800080, irq 35&lt;br /&gt;DMA channel 3 at c48000c0, irq 36&lt;br /&gt;S3C244X: Clock Support, DVS off&lt;br /&gt;usbcore: registered new interface driver usbfs&lt;br /&gt;usbcore: registered new interface driver hub&lt;br /&gt;usbcore: registered new device driver usb&lt;br /&gt;NET: Registered protocol family 2&lt;br /&gt;IP route cache hash table entries: 1024 (order: 0, 4096 bytes)&lt;br /&gt;TCP established hash table entries: 2048 (order: 2, 16384 bytes)&lt;br /&gt;TCP bind hash table entries: 2048 (order: 1, 8192 bytes)&lt;br /&gt;TCP: Hash tables configured (established 2048 bind 2048)&lt;br /&gt;TCP reno registered&lt;br /&gt;NetWinder Floating Point Emulator V0.97 (double precision)&lt;br /&gt;JFFS2 version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.&lt;br /&gt;fuse init (API version 7.9)&lt;br /&gt;io scheduler noop registered&lt;br /&gt;io scheduler anticipatory registered (default)&lt;br /&gt;io scheduler deadline registered&lt;br /&gt;io scheduler cfq registered&lt;br /&gt;Console: switching to colour frame buffer device 30x40&lt;br /&gt;fb0: s3c2410fb frame buffer device&lt;br /&gt;lp: driver loaded but no devices found&lt;br /&gt;ppdev: user-space parallel port driver&lt;br /&gt;Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled&lt;br /&gt;s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440&lt;br /&gt;s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440&lt;br /&gt;s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440&lt;br /&gt;brd: module loaded&lt;br /&gt;loop: module loaded&lt;br /&gt;dm9000 Ethernet Driver, V1.30&lt;br /&gt;eth0: dm9000 at c485e300,c4860304 IRQ 51 MAC: 08:00:3e:26:0a:5b (chip)&lt;br /&gt;Uniform Multi-Platform E-IDE driver&lt;br /&gt;ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx&lt;br /&gt;BAST NOR-Flash Driver, (c) 2004 Simtec Electronics&lt;br /&gt;S3C24XX NAND Driver, (c) 2004 Simtec Electronics&lt;br /&gt;s3c2440-nand s3c2440-nand: Tacls=3, 22ns Twrph0=8 60ns, Twrph1=3 22ns&lt;br /&gt;NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)&lt;br /&gt;Scanning device for bad blocks&lt;br /&gt;Creating 2 MTD partitions on &quot;NAND 64MiB 3,3V 8-bit&quot;:&lt;br /&gt;0x00000000-0x00200000 : &quot;Kernel&quot;&lt;br /&gt;0x00200000-0x04000000 : &quot;root partition&quot;&lt;br /&gt;usbmon: debugfs is not available&lt;br /&gt;s3c2410-ohci s3c2410-ohci: S3C24XX OHCI&lt;br /&gt;s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1&lt;br /&gt;s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000&lt;br /&gt;usb usb1: configuration #1 chosen from 1 choice&lt;br /&gt;hub 1-0:1.0: USB hub found&lt;br /&gt;hub 1-0:1.0: 2 ports detected&lt;br /&gt;mice: PS/2 mouse device common for all mice&lt;br /&gt;S3C24XX RTC, (c) 2004,2006 Simtec Electronics&lt;br /&gt;s3c2440-i2c s3c2440-i2c: slave address 0x10&lt;br /&gt;s3c2440-i2c s3c2440-i2c: bus frequency set to 378 KHz&lt;br /&gt;s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter&lt;br /&gt;S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics&lt;br /&gt;s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled&lt;br /&gt;logger: created 64K log &#39;log_main&#39;&lt;br /&gt;logger: created 64K log &#39;log_events&#39;&lt;br /&gt;logger: created 64K log &#39;log_radio&#39;&lt;br /&gt;TCP cubic registered&lt;br /&gt;NET: Registered protocol family 1&lt;br /&gt;RPC: Registered udp transport module.&lt;br /&gt;RPC: Registered tcp transport module.&lt;br /&gt;drivers/rtc/hctosys.c: unable to open rtc device (rtc0)&lt;br /&gt;eth0: link up, 100Mbps, full-duplex, lpa 0x45E1&lt;br /&gt;IP-Config: Complete:&lt;br /&gt;     device=eth0, addr=192.168.1.30, mask=255.255.255.0, gw=192.168.1.1,&lt;br /&gt;     host=Android, domain=, nis-domain=(none),&lt;br /&gt;     bootserver=192.168.1.12, rootserver=192.168.1.12, rootpath=&lt;br /&gt;prepare_namespace() - start&lt;br /&gt;        mount_root()&lt;br /&gt;Looking up port of RPC 100003/2 on 192.168.1.12&lt;br /&gt;Looking up port of RPC 100005/1 on 192.168.1.12&lt;br /&gt;VFS: Mounted root (nfs filesystem).&lt;br /&gt;prepare_namespace() - end&lt;br /&gt;Freeing init memory: 144K&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;() Use ping to test that the system is booted&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;$ ping 192.168.1.30&lt;br /&gt;PING 192.168.1.30 (192.168.1.30) 56(84) bytes of data.&lt;br /&gt;64 bytes from 192.168.1.30: icmp_seq=1 ttl=64 time=0.417 ms&lt;br /&gt;64 bytes from 192.168.1.30: icmp_seq=2 ttl=64 time=0.384 ms&lt;br /&gt;64 bytes from 192.168.1.30: icmp_seq=3 ttl=64 time=0.381 ms&lt;/roryo&gt;&lt;/args&gt;&lt;/server_path&gt;&lt;/user&gt;&lt;/flags&gt;&lt;/proto&gt;&lt;/sock_type&gt;&lt;/service_name&gt;</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/2244901398772287092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/2244901398772287092' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/2244901398772287092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/2244901398772287092'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2008/11/linux-kernel-2625-android-samsung.html' title='Porting Linux kernel 2.6.25 (Android version) to SAMSUNG S3C2440A'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-5036529181694090236</id><published>2008-11-15T00:32:00.000+08:00</published><updated>2015-04-23T12:39:04.054+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Basic"/><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="cscope"/><category scheme="http://www.blogger.com/atom/ns#" term="editor"/><category scheme="http://www.blogger.com/atom/ns#" term="kscope"/><category scheme="http://www.blogger.com/atom/ns#" term="source"/><title type='text'>Source code editor - kscope</title><content type='html'>If you are not customized the emacs editor style, maybe the kscope editor is a good choice to edit source code. &lt;br /&gt;
&lt;a href=&quot;http://kscope.sourceforge.net/&quot;&gt;KScope&lt;/a&gt; is a source code editor, implementing Cscope, on KDE environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let&#39;s doing a simple editing steps:&lt;br /&gt;
&lt;br /&gt;
Open project:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO0anzyyACsIGcmeGR_SD9-D30NvqJ-KWvDMoMZhMyNLI9Sff_tYp0NMIJ_1p0kA_-ZeJ8sw-7zbSV8y4X3GSepYBLNPu6eEhhBRG4nnZDT_9TuTl4ECjemSmJgy9KA4Ibgz1CpQQaoMg/s1600-h/20081114-kscope-project.gif&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO0anzyyACsIGcmeGR_SD9-D30NvqJ-KWvDMoMZhMyNLI9Sff_tYp0NMIJ_1p0kA_-ZeJ8sw-7zbSV8y4X3GSepYBLNPu6eEhhBRG4nnZDT_9TuTl4ECjemSmJgy9KA4Ibgz1CpQQaoMg/s320/20081114-kscope-project.gif&quot; id=&quot;BLOGGER_PHOTO_ID_5268552570564771730&quot; style=&quot;cursor: pointer; float: left; height: 256px; margin: 0pt 10px 10px 0pt; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Add the related source code on the list (select tree button):&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiokUyUhX_TyqWJ8JMxj96GgbuJOKDjwoay_go6FJV6EHmD904csrF-iQMWxrECoPlFVT8XvY5OmbXD8vxa9sWszgnJu3ok0ALgoOaFOwjJ3al2Sp4zLgcng2n5DkpdeO_6SNSmxgM46hw/s1600-h/20081114-kscope-addfiles.gif&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiokUyUhX_TyqWJ8JMxj96GgbuJOKDjwoay_go6FJV6EHmD904csrF-iQMWxrECoPlFVT8XvY5OmbXD8vxa9sWszgnJu3ok0ALgoOaFOwjJ3al2Sp4zLgcng2n5DkpdeO_6SNSmxgM46hw/s320/20081114-kscope-addfiles.gif&quot; id=&quot;BLOGGER_PHOTO_ID_5268552571875451730&quot; style=&quot;cursor: pointer; float: left; height: 256px; margin: 0pt 10px 10px 0pt; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Open the target source code file:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7N37SMvK-tPcwK99KIPleJ8KhyphenhyphenW4tW4WQL23zkrLzXs1yPyjCbM4cNCev-wCHuB9WTaMuw5Gu2UPSh9JF0qEZF0zy57p97_YZMewT2vJOFFwiFEpH4SCM7GE0NpZGiQ4gbrLYXgyozIE/s1600-h/20081114-kscope-codeview.gif&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7N37SMvK-tPcwK99KIPleJ8KhyphenhyphenW4tW4WQL23zkrLzXs1yPyjCbM4cNCev-wCHuB9WTaMuw5Gu2UPSh9JF0qEZF0zy57p97_YZMewT2vJOFFwiFEpH4SCM7GE0NpZGiQ4gbrLYXgyozIE/s320/20081114-kscope-codeview.gif&quot; id=&quot;BLOGGER_PHOTO_ID_5268552570564771730&quot; style=&quot;cursor: pointer; float: left; height: 256px; margin: 0pt 10px 10px 0pt; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Search the definition position of function:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfebfvTSgVuVm8S6JpMiJMVWFNysUFGr_Mqc-OC1Tqt-M0nCg1cEa9BuagqY9K8MrOB1_doZQv3nLN9qJ9zzQrMXMqn-WQKLKKNrexwe7xXJw2L3V9VI5P2NibgD41eksXKgAG7rL8pxM/s1600-h/20081114-kscope-search.gif&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfebfvTSgVuVm8S6JpMiJMVWFNysUFGr_Mqc-OC1Tqt-M0nCg1cEa9BuagqY9K8MrOB1_doZQv3nLN9qJ9zzQrMXMqn-WQKLKKNrexwe7xXJw2L3V9VI5P2NibgD41eksXKgAG7rL8pxM/s320/20081114-kscope-search.gif&quot; id=&quot;BLOGGER_PHOTO_ID_5268552578272264898&quot; style=&quot;cursor: pointer; float: left; height: 256px; margin: 0pt 10px 10px 0pt; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Use relational chart to display target function and other functions,&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNgF897Jlso00I9zHRO01lCEsApAjhFFKv-buF2aZ8JVzb3xoNZDZqwYXQuzGUFG-KRRXW0UHBXH-81NVe3bcCZD077LlJ13ettl0ILstJhMiYgjIlbhShZaC7cV1ObQiVJCA4UWHVKik/s1600-h/20081114-kscope-graph.gif&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNgF897Jlso00I9zHRO01lCEsApAjhFFKv-buF2aZ8JVzb3xoNZDZqwYXQuzGUFG-KRRXW0UHBXH-81NVe3bcCZD077LlJ13ettl0ILstJhMiYgjIlbhShZaC7cV1ObQiVJCA4UWHVKik/s320/20081114-kscope-graph.gif&quot; id=&quot;BLOGGER_PHOTO_ID_5268552578596859634&quot; style=&quot;cursor: pointer; float: left; height: 256px; margin: 0pt 10px 10px 0pt; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To install kscope:&lt;br /&gt;
&lt;br /&gt;
Fedora Core 9:&lt;br /&gt;
&lt;br /&gt;
# yum install kscope&lt;br /&gt;
&lt;br /&gt;
Ubuntu 8.10:&lt;br /&gt;
&lt;br /&gt;
# apt-get install kscope</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/5036529181694090236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/5036529181694090236' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/5036529181694090236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/5036529181694090236'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2008/11/source-code-editor-kscope.html' title='Source code editor - kscope'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO0anzyyACsIGcmeGR_SD9-D30NvqJ-KWvDMoMZhMyNLI9Sff_tYp0NMIJ_1p0kA_-ZeJ8sw-7zbSV8y4X3GSepYBLNPu6eEhhBRG4nnZDT_9TuTl4ECjemSmJgy9KA4Ibgz1CpQQaoMg/s72-c/20081114-kscope-project.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-5415407515399499755</id><published>2008-11-15T00:14:00.000+08:00</published><updated>2015-04-23T12:51:09.482+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Basic"/><category scheme="http://www.blogger.com/atom/ns#" term="code"/><category scheme="http://www.blogger.com/atom/ns#" term="ecb"/><category scheme="http://www.blogger.com/atom/ns#" term="editor"/><category scheme="http://www.blogger.com/atom/ns#" term="emacs"/><category scheme="http://www.blogger.com/atom/ns#" term="source"/><title type='text'>Source code editor - emacs + ecb</title><content type='html'>To browse, search, and edit the source code of linux kernel, the general editors is not a good tool. One of the best way is using emacs + &lt;a href=&quot;http://ecb.sourceforge.net/&quot;&gt;ECB&lt;/a&gt;(Emacs Code Browse)&lt;br /&gt;
&lt;br /&gt;
To use ECB, it supports following functional windows:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Directory tree window&lt;/li&gt;
&lt;li&gt;Source code file list window&lt;/li&gt;
&lt;li&gt;Display current opened file&#39;s functions, classes, method, and ....etc.&lt;/li&gt;
&lt;li&gt;The history opened files window&lt;/li&gt;
&lt;li&gt;Some convenient editing functions&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: right;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHfaFF8z07duPkFav2sM3kT9X0uAfwnpneWsmAFAV2BKIUI3Xq5_sCirDSemoTTcz0tksjltmcXyasH6mMaisa8C4YCKFj74B82cFWXn27ak2SMoWoNROhtN7PG26xWPflD_E2ciBbAJA/s1600-h/20081114-emacs-ecb.gif&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHfaFF8z07duPkFav2sM3kT9X0uAfwnpneWsmAFAV2BKIUI3Xq5_sCirDSemoTTcz0tksjltmcXyasH6mMaisa8C4YCKFj74B82cFWXn27ak2SMoWoNROhtN7PG26xWPflD_E2ciBbAJA/s320/20081114-emacs-ecb.gif&quot; id=&quot;BLOGGER_PHOTO_ID_5268549704402603026&quot; style=&quot;cursor: pointer; float: left; height: 253px; margin: 0pt 10px 10px 0pt; width: 320px;&quot; /&gt;&lt;/a&gt;  To start the editing mode, after run emacs, presses {Alt+X} keys, keying ecb-activate{Enter},  now, you are preparing to edit source code file, the display window is as the showing picture.&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;alt x=&quot;&quot;&gt;&lt;enter&gt;To install emacs and ecb:&lt;br /&gt;&lt;br /&gt;Fedora Core 9:&lt;br /&gt;&lt;br /&gt;# yum install emacs ecb&lt;br /&gt;&lt;br /&gt;Ubuntu 8.10:&lt;br /&gt;&lt;br /&gt;# apt-get install emacs ecb&lt;br /&gt;or&lt;br /&gt;# apt-get install emacs22 ecb&lt;br /&gt;&lt;br /&gt;If you want to install emacs for MS Windows, go to &lt;a href=&quot;http://www.gnu.org/software/emacs/&quot;&gt;emacs&lt;/a&gt;,s web site. Then read some configuration from ecb web site.&lt;br /&gt;&lt;/enter&gt;&lt;/alt&gt;</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/5415407515399499755/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/5415407515399499755' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/5415407515399499755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/5415407515399499755'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2008/11/source-code-editor-emacs-ecb.html' title='Source code editor - emacs + ecb'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHfaFF8z07duPkFav2sM3kT9X0uAfwnpneWsmAFAV2BKIUI3Xq5_sCirDSemoTTcz0tksjltmcXyasH6mMaisa8C4YCKFj74B82cFWXn27ak2SMoWoNROhtN7PG26xWPflD_E2ciBbAJA/s72-c/20081114-emacs-ecb.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-5271253665958368855</id><published>2008-11-05T09:52:00.000+08:00</published><updated>2008-11-05T12:29:51.213+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="Davinci"/><category scheme="http://www.blogger.com/atom/ns#" term="DM355"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="porting"/><category scheme="http://www.blogger.com/atom/ns#" term="TI"/><title type='text'>Unfinished task - porting android linux-2.6.23 to TI Davinci DM355</title><content type='html'>This is an unfinished task, I post it for sharing my experience of encountered problems while I am porting linux kernel to a new hardware device.&lt;br /&gt;&lt;br /&gt;Target device is TMS320DM355 DVEVM.&lt;br /&gt;The linux kernel is android version 2.6.23.&lt;br /&gt;Cross compiled GCC is built by myself, the study source is &lt;a href=&quot;http://cross-lfs.org/view/clfs-embedded/arm/&quot;&gt;Cross-Compiled Linux From Scratch - Embedded&lt;/a&gt; (Version SVN-0.0.1-20080109-arm).&lt;br /&gt;&lt;br /&gt;A good reference document about porting linux kernel is &quot;Porting the Linux Kernel to a New ARM Platform&quot;, Wookey and Tak-Shing, &lt;a href=&quot;http://www.aleph1.co.uk/&quot;&gt;Aleph One&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The last encountered problem is that the kernel can not boot from DVEVM board, the display information is as following:&lt;br /&gt;&lt;br /&gt;2048 MiB&lt;br /&gt;In:    serial&lt;br /&gt;Out:   serial&lt;br /&gt;Err:   serial&lt;br /&gt;ARM Clock :- 216MHz&lt;br /&gt;DDR Clock :- 171MHz&lt;br /&gt;Hit any key to stop autoboot:  0&lt;br /&gt;BOOTP broadcast 1&lt;br /&gt;DHCP client bound to address 192.168.1.101&lt;br /&gt;TFTP from server 192.168.1.12; our IP address is 192.168.1.101&lt;br /&gt;Filename &#39;uImage-android&#39;.&lt;br /&gt;Load address: 0x80700000&lt;br /&gt;Loading: #################################################################&lt;br /&gt;        #################################################################&lt;br /&gt;        #################################################################&lt;br /&gt;        #################################################################&lt;br /&gt;        #################################################################&lt;br /&gt;        ####################&lt;br /&gt;done&lt;br /&gt;Bytes transferred = 1764160 (1aeb40 hex)&lt;br /&gt;## Booting image at 80700000 ...&lt;br /&gt;  Image Name:   Linux-2.6.23&lt;br /&gt;  Image Type:   ARM Linux Kernel Image (uncompressed)&lt;br /&gt;  Data Size:    1764096 Bytes =  1.7 MB&lt;br /&gt;  Load Address: 80008000&lt;br /&gt;  Entry Point:  80008000&lt;br /&gt;  Verifying Checksum ... OK&lt;br /&gt;OK&lt;br /&gt;&lt;br /&gt;Starting kernel ...&lt;br /&gt;&lt;br /&gt;Uncompressing Linux.................................................................................................................. done, booting the kernel.&lt;br /&gt;&lt;br /&gt;After my basic analysis, it seems that it is related to the process of enabling the MMU, the dependent file is arch/arm/kernel/head.S; other possible files are arch/arm/mm/proc-arm926.S and arch/arm/mach-davinci/board-evm.c.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The most files that I have modified are listed as following:&lt;br /&gt;&lt;br /&gt;arch/arm/tools/mach-types&lt;br /&gt;arch/arm/Kconfig&lt;br /&gt;arch/arm/Makefile&lt;br /&gt;arch/arm/kernel/head.S&lt;br /&gt;arch/arm/kernel/head-common.S&lt;br /&gt;arch/arm/kernel/debug.S&lt;br /&gt;arch/arm/mm/Kconfig&lt;br /&gt;arch/arm/mach-davinci/Kconfig&lt;br /&gt;arch/arm/mach-davinci/Makefile&lt;br /&gt;arch/arm/mach-davinci/io.c&lt;br /&gt;arch/arm/mach-davinci/irq.c&lt;br /&gt;arch/arm/mach-davinci/time.c&lt;br /&gt;arch/arm/mach-davinci/clock.c&lt;br /&gt;arch/arm/mach-davinci/serial.c&lt;br /&gt;arch/arm/mach-davinci/gpio.c&lt;br /&gt;arch/arm/mach-davinci/psc.c&lt;br /&gt;arch/arm/mach-davinci/board-evm.c&lt;br /&gt;include/asm-arm/arch-davinci/&lt;br /&gt;include/asm-arm/arch-davinci/gpio.h&lt;br /&gt;include/asm-arm/arch-davinci/io.h&lt;br /&gt;include/asm-arm/arch-davinci/dma.h&lt;br /&gt;include/asm-arm/arch-davinci/memory.h&lt;br /&gt;include/asm-arm/arch-davinci/system.h&lt;br /&gt;include/asm-arm/arch-davinci/timex.h&lt;br /&gt;include/asm-arm/arch-davinci/hardware.h&lt;br /&gt;include/asm-arm/arch-davinci/cpu.h&lt;br /&gt;include/asm-arm/arch-davinci/uncompress.h&lt;br /&gt;include/asm-arm/mach/arch.h&lt;br /&gt;include/asm-arm/setup.h&lt;br /&gt;include/asm-arm/procinfo.h&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The following context describes the modified source code in each files:&lt;br /&gt;&lt;br /&gt;### arch/arm/tools/mach-types ###&lt;br /&gt;&lt;br /&gt;# machine_is_xxx    CONFIG_xxxx        MACH_TYPE_xxx        number&lt;br /&gt;#&lt;br /&gt;anakin            ARCH_ANAKIN        ANAKIN            57&lt;br /&gt;davinci_dm355_evm    MACH_DAVINCI_DM355_EVM    DAVINCI_DM355_EVM    1381&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### arch/arm/Kconfig ###&lt;br /&gt;&lt;br /&gt;config LEDS&lt;br /&gt;&lt;br /&gt;  depends on ARCH_CDB89712 || ARCH_CO285 || ARCH_EBSA110 || \&lt;br /&gt;         ARCH_EBSA285 || ARCH_IMX || ARCH_INTEGRATOR || \&lt;br /&gt;         ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_NETWINDER || \&lt;br /&gt;         ARCH_OMAP || ARCH_P720T || ARCH_PXA_IDP || \&lt;br /&gt;         ARCH_SA1100 || ARCH_SHARK || ARCH_VERSATILE || \&lt;br /&gt;         ARCH_AT91 || MACH_TRIZEPS4 || ARCH_DAVINCI || \&lt;br /&gt;         ARCH_KS8695 || MACH_DAVINCI_EVM&lt;br /&gt;&lt;br /&gt;config LEDS_TIMER&lt;br /&gt;&lt;br /&gt;  bool &quot;Timer LED&quot; if (!ARCH_CDB89712 &amp;amp;&amp;amp; !ARCH_OMAP) || \&lt;br /&gt;              OMAP_OSK_MISTRAL || MACH_OMAP_H2 \&lt;br /&gt;              || MACH_OMAP_PERSEUS2 || MACH_DAVINCI_EVM&lt;br /&gt;  depends on LEDS || MACH_DAVINCI_EVM&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if PCMCIA || ARCH_CLPS7500 || ARCH_IOP32X || ARCH_IOP33X || ARCH_IXP4XX \&lt;br /&gt;  || ARCH_L7200 || ARCH_LH7A40X || ARCH_PXA || ARCH_RPC \&lt;br /&gt;  || ARCH_S3C2410 || ARCH_SA1100 || ARCH_SHARK || FOOTBRIDGE \&lt;br /&gt;  || ARCH_IXP23XX || ARCH_DAVINCI&lt;br /&gt;source &quot;drivers/ide/Kconfig&quot;&lt;br /&gt;endif&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### arch/arm/Makefile ###&lt;br /&gt;&lt;br /&gt;CPPFLAGS_vmlinux.lds = -DTEXT_OFFSET=$(TEXT_OFFSET)&lt;br /&gt;&lt;br /&gt;machine-$(CONFIG_ARCH_DAVINCI)       := davinci&lt;br /&gt;&lt;br /&gt;#Default value&lt;br /&gt;head-y        := arch/arm/kernel/head$(MMUEXT).o arch/arm/kernel/init_task.o&lt;br /&gt;textofs-y    := 0x00008000&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### arch/arm/kernel/head.S ###&lt;br /&gt;&lt;br /&gt;/* line 81~93 */&lt;br /&gt;&lt;br /&gt;  .type    stext, %function&lt;br /&gt;ENTRY(stext)&lt;br /&gt;  msr    cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode&lt;br /&gt;                      @ and irqs disabled&lt;br /&gt;  mrc    p15, 0, r9, c0, c0        @ get processor id&lt;br /&gt;  bl    __lookup_processor_type        @ r5=procinfo r9=cpuid&lt;br /&gt;  movs    r10, r5                @ invalid processor (r5=0)?&lt;br /&gt;  beq    __error_p            @ yes, error &#39;p&#39;&lt;br /&gt;  bl    __lookup_machine_type        @ r5=machinfo&lt;br /&gt;  movs    r8, r5                @ invalid machine (r5=0)?&lt;br /&gt;  beq    __error_a            @ yes, error &#39;a&#39;&lt;br /&gt;  bl    __vet_atags&lt;br /&gt;  bl    __create_page_tables&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# comment&lt;br /&gt;__vet_atags:arch/arm/kernel/head-common.S&lt;br /&gt;__create_page_tables&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### arch/arm/kernel/head-common.S ###&lt;br /&gt;&lt;br /&gt;/* line 80~114 */&lt;br /&gt;&lt;br /&gt;  .type    __error_a, %function&lt;br /&gt;__error_a:&lt;br /&gt;#ifdef CONFIG_DEBUG_LL&lt;br /&gt;  mov    r4, r1                @ preserve machine ID&lt;br /&gt;  adr    r0, str_a1&lt;br /&gt;  bl    printascii&lt;br /&gt;  mov    r0, r4&lt;br /&gt;  bl    printhex8&lt;br /&gt;  adr    r0, str_a2&lt;br /&gt;  bl    printascii&lt;br /&gt;  adr    r3, 3f&lt;br /&gt;  ldmia    r3, {r4, r5, r6}        @ get machine desc list&lt;br /&gt;  sub    r4, r3, r4            @ get offset between virt&amp;amp;phys&lt;br /&gt;  add    r5, r5, r4            @ convert virt addresses to&lt;br /&gt;  add    r6, r6, r4            @ physical address space&lt;br /&gt;1:    ldr    r0, [r5, #MACHINFO_TYPE]    @ get machine type&lt;br /&gt;  bl    printhex8&lt;br /&gt;  mov    r0, #&#39;\t&#39;&lt;br /&gt;  bl    printch&lt;br /&gt;  ldr     r0, [r5, #MACHINFO_NAME]    @ get machine name&lt;br /&gt;  add    r0, r0, r4&lt;br /&gt;  bl    printascii&lt;br /&gt;  mov    r0, #&#39;\n&#39;&lt;br /&gt;  bl    printch&lt;br /&gt;  add    r5, r5, #SIZEOF_MACHINE_DESC    @ next machine_desc&lt;br /&gt;  cmp    r5, r6&lt;br /&gt;  blo    1b&lt;br /&gt;  adr    r0, str_a3&lt;br /&gt;  bl    printascii&lt;br /&gt;  b    __error&lt;br /&gt;str_a1:    .asciz    &quot;\nError: unrecognized/unsupported machine ID (r1 = 0x&quot;&lt;br /&gt;str_a2:    .asciz    &quot;).\n\nAvailable machine support:\n\nID (hex)\tNAME\n&quot;&lt;br /&gt;str_a3:    .asciz    &quot;\nPlease check your kernel config and/or bootloader.\n&quot;&lt;br /&gt;  .align&lt;br /&gt;#endif&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### arch/arm/kernel/debug.S ###&lt;br /&gt;&lt;br /&gt;Debug Serial Output&lt;br /&gt;addruart, rx        - Provide UART address in \rx&lt;br /&gt;senduart rd, rx    - Send character in \rd (@ address \rx)&lt;br /&gt;busyuart rd, rx    - Wait until UART is done sending&lt;br /&gt;waituart rd, rx    - Wait for Clear to Send&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### arch/arm/mm/Kconfig ###&lt;br /&gt;&lt;br /&gt;# ARM926T&lt;br /&gt;config CPU_ARM926T&lt;br /&gt;  bool &quot;Support ARM926T processor&quot;&lt;br /&gt;  depends on ARCH_GOLDFISH || ARCH_INTEGRATOR || ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || MACH_REALVIEW_EB || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 || ARCH_AT91SAM9260 || ARCH_AT91SAM9261 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_NS9XXX || ARCH_DAVINCI&lt;br /&gt;  default y if ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 || ARCH_AT91SAM9260 || ARCH_AT91SAM9261 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_NS9XXX || ARCH_DAVINCI&lt;br /&gt;  select CPU_32v5&lt;br /&gt;  select CPU_ABRT_EV5TJ&lt;br /&gt;  select CPU_CACHE_VIVT&lt;br /&gt;  select CPU_CP15_MMU&lt;br /&gt;  select CPU_COPY_V4WB if MMU&lt;br /&gt;  select CPU_TLB_V4WBI if MMU&lt;br /&gt;  select ARM_THUMB&lt;br /&gt;  help&lt;br /&gt;    This is a variant of the ARM920.  It has slightly different&lt;br /&gt;    instruction sequences for cache and TLB operations.  Curiously,&lt;br /&gt;    there is no documentation on it at the ARM corporate website.&lt;br /&gt;&lt;br /&gt;    Say Y if you want support for the ARM926T processor.&lt;br /&gt;    Otherwise, say N.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### arch/arm/mach-davinci/Kconfig ###&lt;br /&gt;&lt;br /&gt;config ARCH_DAVINCI355&lt;br /&gt;  default n&lt;br /&gt;  bool &quot;DaVinci DM355 based system&quot;&lt;br /&gt;&lt;br /&gt;comment &quot;DaVinci Board Type&quot;&lt;br /&gt;&lt;br /&gt;config MACH_DAVINCI_EVM&lt;br /&gt;  bool &quot;TI DaVinci EVM&quot;&lt;br /&gt;  default y&lt;br /&gt;  depends on ARCH_DAVINCI644x&lt;br /&gt;  help&lt;br /&gt;    Configure this option to specify the whether the board used&lt;br /&gt;    for development is a DaVinci EVM&lt;br /&gt;&lt;br /&gt;config MACH_DAVINCI_DM355_EVM&lt;br /&gt;  bool &quot;TI DM355 EVM&quot;&lt;br /&gt;  default n&lt;br /&gt;  depends on ARCH_DAVINCI355&lt;br /&gt;  help&lt;br /&gt;    Configure this option to specify the whether the board used&lt;br /&gt;    for development is a DM355 EVM&lt;br /&gt;&lt;br /&gt;config DAVINCI_I2C_EXPANDER&lt;br /&gt;  bool &quot;TI DaVinci I2C Expander&quot;&lt;br /&gt;  default y&lt;br /&gt;  depends on ARCH_DAVINCI644x&lt;br /&gt;  select I2C_DAVINCI&lt;br /&gt;  help&lt;br /&gt;    Configure this option to specify whether the board used&lt;br /&gt;    has I2C exapnder with ATA, USB, CF.&lt;br /&gt;&lt;br /&gt;config DAVINCI_MCBSP&lt;br /&gt;  bool&lt;br /&gt;      prompt &quot;DaVinci McBSP Driver&quot; if SOUND_DAVINCI=n&lt;br /&gt;  depends on ARCH_DAVINCI&lt;br /&gt;  default SOUND_DAVINCI&lt;br /&gt;  ---help---&lt;br /&gt;  DaVinci McBSP driver.  Auto-enabled by DaVinci sound driver.&lt;br /&gt;&lt;br /&gt;comment &quot;DaVinci Options&quot;&lt;br /&gt;&lt;br /&gt;config DAVINCI_BLK_DEV_CF&lt;br /&gt;  bool &quot;TI DaVinci CF Card Support&quot;&lt;br /&gt;  default Y&lt;br /&gt;  depends on BLK_DEV_DAVINCI&lt;br /&gt;  help&lt;br /&gt;    Configure this option to enable CF Card support.&lt;br /&gt;&lt;br /&gt;config DM355_NAND_256KB_BLOCKS&lt;br /&gt;  bool &quot;NAND chip installed on DM355 EVM has 256KB blocks&quot;&lt;br /&gt;  default y&lt;br /&gt;  depends on MACH_DAVINCI_DM355_EVM&lt;br /&gt;  help&lt;br /&gt;    The boot firmware on the DM355 EVM assumes a default partition map&lt;br /&gt;    for NAND flash based on erase block offsets.  Thus, the partition map&lt;br /&gt;    varies based on the size of the erase blocks in the particular NAND&lt;br /&gt;    flash component installed on the board.  Answer Y here if the NAND&lt;br /&gt;    chip (e.g a 16 Gigabit Micron MT29F16G08QAA) installed on your board&lt;br /&gt;    has 256KB blocks.  Answer N here if the NAND chip (e.g. a 4 Gigabit&lt;br /&gt;    Micron MT29F4G08AAA) installed on your board has 128KB blocks.&lt;br /&gt;&lt;br /&gt;choice&lt;br /&gt;  prompt &quot;Low-level debug console UART&quot;&lt;br /&gt;  default DAVINCI_LL_DEBUG_UART0&lt;br /&gt;&lt;br /&gt;config DAVINCI_LL_DEBUG_UART0&lt;br /&gt;  bool &quot;UART0&quot;&lt;br /&gt;&lt;br /&gt;config DAVINCI_LL_DEBUG_UART1&lt;br /&gt;  bool &quot;UART1&quot;&lt;br /&gt;&lt;br /&gt;endchoice&lt;br /&gt;&lt;br /&gt;config DM355_SPI&lt;br /&gt;      bool &quot;TI DM355 SPI device&quot;&lt;br /&gt;      default y&lt;br /&gt;      help&lt;br /&gt;        Configure this option to specify whether the board used&lt;br /&gt;        has SPI device.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### arch/arm/mach-davinci/Makefile ###&lt;br /&gt;&lt;br /&gt;# Common objects&lt;br /&gt;obj-y             := time.o irq.o clock.o serial.o io.o id.o psc.o gpio.o mux.o&lt;br /&gt;&lt;br /&gt;# Board specific&lt;br /&gt;# obj-$(CONFIG_MACH_DAVINCI_EVM)  += board-evm.o&lt;br /&gt;obj-$(CONFIG_MACH_DAVINCI_DM355_EVM)    += board-evm.o&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### arch/arm/mach-davinci/io.c ###&lt;br /&gt;&lt;br /&gt;static struct map_desc davinci_io_desc[] __initdata = {&lt;br /&gt;  {&lt;br /&gt;      .virtual    = IO_VIRT,&lt;br /&gt;      .pfn        = __phys_to_pfn(IO_PHYS),&lt;br /&gt;      .length        = IO_SIZE,&lt;br /&gt;      .type        = MT_DEVICE&lt;br /&gt;  },&lt;br /&gt;  {&lt;br /&gt;      .virtual    = DAVINCI_IRAM_VIRT,&lt;br /&gt;      .pfn    = __phys_to_pfn(DAVINCI_IRAM_BASE),&lt;br /&gt;      .length        = SZ_16K,&lt;br /&gt;      .type        = MT_DEVICE&lt;br /&gt;  },&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;void __init davinci_map_common_io(void)&lt;br /&gt;{&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;  davinci_clk_init();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### arch/arm/mach-davinci/irq.c ###&lt;br /&gt;&lt;br /&gt;### arch/arm/mach-davinci/time.c ###&lt;br /&gt;&lt;br /&gt;### arch/arm/mach-davinci/clock.c ###&lt;br /&gt;&lt;br /&gt;#include &lt;asm arch=&quot;&quot; h=&quot;&quot;&gt;&lt;br /&gt;&lt;br /&gt;int __init davinci_clk_init(void)&lt;br /&gt;{&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;  if (cpu_is_davinci_dm355()) {&lt;br /&gt;      /*&lt;br /&gt;       * FIXME&lt;br /&gt;       * We&#39;re assuming a 24MHz reference, but the DM355 also&lt;br /&gt;       * supports a 36MHz reference.&lt;br /&gt;       */&lt;br /&gt;      unsigned long postdiv;&lt;br /&gt;&lt;br /&gt;      /*&lt;br /&gt;       * Read the PLL1 POSTDIV register to determine if the post&lt;br /&gt;       * divider is /1 or /2&lt;br /&gt;       */&lt;br /&gt;      postdiv = (davinci_readl(DAVINCI_PLL_CNTRL0_BASE + 0x128) &amp;amp; 0x1f) + 1;&lt;br /&gt;&lt;br /&gt;      fixedrate = 24000000;&lt;br /&gt;      armrate = (PLL1_PLLM + 1)*(fixedrate/(16*postdiv));&lt;br /&gt;      commonrate = armrate/2;&lt;br /&gt;  } else {&lt;br /&gt;...&lt;br /&gt;  }&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### arch/arm/mach-davinci/serial.c ###&lt;br /&gt;&lt;br /&gt;void __init davinci_serial_init(struct platform_device *pdev)&lt;br /&gt;{&lt;br /&gt;  struct clk *uart_clk;&lt;br /&gt;  struct device *dev = &amp;amp;pdev-&gt;dev;&lt;br /&gt;  struct plat_serial8250_port *p;&lt;br /&gt;  int uart;&lt;br /&gt;  char uart_name[6];&lt;br /&gt;&lt;br /&gt;  memset(uart_name, 0, sizeof(uart_name));&lt;br /&gt;  for (p = dev-&gt;platform_data; p &amp;amp;&amp;amp; p-&gt;flags; p++) {&lt;br /&gt;      switch (p-&gt;mapbase) {&lt;br /&gt;          case DAVINCI_UART0_BASE:&lt;br /&gt;              uart = 0;&lt;br /&gt;              break;&lt;br /&gt;          case DAVINCI_UART1_BASE:&lt;br /&gt;              uart = 1;&lt;br /&gt;              break;&lt;br /&gt;          case DM644X_UART2_BASE:&lt;br /&gt;          case DM355_UART2_BASE:&lt;br /&gt;              uart = 2;&lt;br /&gt;              break;&lt;br /&gt;          default:&lt;br /&gt;              dev_err(dev,&lt;br /&gt;                  &quot;Unknown UART base address 0x%08lx\n&quot;,&lt;br /&gt;                  p-&gt;mapbase);&lt;br /&gt;              continue;&lt;br /&gt;      }&lt;br /&gt;      sprintf(uart_name, &quot;UART%i&quot;, uart);&lt;br /&gt;      uart_clk = clk_get(dev, uart_name);&lt;br /&gt;      if (IS_ERR(uart_clk))&lt;br /&gt;          dev_err(dev, &quot;failed to get %s clock\n&quot;, uart_name);&lt;br /&gt;      else&lt;br /&gt;          clk_enable(uart_clk);&lt;br /&gt;      davinci_serial_reset(p);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### arch/arm/mach-davinci/gpio.c ###&lt;br /&gt;&lt;br /&gt;int gpio_interrupt_bank_enable(int gpio)&lt;br /&gt;{&lt;br /&gt;  void *__iomem ptr1;&lt;br /&gt;  u32 temp = 0;&lt;br /&gt;  u32 mask = 0;&lt;br /&gt;  u32 gpio_bank;&lt;br /&gt;  u32 max_gpio = 0;&lt;br /&gt;&lt;br /&gt;  if (cpu_is_davinci_dm355())&lt;br /&gt;      max_gpio = DM355_NUM_GIOS;&lt;br /&gt;  else if (cpu_is_davinci_dm6443())&lt;br /&gt;      max_gpio = DM644x_NUM_GIOS;&lt;br /&gt;&lt;br /&gt;  if (gpio &gt;= max_gpio)&lt;br /&gt;      return -EINVAL;&lt;br /&gt;  gpio_bank = gpio/16;&lt;br /&gt;&lt;br /&gt;  ptr1 = (void *__iomem) IO_ADDRESS(DAVINCI_GPIO_BASE + 0x8);&lt;br /&gt;  mask = (1 &lt;&lt; temp =&quot; __raw_readl(ptr1);&quot; g =&quot; gpio2controller(gpio);&quot; mask =&quot; gpio_mask(gpio);&quot;&gt;set_rising);&lt;br /&gt;  if (trigger &amp;amp; TRIGGER_FALLING_EDGE)&lt;br /&gt;          __raw_writel(mask, &amp;amp;g-&gt;set_falling);&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;EXPORT_SYMBOL(gpio_interrupt_enable);&lt;br /&gt;&lt;br /&gt;int gpio_interrupt_disable(unsigned gpio, int trigger)&lt;br /&gt;{&lt;br /&gt;  struct gpio_controller  *__iomem g = gpio2controller(gpio);&lt;br /&gt;  u32 mask;&lt;br /&gt;  if (!g)&lt;br /&gt;      return -EINVAL;&lt;br /&gt;&lt;br /&gt;  if (trigger &amp;amp; ~(TRIGGER_RISING_EDGE|TRIGGER_FALLING_EDGE))&lt;br /&gt;      return -EINVAL;&lt;br /&gt;&lt;br /&gt;  mask = gpio_mask(gpio);&lt;br /&gt;&lt;br /&gt;  if (trigger &amp;amp; TRIGGER_RISING_EDGE)&lt;br /&gt;          __raw_writel(mask, &amp;amp;g-&gt;clr_rising);&lt;br /&gt;  if (trigger &amp;amp; TRIGGER_FALLING_EDGE)&lt;br /&gt;          __raw_writel(mask, &amp;amp;g-&gt;clr_falling);&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;EXPORT_SYMBOL(gpio_interrupt_disable);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### arch/arm/mach-davinci/psc.c ###&lt;br /&gt;&lt;br /&gt;void __init davinci_psc_init(void)&lt;br /&gt;{&lt;br /&gt;  // board_setup_psc() - in DM355&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;  davinci_psc_config(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_McBSP1, 1);&lt;br /&gt;  davinci_psc_config(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_SPI, 1);&lt;br /&gt;&lt;br /&gt;  /* Turn on WatchDog timer LPSC.     Needed for RESET to work */&lt;br /&gt;  davinci_psc_config(DAVINCI_GPSC_ARMDOMAIN, DAVINCI_LPSC_TIMER2, 1);&lt;br /&gt;&lt;br /&gt;  davinci_serial_init(&amp;amp;serial_device);&lt;br /&gt;  davinci_writel(0x56837210, DAVINCI_VPSS_REGS_BASE + 0x810);&lt;br /&gt;  davinci_writel(0x7b3c0004, DAVINCI_VPSS_REGS_BASE + 0x814);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### arch/arm/mach-davinci/board-evm.c ###&lt;br /&gt;&lt;br /&gt;MACHINE_START(DAVINCI_EVM, &quot;DaVinci DM355 EVM&quot;)&lt;br /&gt;  /* Maintainer: MontaVista Software &lt;source@mvista.com&gt; */&lt;br /&gt;  .phys_io      = IO_PHYS,&lt;br /&gt;  .io_pg_offst  = (io_p2v(IO_PHYS) &gt;&gt; 18) &amp;amp; 0xfffc,&lt;br /&gt;  .boot_params  = (DAVINCI_DDR_BASE + 0x100),&lt;br /&gt;  .map_io          = davinci_evm_map_io,&lt;br /&gt;  .init_irq     = davinci_evm_irq_init,&lt;br /&gt;  .timer          = &amp;amp;davinci_timer,&lt;br /&gt;  .init_machine = davinci_evm_init,&lt;br /&gt;MACHINE_END&lt;br /&gt;&lt;br /&gt;static __init void davinci_evm_init(void)&lt;br /&gt;{&lt;br /&gt;  davinci_psc_init();&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;  platform_add_devices(davinci_evm_devices,&lt;br /&gt;               ARRAY_SIZE(davinci_evm_devices));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;static void __init davinci_evm_map_io(void)&lt;br /&gt;{&lt;br /&gt;  davinci_map_common_io();&lt;br /&gt;&lt;br /&gt;// start - montavista - 2008/04/18&lt;br /&gt;#ifdef CONFIG_KGDB_8250&lt;br /&gt;      early_serial_setup((struct uart_port *)&amp;amp;serial_platform_data[kgdb8250_ttyS]);&lt;br /&gt;      kgdb8250_add_platform_port(kgdb8250_ttyS, &amp;amp;serial_platform_data[kgdb8250_ttyS]);&lt;br /&gt;#endif&lt;br /&gt;  /* Initialize the DaVinci EVM board settigs */&lt;br /&gt;  board_init ();&lt;br /&gt;// end - montavista - 2008/04/18&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### include/asm-arm/arch-davinci/ ###&lt;br /&gt;&lt;br /&gt;Add files as following:&lt;br /&gt;davinci_aew.h&lt;br /&gt;davinci_aew_hw.h&lt;br /&gt;davinci_af.h&lt;br /&gt;davinci_af_hw.h&lt;br /&gt;davinci_previewer.h&lt;br /&gt;davinci_previewer_hw.h&lt;br /&gt;davinci_pwm.h&lt;br /&gt;davinci_resizer.h&lt;br /&gt;davinci_resizer_hw.h&lt;br /&gt;dm355_aew.h&lt;br /&gt;dm355_aew_hw.h&lt;br /&gt;dm355_af.h&lt;br /&gt;dm355_af_hw.h&lt;br /&gt;dm355_ipipe.h&lt;br /&gt;dm355_ipipe_hw.h&lt;br /&gt;&lt;br /&gt;edma.h&lt;br /&gt;&lt;br /&gt;### include/asm-arm/arch-davinci/gpio.h ###&lt;br /&gt;&lt;br /&gt;extern int gpio_interrupt_bank_enable(int gpio);&lt;br /&gt;extern int gpio_interrupt_enable(unsigned gpio, int trigger);&lt;br /&gt;extern int gpio_interrupt_disable(unsigned gpio, int trigger);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### include/asm-arm/arch-davinci/io.h ###&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;difference&lt;br /&gt;                      android                dm355&lt;br /&gt;IO_PHYS            01c00000            01c00000&lt;br /&gt;IO_VIRT            fec00000            e1000000&lt;br /&gt;IO_SIZE            00400000            00400000&lt;br /&gt;IO_OFFSET    fd000000            df400000&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;#define IO_PHYS         0x01c00000&lt;br /&gt;#define IO_VIRT         0xe1000000&lt;br /&gt;#define IO_SIZE         0x00400000&lt;br /&gt;#define io_p2v(pa)   (((pa) &amp;amp; (IO_SIZE-1)) + IO_VIRT)&lt;br /&gt;#define io_v2p(va)   (((va) &amp;amp; (IO_SIZE-1)) + IO_PHYS)&lt;br /&gt;#define IO_ADDRESS(x) io_p2v(x)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### include/asm-arm/arch-davinci/dma.h ###&lt;br /&gt;&lt;br /&gt;#include &lt;asm arch=&quot;&quot; h=&quot;&quot;&gt;&lt;br /&gt;#include &lt;asm arch=&quot;&quot; h=&quot;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### include/asm-arm/arch-davinci/memory.h ###&lt;br /&gt;&lt;br /&gt;#define DAVINCI_IRAM_BASE   0x00008000 /* ARM Internal RAM(Data) */&lt;br /&gt;#define DAVINCI_IRAM_VIRT   0xe1400000 /* after 4M of IO space (io.h) */&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### include/asm-arm/arch-davinci/system.h ###&lt;br /&gt;&lt;br /&gt;static void arch_idle(void)&lt;br /&gt;{&lt;br /&gt;  if (!hlt_counter) {&lt;br /&gt;      unsigned long flags;&lt;br /&gt;      local_irq_save(flags);&lt;br /&gt;      if (!need_resched())&lt;br /&gt;          cpu_do_idle();&lt;br /&gt;      local_irq_restore(flags);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### include/asm-arm/arch-davinci/timex.h ###&lt;br /&gt;&lt;br /&gt;#ifdef CONFIG_ARCH_DAVINCI355&lt;br /&gt;#define CLOCK_TICK_RATE        24000000&lt;br /&gt;#else&lt;br /&gt;#define CLOCK_TICK_RATE            27000000&lt;br /&gt;#endif&lt;br /&gt;&lt;br /&gt;extern void davinci_watchdog_reset(void);&lt;br /&gt;extern cycles_t davinci_get_cycles(void);&lt;br /&gt;static inline cycles_t get_cycles(void)&lt;br /&gt;{&lt;br /&gt;  return davinci_get_cycles();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### include/asm-arm/arch-davinci/hardware.h ###&lt;br /&gt;&lt;br /&gt;#define DAVINCI_UART0_BASE                 (0x01C20000)&lt;br /&gt;#define DAVINCI_UART1_BASE                 (0x01C20400)&lt;br /&gt;&lt;br /&gt;#define DAVINCI_TIMER0_BASE                (0x01C21400)&lt;br /&gt;#define DAVINCI_TIMER1_BASE                (0x01C21800)&lt;br /&gt;#define DAVINCI_WDOG_BASE                  (0x01C21C00)&lt;br /&gt;&lt;br /&gt;#define DAVINCI_ARM_INTC_BASE              (0x01C48000)&lt;br /&gt;&lt;br /&gt;#define DM644X_ASYNC_EMIF_CNTRL_BASE        (0x01E00000)&lt;br /&gt;#define DM644X_UART2_BASE            (0x01C20800)&lt;br /&gt;&lt;br /&gt;#define DM355_MMC1_BASE                (0x01E00000)&lt;br /&gt;#define DM355_UART2_BASE            (0x01E06000)&lt;br /&gt;#define DM355_ASYNC_EMIF_CNTRL_BASE        (0x01E10000)&lt;br /&gt;#define DM355_MMC0_BASE                (0x01E11000)&lt;br /&gt;&lt;br /&gt;#define DAVINCI_MCBSP0_BASE                (0x01E02000)&lt;br /&gt;#define DAVINCI_MCBSP1_BASE                (0x01E04000)&lt;br /&gt;&lt;br /&gt;/* Power and Sleep Controller (PSC) Domains */&lt;br /&gt;#define DAVINCI_GPSC_ARMDOMAIN      0&lt;br /&gt;#define DAVINCI_GPSC_DSPDOMAIN      1&lt;br /&gt;&lt;br /&gt;#define DAVINCI_LPSC_VPSSMSTR       0       // VPSS Master LPSC&lt;br /&gt;#define DAVINCI_LPSC_VPSSSLV        1       // VPSS Slave LPSC&lt;br /&gt;#define DAVINCI_LPSC_TPCC           2       // TPCC LPSC&lt;br /&gt;#define DAVINCI_LPSC_TPTC0          3       // TPTC0 LPSC&lt;br /&gt;#define DAVINCI_LPSC_TPTC1          4       // TPTC1 LPSC&lt;br /&gt;#define DAVINCI_LPSC_EMAC           5       // EMAC LPSC&lt;br /&gt;#define DAVINCI_LPSC_EMAC_WRAPPER   6       // EMAC WRAPPER LPSC&lt;br /&gt;#define DAVINCI_LPSC_MDIO           7       // MDIO LPSC&lt;br /&gt;#define DAVINCI_LPSC_MMC_SD1        7       // MMC_SD1 LPSC&lt;br /&gt;#define DAVINCI_LPSC_IEEE1394       8       // IEEE1394 LPSC&lt;br /&gt;#define DAVINCI_LPSC_McBSP1         8       // McBSP1 LPSC&lt;br /&gt;#define DAVINCI_LPSC_USB            9       // USB LPSC&lt;br /&gt;#define DAVINCI_LPSC_ATA            10      // ATA LPSC&lt;br /&gt;#define DAVINCI_LPSC_PWM3           10      // PWM3 LPSC&lt;br /&gt;#define DAVINCI_LPSC_VLYNQ          11      // VLYNQ LPSC&lt;br /&gt;#define DAVINCI_LPSC_UHPI           12      // UHPI LPSC&lt;br /&gt;#define DAVINCI_LPSC_DDR_EMIF       13      // DDR_EMIF LPSC&lt;br /&gt;#define DAVINCI_LPSC_AEMIF          14      // AEMIF LPSC&lt;br /&gt;#define DAVINCI_LPSC_MMC_SD0        15      // MMC_SD0 LPSC&lt;br /&gt;#define DAVINCI_LPSC_MEMSTICK       16      // MEMSTICK LPSC&lt;br /&gt;#define DAVINCI_LPSC_McBSP0         17      // McBSP0 LPSC&lt;br /&gt;#define DAVINCI_LPSC_I2C            18      // I2C LPSC&lt;br /&gt;#define DAVINCI_LPSC_UART0          19      // UART0 LPSC&lt;br /&gt;#define DAVINCI_LPSC_UART1          20      // UART1 LPSC&lt;br /&gt;#define DAVINCI_LPSC_UART2          21      // UART2 LPSC&lt;br /&gt;#define DAVINCI_LPSC_SPI            22      // SPI LPSC&lt;br /&gt;#define DAVINCI_LPSC_PWM0           23      // PWM0 LPSC&lt;br /&gt;#define DAVINCI_LPSC_PWM1           24      // PWM1 LPSC&lt;br /&gt;#define DAVINCI_LPSC_PWM2           25      // PWM2 LPSC&lt;br /&gt;#define DAVINCI_LPSC_GPIO           26      // GPIO LPSC&lt;br /&gt;#define DAVINCI_LPSC_TIMER0         27      // TIMER0 LPSC&lt;br /&gt;#define DAVINCI_LPSC_TIMER1         28      // TIMER1 LPSC&lt;br /&gt;#define DAVINCI_LPSC_TIMER2         29      // TIMER2 LPSC&lt;br /&gt;#define DAVINCI_LPSC_SYSTEM_SUBSYS  30      // SYSTEM SUBSYSTEM LPSC&lt;br /&gt;#define DAVINCI_LPSC_ARM            31      // ARM LPSC&lt;br /&gt;#define DAVINCI_LPSC_SCR2           32      // SCR2 LPSC&lt;br /&gt;#define DAVINCI_LPSC_SCR3           33      // SCR3 LPSC&lt;br /&gt;#define DAVINCI_LPSC_SCR4           34      // SCR4 LPSC&lt;br /&gt;#define DAVINCI_LPSC_CROSSBAR       35      // CROSSBAR LPSC&lt;br /&gt;#define DAVINCI_LPSC_CFG27          36      // CFG27 LPSC&lt;br /&gt;#define DAVINCI_LPSC_CFG3           37      // CFG3 LPSC&lt;br /&gt;#define DAVINCI_LPSC_CFG5           38      // CFG5 LPSC&lt;br /&gt;#define DAVINCI_LPSC_GEM            39      // GEM LPSC&lt;br /&gt;#define DAVINCI_LPSC_IMCOP          40      // IMCOP LPSC&lt;br /&gt;&lt;br /&gt;/* NOR Flash base address set to CS0 by default */&lt;br /&gt;#define DAVINCI_CS0_PHYS    0x02000000&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### include/asm-arm/arch-davinci/cpu.h ###&lt;br /&gt;&lt;br /&gt;#ifndef _ASM_ARCH_CPU_H&lt;br /&gt;#define _ASM_ARCH_CPU_H&lt;br /&gt;&lt;br /&gt;extern unsigned int system_rev;&lt;br /&gt;&lt;br /&gt;#define GET_DAVINCI_CPU_TYPE    ((system_rev &gt;&gt; 16) &amp;amp; 0xffff)&lt;br /&gt;&lt;br /&gt;#define IS_DAVINCI_CPU(type, id)            \&lt;br /&gt;static inline int cpu_is_davinci_dm ##type (void)        \&lt;br /&gt;{                            \&lt;br /&gt;      return (GET_DAVINCI_CPU_TYPE == (id)) ? 1 : 0;    \&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/* following generates the cpu_is_davinci_dmxxx */&lt;br /&gt;IS_DAVINCI_CPU(6443, 0x6443)    /* cpu_is_davinci_dm6443() */&lt;br /&gt;IS_DAVINCI_CPU(6467, 0x6467)    /* cpu_is_davinci_dm6467() */&lt;br /&gt;/*IS_DAVINCI_CPU(355, 0x350)*/    /* cpu_is_davinci_dm355() */&lt;br /&gt;IS_DAVINCI_CPU(355, 0x355)    /* cpu_is_davinci_dm355() */&lt;br /&gt;&lt;br /&gt;#endif&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### include/asm-arm/arch-davinci/uncompress.h ###&lt;br /&gt;&lt;br /&gt;#ifdef    CONFIG_DAVINCI_LL_DEBUG_UART1&lt;br /&gt;#define DAVINCI_UART_BASE DAVINCI_UART1_BASE&lt;br /&gt;#else&lt;br /&gt;#define DAVINCI_UART_BASE DAVINCI_UART0_BASE&lt;br /&gt;#endif&lt;br /&gt;&lt;br /&gt;typedef struct uart_registers_t {&lt;br /&gt;  unsigned int rbr_thr;&lt;br /&gt;  unsigned int ier;&lt;br /&gt;  unsigned int iir_fcr;&lt;br /&gt;  unsigned int lcr;&lt;br /&gt;  unsigned int mcr;&lt;br /&gt;  unsigned int lsr;&lt;br /&gt;  unsigned int msr;&lt;br /&gt;  unsigned int scr;&lt;br /&gt;  unsigned int dll;&lt;br /&gt;  unsigned int dlh;&lt;br /&gt;  unsigned int pid1;&lt;br /&gt;  unsigned int pid2;&lt;br /&gt;  unsigned int pwremu;&lt;br /&gt;} uart_registers;&lt;br /&gt;&lt;br /&gt;/* Initialize Serial port */&lt;br /&gt;static void do_nothing(void)&lt;br /&gt;{&lt;br /&gt;  unsigned int counter;&lt;br /&gt;  for (counter = 0; counter &lt; uartregs =&quot; (volatile&quot;&gt;lsr &amp;amp; 0x20) {&lt;br /&gt;      /* Do Nothing */&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;static void serial_putc(const char c)&lt;br /&gt;{&lt;br /&gt;  volatile uart_registers *uartregs;&lt;br /&gt;&lt;br /&gt;  uartregs = (volatile uart_registers *) DAVINCI_UART_BASE;&lt;br /&gt;  if (c == &#39;\n&#39;)&lt;br /&gt;      serial_putc(&#39;\r&#39;);&lt;br /&gt;  uartregs-&gt;rbr_thr = c;&lt;br /&gt;&lt;br /&gt;  serial_waitfortxcharcomplete();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/* Send string on UART */&lt;br /&gt;static void putstr(const char *str)&lt;br /&gt;{&lt;br /&gt;  volatile uart_registers *uartregs;&lt;br /&gt;&lt;br /&gt;  uartregs = (volatile uart_registers *) DAVINCI_UART_BASE;&lt;br /&gt;  while (*str != &#39;\0&#39;) {&lt;br /&gt;      serial_putc(*str);&lt;br /&gt;      str++;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### include/asm-arm/mach/arch.h ###&lt;br /&gt;&lt;br /&gt;struct machine_desc {&lt;br /&gt;  /*&lt;br /&gt;   * Note! The first four elements are used&lt;br /&gt;   * by assembler code in head-armv.S&lt;br /&gt;   */&lt;br /&gt;  unsigned int        nr;        /* architecture number    */&lt;br /&gt;  unsigned int        phys_io;    /* start of physical io    */&lt;br /&gt;  unsigned int        io_pg_offst;    /* byte offset for io&lt;br /&gt;                       * page tabe entry    */&lt;br /&gt;&lt;br /&gt;  const char        *name;        /* architecture name    */&lt;br /&gt;  unsigned long        boot_params;    /* tagged list        */&lt;br /&gt;&lt;br /&gt;  unsigned int        video_start;    /* start of video RAM    */&lt;br /&gt;  unsigned int        video_end;    /* end of video RAM    */&lt;br /&gt;&lt;br /&gt;  unsigned int        reserve_lp0 :1;    /* never has lp0    */&lt;br /&gt;  unsigned int        reserve_lp1 :1;    /* never has lp1    */&lt;br /&gt;  unsigned int        reserve_lp2 :1;    /* never has lp2    */&lt;br /&gt;  unsigned int        soft_reboot :1;    /* soft reboot        */&lt;br /&gt;  void            (*fixup)(struct machine_desc *,&lt;br /&gt;                   struct tag *, char **,&lt;br /&gt;                   struct meminfo *);&lt;br /&gt;  void            (*map_io)(void);/* IO mapping function    */&lt;br /&gt;  void            (*init_irq)(void);&lt;br /&gt;  struct sys_timer    *timer;        /* system tick timer    */&lt;br /&gt;  void            (*init_machine)(void);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;#define MACHINE_START(_type,_name)            \&lt;br /&gt;static const struct machine_desc __mach_desc_##_type    \&lt;br /&gt;__used                            \&lt;br /&gt;__attribute__((__section__(&quot;.arch.info.init&quot;))) = {    \&lt;br /&gt;  .nr        = MACH_TYPE_##_type,        \&lt;br /&gt;  .name        = _name,&lt;br /&gt;&lt;br /&gt;#define MACHINE_END                \&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;static const struct machine_desc __mach_desc_DAVINCI_DM355_EVM&lt;br /&gt;  .nr        = MACH_TYPE_DAVINCI_DM355_EVM,        \&lt;br /&gt;  .name    = &quot;DaVinci DM355 EVM&quot;,&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;__attribute__((__section__(&quot;.arch.info.init&quot;)))&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### include/asm-arm/setup.h ###&lt;br /&gt;&lt;br /&gt;#define ATAG_OMAP       0x414f4d50&lt;br /&gt;&lt;br /&gt;struct tag_omap {&lt;br /&gt;  u8 data[0];&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;### include/asm-arm/procinfo.h ###&lt;br /&gt;&lt;br /&gt;#define PROC_INFO_SZ    48&lt;br /&gt;&lt;br /&gt;#define HWCAP_SWP    1&lt;br /&gt;#define HWCAP_HALF    2&lt;br /&gt;#define HWCAP_THUMB    4&lt;br /&gt;#define HWCAP_26BIT    8    /* Play it safe */&lt;br /&gt;#define HWCAP_FAST_MULT    16&lt;br /&gt;#define HWCAP_FPA    32&lt;br /&gt;#define HWCAP_VFP    64&lt;br /&gt;#define HWCAP_EDSP    128&lt;br /&gt;#define HWCAP_JAVA    256&lt;/asm&gt;&lt;/asm&gt;&lt;/source@mvista.com&gt;&lt;/asm&gt;</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/5271253665958368855/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/5271253665958368855' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/5271253665958368855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/5271253665958368855'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2008/11/unfinished-task-proting-android-linux.html' title='Unfinished task - porting android linux-2.6.23 to TI Davinci DM355'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-958117821711856181</id><published>2008-10-30T22:56:00.000+08:00</published><updated>2015-04-23T16:10:54.065+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="arm"/><category scheme="http://www.blogger.com/atom/ns#" term="cross-compile"/><category scheme="http://www.blogger.com/atom/ns#" term="embedded"/><category scheme="http://www.blogger.com/atom/ns#" term="gcc"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="uclibc"/><title type='text'>Build Cross-Compiled gcc for ARM by myself</title><content type='html'>This work is done by studying &lt;a href=&quot;http://cross-lfs.org/view/clfs-embedded/arm/&quot;&gt;Cross-Compiled Linux From Scratch - Embedded&lt;/a&gt; (Version SVN-0.0.1-20080109-arm) material, The steps of building cross compiled gcc for ARM:&lt;br /&gt;
&lt;br /&gt;
[Adding the ARMDEV User]&lt;br /&gt;
&lt;br /&gt;
$ su -&lt;br /&gt;
# groupadd armdev&lt;br /&gt;
# useradd -s /bin/bash -g armdev -m -k /dev/null armdev&lt;br /&gt;
# useradd -s /bin/bash -g wizign -m armdev&lt;br /&gt;
# passwd armdev&lt;br /&gt;
# chown -Rv armdev ${ARMDEV}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[Preparing a New Partition]&lt;br /&gt;
&lt;br /&gt;
# export ARMDEV=&#39;/mnt/armdev&#39;&lt;br /&gt;
# install -dv ${ARMDEV}&lt;br /&gt;
# mkdir /vdisk/arm_disk&lt;br /&gt;
# mkdir -pv ${ARMDEV}&lt;br /&gt;
# mount --bind /vdisk/arm_disk ${ARMDEV}&lt;br /&gt;
&lt;br /&gt;
[Create source directory]&lt;br /&gt;
# mkdir -v ${ARMDEV}/sources&lt;br /&gt;
# chmod -v a+wt ${ARMDEV}/sources&lt;br /&gt;
&lt;br /&gt;
[Check and download packages]&lt;br /&gt;
&lt;br /&gt;
$ su - armdev&lt;br /&gt;
&lt;br /&gt;
[]Binutils (2.18)&lt;br /&gt;
$ wget http://ftp.gnu.org/gnu/binutils/binutils-2.18.tar.bz2&lt;br /&gt;
&lt;br /&gt;
[]Busybox (1.4.1)&lt;br /&gt;
$ wget http://busybox.net/downloads/busybox-1.4.1.tar.bz2&lt;br /&gt;
&lt;br /&gt;
[]CLFS-Bootscripts (1.0-pre4)&lt;br /&gt;
$ wget http://cross-lfs.org/files/packages/embedded-0.0.1/clfs-embedded-bootscripts-1.0-pre4.tar.bz2&lt;br /&gt;
&lt;br /&gt;
[]E2fsprogs (1.39)&lt;br /&gt;
$ wget http://prdownloads.sourceforge.net/e2fsprogs/e2fsprogs-1.39.tar.gz&lt;br /&gt;
&lt;br /&gt;
[]GCC (4.1.2)&lt;br /&gt;
$ wget http://ftp.gnu.org/gnu/gcc/gcc-4.1.2/gcc-4.1.2.tar.bz2&lt;br /&gt;
&lt;br /&gt;
[]Iana-Etc (2.20)&lt;br /&gt;
$ wget http://www.sethwklein.net/projects/iana-etc/downloads/iana-etc-2.20.tar.bz2&lt;br /&gt;
&lt;br /&gt;
[]Linux (2.6.20.1)&lt;br /&gt;
$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.20.1.tar.bz2&lt;br /&gt;
&lt;br /&gt;
[]Linux-Headers (2.6.20.1-02252007)&lt;br /&gt;
$ wget http://cross-lfs.org/files/packages/embedded-0.0.1/linux-headers-2.6.20.1-02252007.tar.bz2&lt;br /&gt;
&lt;br /&gt;
[]uClibc (0.9.29)&lt;br /&gt;
$ wget http://www.uclibc.org/downloads/uClibc-0.9.29.tar.bz2&lt;br /&gt;
&lt;br /&gt;
[]Zlib (1.2.3)&lt;br /&gt;
$ wget http://www.zlib.net/zlib-1.2.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
[Check and download patched]&lt;br /&gt;
&lt;br /&gt;
[]Binutils Posix Patch&lt;br /&gt;
$ wget http://svn.cross-lfs.org/svn/repos/cross-lfs/branches/clfs-sysroot/patches/binutils-2.18-posix-1.patch&lt;br /&gt;
&lt;br /&gt;
[]Binutils Posix Patch&lt;br /&gt;
$ wget http://svn.cross-lfs.org/svn/repos/cross-lfs/branches/clfs-embedded/patches/binutils-2.17-posix-1.patch&lt;br /&gt;
&lt;br /&gt;
[]Binutils uClibc Patch&lt;br /&gt;
$ wget http://svn.cross-lfs.org/svn/repos/cross-lfs/branches/clfs-embedded/patches/binutils-2.17-uclibc-1.patch&lt;br /&gt;
&lt;br /&gt;
[]Busybox Fixes Patch&lt;br /&gt;
$ wget http://svn.cross-lfs.org/svn/repos/cross-lfs/branches/clfs-embedded/patches/busybox-1.8.2-fixes-1.patch&lt;br /&gt;
&lt;br /&gt;
[]GCC Cross Search Paths Patch&lt;br /&gt;
$ wget http://svn.cross-lfs.org/svn/repos/cross-lfs/branches/clfs-embedded/patches/gcc-4.1.2-cross_search_paths-1.patch&lt;br /&gt;
&lt;br /&gt;
[]GCC Posix Patch&lt;br /&gt;
$ wget http://svn.cross-lfs.org/svn/repos/cross-lfs/branches/clfs-embedded/patches/gcc-4.1.2-posix-1.patch&lt;br /&gt;
&lt;br /&gt;
[]GCC uClibc Patch&lt;br /&gt;
$ wget http://svn.cross-lfs.org/svn/repos/cross-lfs/branches/clfs-embedded/patches/gcc-4.1.2-uclibc-1.patch&lt;br /&gt;
&lt;br /&gt;
[]Zlib DESTDIR Patch&lt;br /&gt;
$ wget http://svn.cross-lfs.org/svn/repos/cross-lfs/branches/clfs-embedded/patches/zlib-1.2.3-DESTDIR-1.patch&lt;br /&gt;
&lt;br /&gt;
[Final Preparations]&lt;br /&gt;
&lt;br /&gt;
[]Setting up the environment&lt;br /&gt;
&lt;br /&gt;
$ cat &amp;gt; ~/.bash_profile &amp;lt;&amp;lt; &quot;EOF&quot;&lt;br /&gt;
&amp;gt; exec env -i HOME=${HOME} TERM=${TERM} PS1=&#39;\u:\w\$ &#39; /bin/bash&lt;br /&gt;
&amp;gt; EOF&lt;br /&gt;
&lt;br /&gt;
$ cat &amp;gt; ~/.bashrc &amp;lt;&amp;lt; &quot;EOF&quot;&lt;br /&gt;
&amp;gt; set +h&lt;br /&gt;
&amp;gt; umask 022&lt;br /&gt;
&amp;gt; ARMDEV=/mnt/armdev&lt;br /&gt;
&amp;gt; LC_ALL=POSIX&lt;br /&gt;
&amp;gt; PATH=${ARMDEV}/cross-tools/bin:/bin:/usr/bin&lt;br /&gt;
&amp;gt; export ARMDEV LC_ALL PATH&lt;br /&gt;
&amp;gt; EOF&lt;br /&gt;
&lt;br /&gt;
$ source ~/.bash_profile&lt;br /&gt;
&lt;br /&gt;
[]Creating directories&lt;br /&gt;
&lt;br /&gt;
$ mkdir -pv ${ARMDEV}/build&lt;br /&gt;
$ mkdir -pv ${ARMDEV}/{bin,boot,dev,{etc/,}opt,home,lib/{firmware,modules},mnt}&lt;br /&gt;
$ mkdir -pv ${ARMDEV}/{proc,media/{floppy,cdrom},sbin,srv,sys}&lt;br /&gt;
$ mkdir -pv ${ARMDEV}/var/{lock,log,mail,run,spool}&lt;br /&gt;
$ mkdir -pv ${ARMDEV}/var/{opt,cache,lib/{misc,locate},local}&lt;br /&gt;
$ install -dv -m 0750 ${ARMDEV}/root&lt;br /&gt;
$ install -dv -m 1777 ${ARMDEV}{/var,}/tmp&lt;br /&gt;
$ mkdir -pv ${ARMDEV}/usr/{,local/}{bin,include,lib,sbin,src}&lt;br /&gt;
$ mkdir -pv ${ARMDEV}/usr/{,local/}share/{doc,info,locale,man}&lt;br /&gt;
$ mkdir -pv ${ARMDEV}/usr/{,local/}share/{misc,terminfo,zoneinfo}&lt;br /&gt;
$ mkdir -pv ${ARMDEV}/usr/{,local/}share/man/man{1,2,3,4,5,6,7,8}&lt;br /&gt;
$ mkdir -pv ${ARMDEV}/cross-tools{,/bin}&lt;br /&gt;
$ for dir in ${ARMDEV}/usr{,/local}; do&lt;br /&gt;
&amp;gt; ln -sv share/{man,doc,info} ${dir}&lt;br /&gt;
&amp;gt; done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[]Creating the passwd, group, and log Files&lt;br /&gt;
&lt;br /&gt;
$ ln -svf ../proc/mounts ${ARMDEV}/etc/mtab&lt;br /&gt;
&lt;br /&gt;
$ cat &amp;gt; ${ARMDEV}/etc/passwd &amp;lt;&amp;lt; &quot;EOF&quot;&lt;br /&gt;
&amp;gt; root::0:0:root:/root:/bin/ash&lt;br /&gt;
&amp;gt; bin:x:1:1:bin:/bin:/bin/false&lt;br /&gt;
&amp;gt; daemon:x:2:6:daemon:/sbin:/bin/false&lt;br /&gt;
&amp;gt; adm:x:3:16:adm:/var/adm:/bin/false&lt;br /&gt;
&amp;gt; lp:x:10:9:lp:/var/spool/lp:/bin/false&lt;br /&gt;
&amp;gt; mail:x:30:30:mail:/var/mail:/bin/false&lt;br /&gt;
&amp;gt; news:x:31:31:news:/var/spool/news:/bin/false&lt;br /&gt;
&amp;gt; uucp:x:32:32:uucp:/var/spool/uucp:/bin/false&lt;br /&gt;
&amp;gt; operator:x:50:0:operator:/root:/bin/ash&lt;br /&gt;
&amp;gt; postmaster:x:51:30:postmaster:/var/spool/mail:/bin/false&lt;br /&gt;
&amp;gt; nobody:x:65534:65534:nobody:/:/bin/false&lt;br /&gt;
&amp;gt; EOF&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ cat &amp;gt; ${ARMDEV}/etc/group &amp;lt;&amp;lt; &quot;EOF&quot;&lt;br /&gt;
&amp;gt; root:x:0:&lt;br /&gt;
&amp;gt; bin:x:1:&lt;br /&gt;
&amp;gt; sys:x:2:&lt;br /&gt;
&amp;gt; kmem:x:3:&lt;br /&gt;
&amp;gt; tty:x:4:&lt;br /&gt;
&amp;gt; tape:x:5:&lt;br /&gt;
&amp;gt; daemon:x:6:&lt;br /&gt;
&amp;gt; floppy:x:7:&lt;br /&gt;
&amp;gt; disk:x:8:&lt;br /&gt;
&amp;gt; lp:x:9:&lt;br /&gt;
&amp;gt; dialout:x:10:&lt;br /&gt;
&amp;gt; audio:x:11:&lt;br /&gt;
&amp;gt; video:x:12:&lt;br /&gt;
&amp;gt; utmp:x:13:&lt;br /&gt;
&amp;gt; usb:x:14:&lt;br /&gt;
&amp;gt; cdrom:x:15:&lt;br /&gt;
&amp;gt; adm:x:16:root,adm,daemon&lt;br /&gt;
&amp;gt; console:x:17:&lt;br /&gt;
&amp;gt; cdrw:x:18:&lt;br /&gt;
&amp;gt; mail:x:30:mail&lt;br /&gt;
&amp;gt; news:x:31:news&lt;br /&gt;
&amp;gt; uucp:x:32:uucp&lt;br /&gt;
&amp;gt; users:x:100:&lt;br /&gt;
&amp;gt; nogroup:x:65533:&lt;br /&gt;
&amp;gt; nobody:x:65534:&lt;br /&gt;
&amp;gt; EOF&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ touch ${ARMDEV}/var/run/utmp ${ARMDEV}/var/log/{btmp,lastlog,wtmp}&lt;br /&gt;
$ chmod -v 664 ${ARMDEV}/var/run/utmp ${ARMDEV}/var/log/lastlog&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[Constructing Cross-Compile Tools]&lt;br /&gt;
&lt;br /&gt;
[]Build CFLAGS&lt;br /&gt;
$ echo &quot;Build CFLAGS&quot;&lt;br /&gt;
$ echo unset CFLAGS &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
$ echo unset CXXFLAGS &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
# Application Binary Interface (ABI) for the ARM Architecture&lt;br /&gt;
# ABI Variables&lt;br /&gt;
# Table 6.1. List of Build Variables&lt;br /&gt;
# ABI                BUILD=Value&lt;br /&gt;
# -------------------------    --------------------------------&lt;br /&gt;
# 32-Bit MIPS        -mabi=32&lt;br /&gt;
# 32-Bit All Others    -m32&lt;br /&gt;
# N32 MIPS        -mabi=n32&lt;br /&gt;
# 64-Bit MIPS        -mabi=64&lt;br /&gt;
# 64-Bit All Others    -m64&lt;br /&gt;
echo &quot;ABI Variables&quot;&lt;br /&gt;
export BUILD=&quot;-m32&quot;&lt;br /&gt;
&lt;br /&gt;
# Build Variables&lt;br /&gt;
# Table 6.2. Processor Type and Target Triplets&lt;br /&gt;
# Processor    Target Triplet&lt;br /&gt;
# ----------------------------------------------    -----------------------------------------&lt;br /&gt;
# Generic arm, little endian            arm-unknown-linux-uclibc&lt;br /&gt;
# Generic arm, version 5, little endian    armv5l-unknown-linux-uclibc&lt;br /&gt;
# Generic arm, version 5, big endian    armv5b-unknown-linux-uclibc&lt;br /&gt;
&lt;br /&gt;
$ export ARM_HOST=&quot;$(echo $MACHTYPE | sed &quot;s/$(echo $MACHTYPE | cut -d- -f2)/cross/&quot;)&quot;&lt;br /&gt;
# Generic arm, little endian&lt;br /&gt;
$ export ARM_TARGET=&quot;arm-unknown-linux-uclibc&quot;&lt;br /&gt;
$ echo export ARM_HOST=\&quot;&quot;${ARM_HOST}\&quot;&quot; &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
$ echo export ARM_TARGET=\&quot;&quot;${ARM_TARGET}\&quot;&quot; &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
[]Linux-Headers-2.6.20.1-02252007&lt;br /&gt;
&lt;br /&gt;
$ mkdir ${ARMDEV}/build&lt;br /&gt;
$ cd ${ARMDEV}/build&lt;br /&gt;
$ tar -jxvf ${ARMDEV}/sources/linux-headers-2.6.20.1-02252007.tar.bz2&lt;br /&gt;
$ install -dv ${ARMDEV}/usr/include&lt;br /&gt;
$ cp -av ${ARMDEV}/build/linux-headers-2.6.20.1/include/{asm-generic,linux,mtd,scsi,sound} ${ARMDEV}/usr/include&lt;br /&gt;
$ cp -av ${ARMDEV}/build/linux-headers-2.6.20.1/include/asm-arm ${ARMDEV}/usr/include/asm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[]Cross Binutils-2.17&lt;br /&gt;
&lt;br /&gt;
$ cd ${ARMDEV}/build&lt;br /&gt;
$ tar -jxvf ${ARMDEV}/sources/binutils-2.17.tar.bz2&lt;br /&gt;
$ cd binutils-2.17&lt;br /&gt;
$ patch -Np1 -i ${ARMDEV}/sources/binutils-2.17-posix-1.patch&lt;br /&gt;
$ patch -Np1 -i ${ARMDEV}/sources/binutils-2.17-uclibc-1.patch&lt;br /&gt;
$ mkdir -v ../binutils-build&lt;br /&gt;
$ cd ../binutils-build&lt;br /&gt;
$ ../binutils-2.17/configure --prefix=${ARMDEV}/cross-tools --host=${ARM_HOST} --target=${ARM_TARGET} --with-sysroot=${ARMDEV} --disable-nls --enable-shared --disable-multilib&lt;br /&gt;
$ make configure-host&lt;br /&gt;
$ make&lt;br /&gt;
$ make install&lt;br /&gt;
$ cp -v ../binutils-2.17/include/libiberty.h ${ARMDEV}/usr/include&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[]uClibc-0.9.29&lt;br /&gt;
&lt;br /&gt;
$ cd ${ARMDEV}/build&lt;br /&gt;
$ tar -jxvf ${ARMDEV}/sources/uClibc-0.9.29.tar.bz2&lt;br /&gt;
$ cd uClibc-0.9.29&lt;br /&gt;
&lt;br /&gt;
$ cp extra/Configs/Config.arm extra/Configs/Config.arm.orig&lt;br /&gt;
$ sed -e &quot;/default/s:OABI:EABI:&quot; extra/Configs/Config.arm.orig &amp;gt; extra/Configs/Config.arm&lt;br /&gt;
$ cp Makefile{,.orig}&lt;br /&gt;
$ sed -e &#39;s/$(LN) -fs/cp/g&#39; Makefile.orig &amp;gt; Makefile&lt;br /&gt;
$ for file in `find libc/sysdeps/linux -name Makefile`; do&lt;br /&gt;
&amp;gt; cp $file{,.orig}&lt;br /&gt;
&amp;gt; sed -e &#39;s/$(LN) -fs/cp/g&#39; -e &#39;s@../libc/@$(TOPDIR)libc/@g&#39; $file.orig &amp;gt; $file&lt;br /&gt;
&amp;gt; done&lt;br /&gt;
&lt;br /&gt;
$ make defconfig ARCH=arm&lt;br /&gt;
$ cp .config{,.orig}&lt;br /&gt;
$ sed -e &quot;/^CROSS_COMPILER_PREFIX/s:=.*:=\&quot;${ARM_TARGET}-\&quot;:&quot; -e &quot;/^KERNEL_HEADERS/s:=.*:=\&quot;${ARMDEV}/usr/include\&quot;:&quot; -e &quot;/^SHARED_LIB_LOADER_PREFIX/s:=.*:=\&quot;/lib\&quot;:&quot; -e &quot;/^DEVEL_PREFIX/s:=.*:=\&quot;/usr\&quot;:&quot; -e &quot;/^RUNTIME_PREFIX/s:=.*:=\&quot;/\&quot;:&quot; .config.orig &amp;gt; .config&lt;br /&gt;
&lt;br /&gt;
$ UCLIBC_OPTIONS=&quot;DO_C99_MATH UCLIBC_HAS_RPC UCLIBC_HAS_CTYPE_CHECKED UCLIBC_HAS_WCHAR UCLIBC_HAS_HEXADECIMAL_FLOATS LDSO_PRELOAD_FILE_SUPPORT UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE UCLIBC_HAS_PRINTF_M_SPEC UCLIBC_HAS_IPV6 UCLIBC_HAS_GLIBC_CUSTOM_PRINTF UCLIBC_USE_NETLINK UCLIBC_HAS_FTW&quot;&lt;br /&gt;
$ for config in $UCLIBC_OPTIONS; do&lt;br /&gt;
&amp;gt; cp .config{,.orig}&lt;br /&gt;
&amp;gt; sed -e &quot;s:# ${config} is not set:${config}=y:&quot; .config.orig &amp;gt; .config&lt;br /&gt;
&amp;gt; done&lt;br /&gt;
$ UCLIBC_OPTIONS=&quot;UCLIBC_HAS_CTYPE_UNSAFE&quot;&lt;br /&gt;
$ for config in $UCLIBC_OPTIONS; do&lt;br /&gt;
&amp;gt; cp .config{,.orig}&lt;br /&gt;
&amp;gt; sed -e &quot;s:${config}=y:# ${config} is not set:&quot; .config.orig &amp;gt; .config&lt;br /&gt;
&amp;gt; done&lt;br /&gt;
$ echo &quot;UCLIBC_HAS_FULL_RPC=y&quot; &amp;gt;&amp;gt; .config&lt;br /&gt;
$ echo &quot;UCLIBC_HAS_REENTRANT_RPC=y&quot; &amp;gt;&amp;gt; .config&lt;br /&gt;
&lt;br /&gt;
# If your ARM system is Big Endian, you will need at add the following lines to your configuration:&lt;br /&gt;
&lt;br /&gt;
$ echo &quot;ARCH_ANY_ENDIAN=y&quot; &amp;gt;&amp;gt; .config&lt;br /&gt;
$ echo &quot;ARCH_BIG_ENDIAN=y&quot; &amp;gt;&amp;gt; .config&lt;br /&gt;
$ echo &quot;ARCH_WANTS_BIG_ENDIAN=y&quot; &amp;gt;&amp;gt; .config&lt;br /&gt;
&lt;br /&gt;
# If your ARM system is Little Endian, you will need at add the following lines to your configuration:&lt;br /&gt;
&lt;br /&gt;
$ echo &quot;ARCH_ANY_ENDIAN=y&quot; &amp;gt;&amp;gt; .config&lt;br /&gt;
$ echo &quot;ARCH_LITTLE_ENDIAN=y&quot; &amp;gt;&amp;gt; .config&lt;br /&gt;
$ echo &quot;ARCH_WANTS_LITTLE_ENDIAN=y&quot; &amp;gt;&amp;gt; .config&lt;br /&gt;
&lt;br /&gt;
$ make oldconfig&lt;br /&gt;
$ make headers&lt;br /&gt;
$ mkdir ${ARMDEV}/usr/include/bits&lt;br /&gt;
$ make PREFIX=${ARMDEV} install_headers&lt;br /&gt;
&lt;br /&gt;
[]Cross GCC-4.1.2 - Static&lt;br /&gt;
&lt;br /&gt;
$ cd ${ARMDEV}/build&lt;br /&gt;
$ tar -jxvf ${ARMDEV}/sources/gcc-4.1.2.tar.bz2&lt;br /&gt;
$ cd gcc-4.1.2&lt;br /&gt;
$ patch -Np1 -i ${ARMDEV}/sources/gcc-4.1.2-posix-1.patch&lt;br /&gt;
$ patch -Np1 -i ${ARMDEV}/sources/gcc-4.1.2-uclibc-1.patch&lt;br /&gt;
$ patch -Np1 -i ${ARMDEV}/sources/gcc-4.1.2-cross_search_paths-1.patch&lt;br /&gt;
$ mkdir -v ../gcc-build&lt;br /&gt;
$ cd ../gcc-build&lt;br /&gt;
$ ../gcc-4.1.2/configure --prefix=${ARMDEV}/cross-tools --host=${ARM_HOST} --target=${ARM_TARGET} --disable-multilib --with-sysroot=${ARMDEV} --without-headers --disable-nls --disable-shared --disable-threads --enable-languages=c&lt;br /&gt;
$ make all-gcc&lt;br /&gt;
$ make install-gcc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[]ToolChain Variables&lt;br /&gt;
&lt;br /&gt;
$ export CC=&quot;${ARM_TARGET}-gcc&quot;&lt;br /&gt;
$ export CXX=&quot;${ARM_TARGET}-g++&quot;&lt;br /&gt;
$ export AR=&quot;${ARM_TARGET}-ar&quot;&lt;br /&gt;
$ export AS=&quot;${ARM_TARGET}-as&quot;&lt;br /&gt;
$ export LD=&quot;${ARM_TARGET}-ld&quot;&lt;br /&gt;
$ export RANLIB=&quot;${ARM_TARGET}-ranlib&quot;&lt;br /&gt;
$ export STRIP=&quot;${ARM_TARGET}-strip&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[]uClibc-0.9.29&lt;br /&gt;
&lt;br /&gt;
$ cd ${ARMDEV}/build&lt;br /&gt;
$ cd uClibc-0.9.29&lt;br /&gt;
&lt;br /&gt;
$ make CC=&quot;${CC}&quot;&lt;br /&gt;
$ make PREFIX=${ARMDEV} install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[]Clear ToolChain Variables&lt;br /&gt;
&lt;br /&gt;
$ unset CC&lt;br /&gt;
$ unset CXX&lt;br /&gt;
$ unset AR&lt;br /&gt;
$ unset AS&lt;br /&gt;
$ unset LD&lt;br /&gt;
$ unset RANLIB&lt;br /&gt;
$ unset STRIP&lt;br /&gt;
&lt;br /&gt;
[]GCC-4.1.2 - Cross Compiler Final&lt;br /&gt;
&lt;br /&gt;
$ cd ${ARMDEV}/build&lt;br /&gt;
$ rm -fr gcc-4.1.2&lt;br /&gt;
$ tar -jxvf ${ARMDEV}/sources/gcc-4.1.2.tar.bz2&lt;br /&gt;
$ cd gcc-4.1.2&lt;br /&gt;
$ patch -Np1 -i ${ARMDEV}/sources/gcc-4.1.2-posix-1.patch&lt;br /&gt;
$ patch -Np1 -i ${ARMDEV}/sources/gcc-4.1.2-uclibc-1.patch&lt;br /&gt;
$ patch -Np1 -i ${ARMDEV}/sources/gcc-4.1.2-cross_search_paths-1.patch&lt;br /&gt;
$ rm -fr ../gcc-build&lt;br /&gt;
$ mkdir -v ../gcc-build&lt;br /&gt;
$ cd ../gcc-build&lt;br /&gt;
$ ../gcc-4.1.2/configure --prefix=${ARMDEV}/cross-tools --host=${ARM_HOST} --target=${ARM_TARGET} --disable-multilib --with-sysroot=${ARMDEV} --disable-nls --enable-shared --enable-languages=c,c++ --enable-__cxa_atexit --enable-c99 --enable-long-long --enable-threads=posix&lt;br /&gt;
$ make&lt;br /&gt;
$ make install</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/958117821711856181/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/958117821711856181' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/958117821711856181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/958117821711856181'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2008/10/cross-compiled-gcc-for-arm.html' title='Build Cross-Compiled gcc for ARM by myself'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-6837920992407842991</id><published>2008-10-10T11:06:00.000+08:00</published><updated>2015-04-23T13:04:09.779+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="8051"/><category scheme="http://www.blogger.com/atom/ns#" term="MCU"/><category scheme="http://www.blogger.com/atom/ns#" term="speaker、music note、PIC"/><title type='text'>Make MCU Board - Music Box Module</title><content type='html'>&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggYdvboYBPRN-qjBMBOPJVdBp7Sc1dsFdt-Uhdvsx7txy08rNmZ50hDEwY1mhgIdeoPzXGkJTxph4HgA9H1T6jHI20fM4jxIMq6-zCfIAaW8_GJUHrGJB7mvGTEf5gen2cDFM4MR7bOtE/s1600-h/20081006-speaker.gif&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggYdvboYBPRN-qjBMBOPJVdBp7Sc1dsFdt-Uhdvsx7txy08rNmZ50hDEwY1mhgIdeoPzXGkJTxph4HgA9H1T6jHI20fM4jxIMq6-zCfIAaW8_GJUHrGJB7mvGTEf5gen2cDFM4MR7bOtE/s320/20081006-speaker.gif&quot; id=&quot;BLOGGER_PHOTO_ID_5255357516506980018&quot; style=&quot;cursor: pointer; float: right; margin: 0pt 0pt 10px 10px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
The music notes is defined by frequency variations,&lt;br /&gt;
reference wiki - &lt;a href=&quot;http://en.wikipedia.org/wiki/Music_notes&quot;&gt;music note&lt;/a&gt; and &lt;br /&gt;
&lt;a href=&quot;http://en.wikipedia.org/wiki/Do_%28musical_note%29&quot;&gt;C (musical note)&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Generally, the calculation is based on A4 music note:&lt;br /&gt;
f = [2 ^ (n/12)] × 440 Hz&lt;br /&gt;
&lt;br /&gt;
For easily doing calculation, here we use C-1 as the base level:&lt;br /&gt;
There are all 11 levels, each level has 12 music notes&lt;br /&gt;
n = (i x 12)(level) + j (jth note)&lt;br /&gt;
f = [2 ^ (n/12)] x 8.176 Hz&lt;br /&gt;
&lt;br /&gt;
Calculate all music note&#39;s frequencies by python:&lt;br /&gt;
&lt;pre&gt;# calculate number array
musicNotes = []
for i in range(11):
 row = []
 for j in range(12):
   row.append(8.176 * (2**((i*12+j)*(1.0/12))))
 musicNotes.append(row)

# display frequency table
for i in range(11):
 musicNotes[i]

[8.1760000000000002, 8.6621702594815986, 9.1772497069774346, 9.7229573722622469, 10.301114503940484, 10.913650647694201, 11.562610085962426, 12.250158660543748, 12.978591000891997, 13.75033818222874, 14.567975839030828, 15.434232760971051]
[16.352, 17.324340518963197, 18.354499413954866, 19.445914744524494, 20.602229007880968, 21.827301295388398, 23.125220171924852, 24.500317321087497, 25.957182001783995, 27.50067636445748, 29.135951678061655, 30.868465521942102]
[32.704000000000001, 34.648681037926387, 36.708998827909731, 38.891829489048988, 41.204458015761929, 43.654602590776797, 46.250440343849704, 49.000634642174987, 51.914364003567989, 55.001352728914959, 58.271903356123303, 61.736931043884205]
[65.408000000000001, 69.297362075852774, 73.417997655819462, 77.783658978097975, 82.408916031523859, 87.309205181553594, 92.500880687699407, 98.001269284349974, 103.82872800713598, 110.00270545782992, 116.54380671224661, 123.47386208776841]
[130.816, 138.59472415170555, 146.8359953116389, 155.56731795619595, 164.81783206304772, 174.61841036310716, 185.00176137539881, 196.00253856869995, 207.6574560142719, 220.00541091565984, 233.08761342449321, 246.94772417553673]
[261.63200000000001, 277.1894483034111, 293.67199062327779, 311.1346359123919, 329.63566412609543, 349.23682072621432, 370.00352275079763, 392.00507713739989, 415.3149120285438, 440.01082183131967, 466.17522684898643, 493.89544835107347]
[523.26400000000001, 554.3788966068222, 587.34398124655559, 622.2692718247838, 659.27132825219087, 698.47364145242864, 740.00704550159526, 784.01015427479979, 830.6298240570876, 880.02164366263935, 932.35045369797285, 987.79089670214694]
[1046.528, 1108.7577932136444, 1174.6879624931112, 1244.5385436495676, 1318.5426565043817, 1396.9472829048573, 1480.0140910031905, 1568.0203085495996, 1661.2596481141752, 1760.0432873252787, 1864.7009073959457, 1975.5817934042939]
[2093.056, 2217.5155864272874, 2349.3759249862223, 2489.0770872991352, 2637.0853130087612, 2793.8945658097145, 2960.028182006381, 3136.0406170991969, 3322.5192962283504, 3520.0865746505574, 3729.4018147918891, 3951.1635868085878]
[4186.1120000000001, 4435.0311728545748, 4698.7518499724447, 4978.1541745982704, 5274.1706260175224, 5587.7891316194291, 5920.0563640127621, 6272.0812341983938, 6645.0385924567008, 7040.1731493011148, 7458.8036295837783, 7902.3271736171755]
[8372.2240000000002, 8870.0623457091497, 9397.5036999448894, 9956.3083491965408, 10548.341252035045, 11175.578263238858, 11840.112728025524, 12544.162468396788, 13290.077184913402, 14080.34629860223, 14917.607259167557, 15804.654347234351]&lt;/pre&gt;
&lt;br /&gt;
Base on above calculated values, we define const float gMusicNotes[11][12] , all the frequencies are recorded in the array.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The circuit schematic:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJBdbLwyhfMmVSW6epPQWBF0vAkrG7YsDKPsgo-GXQVQtZxYYt2X_oZgRxtwUo_oJC2CkR2flG_KITEOCE3DyMgy3DYqcTTUY8zlPv3bzYpO0yy2fRNXbk27zl_tmmdYF3UKuOHvOHRKo/s1600-h/20081010-speaker-schema.gif&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJBdbLwyhfMmVSW6epPQWBF0vAkrG7YsDKPsgo-GXQVQtZxYYt2X_oZgRxtwUo_oJC2CkR2flG_KITEOCE3DyMgy3DYqcTTUY8zlPv3bzYpO0yy2fRNXbk27zl_tmmdYF3UKuOHvOHRKo/s320/20081010-speaker-schema.gif&quot; id=&quot;BLOGGER_PHOTO_ID_5255357724793993250&quot; style=&quot;cursor: pointer; float: left; margin: 0pt 10px 10px 0pt;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main process:&lt;br /&gt;
(Depends on MCU&#39;s characters, for PIC16F877A , the compiler is PICC, the memory size of music_cell gSong[] is limited.)&lt;br /&gt;
(This program implements delay process, the deviation of sound frequency is obvious; replace by timer process, the sound frequency would be better than delay process)&lt;br /&gt;
&lt;pre&gt;/*******************************************************************************

  Copyright (c) 2008 Wizign Ltd.
  All Rights Reserved.

  main.c: Main program for demo trigger of speaker

  Version: 1.0.0

  Date: Oct 03, 2008

  Author: YenHung Chen

  E-mail: yhchen@wizign.com

  Revision:
  ---------- -----------------------------------------------------------------
  2008/10/03 Created by YenHung Chen, demo trigger of speaker for both 8051 and PIC

******************************************************************************/
/*******************************************************************************

&amp;lt;&amp;gt;For AT89S52

LCD display:
  There are 8 data pins, which are connected P2.
  The control pins are connected to P1_0, P1_1, and P1_2.

Speaker:
  P3_0


&amp;lt;&amp;gt;For PIC16F877A

LCD display:
  There are 8 data pins, which are connected PORTD
  The control pins are connected to RA0, RA1, and RA2.

Speaker:
  RC0


******************************************************************************/

#include &quot;global.h&quot;
#include &quot;delay.h&quot;
#include &quot;lcd.h&quot;
#include &quot;timer.h&quot;
#include &quot;music.h&quot;

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// define IO and global variables

#ifdef MCU_PIC
/*
// Configurations
typedef unsigned int config;
config at 0x2007 __CONFIG = _XT_OSC &amp;amp; _PWRTE_OFF &amp;amp; _BODEN_OFF &amp;amp; _WDT_OFF &amp;amp; _LVP_OFF;
*/
#endif

#ifdef MCU_PIC
bank1 static music_cell gSong[] = {
#else   // default is MCU_8051
music_cell gSong[] = {
#endif
  {C4, LA,    1}, {C4, LA, 0.25}, {C4, SO, 0.25}, {C4, LA,  0.5},
  {C4, SO,    1}, {C4, MI,    1}, {C4, SO,  0.5}, {C4, MI,  0.5},
  {C4, MI,  0.5}, {C4, RE,  0.5}, {C4, MI,    2}, {C4, MI,    0},
  {C4, RE,    1}, {C4, RE,  0.5}, {C4, DO,  0.5}, {C4, RE,  0.5},
  {C4, RE,  0.5}, {C4, SO,    1}, {C4, SO,  0.5}, {C4, MI,  0.5},
  {C4, MI,  0.5}, {C4, RE,  0.5}, {C4, MI,    2}, {C4, MI,    0},
  {C4, LA,    1}, {C4, LA,  0.5}, {C4, SO,  0.5}, {C4, LA,  0.5},
  {C4, SO,  0.5}, {C4, MI,    1}, {C4, FA,  0.5}, {C4, FA, 0.25},
  {C4, FA, 0.25}, {C4, MI,  0.5}, {C4, RE,  0.5}, {C4, MI,    2},
  {C4, MI,    0}, {C4, SO,    1}, {C4, SO,  0.5}, {C4, SO,  0.5},
  {C4, SO,  0.5}, {C4, SO,  0.5}, {C4, SI,    1}, {C4, LA,  0.5},
  {C4, LA, 0.25}, {C4, LA, 0.25}, {C4, LA,  0.5}, {C4, SO,  0.5},
  {C4, LA,    2}, {C4, LA,    0}, {C5, DO,    1}, {C5, DO,  0.5},
  {C5, DO,  0.5}, {C4, SI,    1}, {C4, SO,    1}, {C4, LA,  0.5},
  {C4, LA, 0.25}, {C4, LA, 0.25}, {C4, LA,  0.5}, {C4, SO,  0.5},
  {C4, LA,  1.5}, {C4, SO, 0.25}, {C4, MI, 0.25}, {C4, SO,    1},
  {C4, SO, 0.75}, {C4, SO, 0.25}, {C4, SO,  0.5}, {C4, SO,  0.5},
  {C4, SI,    1}, {C4, LA, 0.33}, {C4, LA, 0.33}, {C4, LA, 0.33},
  {C4, LA,  0.5}, {C4, SO,  0.5}, {C4, LA,    2}, {C4, LA,    0}
};

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// define functions

/* Initilize parameters before run the main loop */
void InitParams(void)
{
  LCDInit();
  MusicInit();
}

/* Display message on LCD panel */
void DisplayMusicStatus(char* pMsg)
{
  LCDGoto(0);    // goto 1st line
  LCDPuts(&quot;  WIZIGN LTD.  &quot;);

  // Display rotate status
  LCDGoto(0x40);    // goto 2nd line
  LCDPuts(pMsg);
}

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// main program

void main(void)
{
  int count = 0;
  int direction = 0;  // 0:clockwise, 1:counter clockwise

  // Initilize parameters
  InitParams();

  /* do loop */
  while(1){
      DisplayMusicStatus(&quot;Play Music&quot;);
      MusicPlay(10, gSong);
  }
}&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/6837920992407842991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/6837920992407842991' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/6837920992407842991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/6837920992407842991'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2008/10/blog-post.html' title='Make MCU Board - Music Box Module'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggYdvboYBPRN-qjBMBOPJVdBp7Sc1dsFdt-Uhdvsx7txy08rNmZ50hDEwY1mhgIdeoPzXGkJTxph4HgA9H1T6jHI20fM4jxIMq6-zCfIAaW8_GJUHrGJB7mvGTEf5gen2cDFM4MR7bOtE/s72-c/20081006-speaker.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-8739076123881777671</id><published>2008-10-01T12:37:00.000+08:00</published><updated>2015-04-23T13:09:42.808+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="8051"/><category scheme="http://www.blogger.com/atom/ns#" term="DC"/><category scheme="http://www.blogger.com/atom/ns#" term="MCU"/><category scheme="http://www.blogger.com/atom/ns#" term="morot"/><category scheme="http://www.blogger.com/atom/ns#" term="PIC"/><category scheme="http://www.blogger.com/atom/ns#" term="stepper motor"/><title type='text'>Make MCU Board - DC and Stepper Motor Module</title><content type='html'>&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRrQH56kJAuYf4o8wwYrq54qSU_NSFxB5bIGEiXR4UDeIXKZbvCW7sNSqKh_Pc260pkNcMGiaCdjeqe5esccjmTylF8a3MqZeSVnEqyMNC5pRpqY7gkzb0wdCURyRpgnIVnR8QpjXHa3w/s1600-h/20081001-motors.gif&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRrQH56kJAuYf4o8wwYrq54qSU_NSFxB5bIGEiXR4UDeIXKZbvCW7sNSqKh_Pc260pkNcMGiaCdjeqe5esccjmTylF8a3MqZeSVnEqyMNC5pRpqY7gkzb0wdCURyRpgnIVnR8QpjXHa3w/s320/20081001-motors.gif&quot; id=&quot;BLOGGER_PHOTO_ID_5252040612507396402&quot; style=&quot;cursor: pointer; float: right; margin: 0pt 0pt 10px 10px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
DC motor and stepper motor are generally devices that they are used in automation control domain,&lt;br /&gt;
I introduce the control circuit and programming for these 2 type motors, as following:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe width=&quot;320&quot; height=&quot;266&quot; class=&quot;YOUTUBE-iframe-video&quot; data-thumbnail-src=&quot;https://i.ytimg.com/vi/pu7Dl_tzWYw/0.jpg&quot; src=&quot;https://www.youtube.com/embed/pu7Dl_tzWYw?feature=player_embedded&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
The circuit schematic:&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfNY7MEN7MZSNrXAIDAMbeLL3B-JTYnx62NNVy3eEIZWQ1mcshLxGADr3UTWt0cbr3AIs83bvEwqHp6b3g0JfTq0K5x-azyhko9ojb0VUyo64PDe1WwhRZCTXNs_QF9HxAbwM4syLLcfA/s1600-h/20081001-MotorModule.gif&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfNY7MEN7MZSNrXAIDAMbeLL3B-JTYnx62NNVy3eEIZWQ1mcshLxGADr3UTWt0cbr3AIs83bvEwqHp6b3g0JfTq0K5x-azyhko9ojb0VUyo64PDe1WwhRZCTXNs_QF9HxAbwM4syLLcfA/s320/20081001-MotorModule.gif&quot; id=&quot;BLOGGER_PHOTO_ID_5252040388928486626&quot; style=&quot;cursor: pointer; float: left; margin: 0pt 10px 10px 0pt;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Main program:&lt;br /&gt;
&lt;pre&gt;
/*******************************************************************************

Copyright (c) 2008 Wizign Ltd.
All Rights Reserved.

main.c: Main program for demo trigger of motors

Version: 1.0.0

Date: Oct 01, 2008

Author: YenHung Chen

E-mail: yhchen@wizign.com

Revision:
---------- -----------------------------------------------------------------
2008/10/01 Created by YenHung Chen, demo trigger of motors for both 8051 and PIC

******************************************************************************/
/*******************************************************************************

&lt;the&gt;

&amp;lt;&amp;gt;For AT89S52

LCD display:
There are 8 data pins, which are connected P2.
The control pins are connected to P1_0, P1_1, and P1_2.

Step motor:
P3_0, P3_1, P3_2, P3_3

DC motor:
P3_6, P3_7

&amp;lt;&amp;gt;For PIC16F877A

LCD display:
There are 8 data pins, which are connected PORTD
The control pins are connected to RA0, RA1, and RA2.

Step motor:
RC0, RC1, RC2, RC3

DC motor:
RC6, RC7


******************************************************************************/

#include &quot;global.h&quot;
#include &quot;delay.h&quot;
#include &quot;lcd.h&quot;
#include &quot;motor.h&quot;

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// define IO and global variables

#ifdef MCU_PIC

// Configurations
typedef unsigned int config;
config at 0x2007 __CONFIG = _XT_OSC &amp;amp; _PWRTE_OFF &amp;amp; _BODEN_OFF &amp;amp; _WDT_OFF &amp;amp; _LVP_OFF;

#endif


//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// define functions

/* Initilize parameters before run the main loop */
void InitParams(void)
{

LCDInit();
MotorInit();
}

/* Display message on LCD panel */
void DisplayRotateStatus(char* pMsg)
{
LCDGoto(0);    // goto 1st line
LCDPuts(&quot;  WIZIGN LTD.  &quot;);

// Display rotate status
LCDGoto(0x40);    // goto 2nd line
LCDPuts(pMsg);
}

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// main program

void main(void)
{
int count = 0;
int direction = 0;  // 0:clockwise, 1:counter clockwise

// Initilize parameters
InitParams();

/* do loop */
while(1){
    if(direction == 0){
        DisplayRotateStatus(&quot;Clockwise&quot;);
        MotorStepRotate(MOTOR_ROTATE_CW, 4);
        MotorDCRotate(MOTOR_ROTATE_CW, 2);
    }else{  // left
        DisplayRotateStatus(&quot;C Clockwise&quot;);
        MotorStepRotate(MOTOR_ROTATE_CCW, 2);
        MotorDCRotate(MOTOR_ROTATE_CCW, 4);
    }
    count++;
    if(count &amp;gt;= 200){
        count = 0;
        direction = (direction == 0) ? 1 : 0;
    }
}
}&lt;/the&gt;&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/8739076123881777671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/8739076123881777671' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/8739076123881777671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/8739076123881777671'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2008/09/blog-post.html' title='Make MCU Board - DC and Stepper Motor Module'/><author><name>Causality</name><uri>http://www.blogger.com/profile/03290405206240803331</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRrQH56kJAuYf4o8wwYrq54qSU_NSFxB5bIGEiXR4UDeIXKZbvCW7sNSqKh_Pc260pkNcMGiaCdjeqe5esccjmTylF8a3MqZeSVnEqyMNC5pRpqY7gkzb0wdCURyRpgnIVnR8QpjXHa3w/s72-c/20081001-motors.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-6213708461484742999</id><published>2008-09-18T12:43:00.000+08:00</published><updated>2012-04-21T07:30:26.400+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="基礎篇"/><title type='text'>C語言入門</title><content type='html'>&lt;span style=&quot;font-family:Times New Roman;&quot;&gt;C語言在單晶片設計複雜度不高，變數型態宣告沒有浮點數，常用以下兩種型態。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Times New Roman;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Times New Roman;&quot;&gt;char ===&gt; 範圍 0 - 255&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Times New Roman;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Times New Roman;&quot;&gt;int ===&gt; 範圍 0 - 65535&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Times New Roman;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Times New Roman;&quot;&gt;算術運算子： + 、 - 、 * 、 / 、 %(module)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Times New Roman;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Times New Roman;&quot;&gt;關係運算子：&gt;、&lt;、&gt;=(大於等於)、&lt;=(小於等於)、==(等於)、!=(不等於)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Times New Roman;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Times New Roman;&quot;&gt;邏輯運算子：&amp;amp;&amp;amp; (AND Gate)、(OR Gate)、!(NOT Gate)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Times New Roman;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Times New Roman;&quot;&gt;補數運算子：~ ， 1的補數為0，其他反之。&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;※ ；(分號)在C語言中它表示敘述句結束。&lt;br /&gt;&lt;span style=&quot;font-family:Times New Roman;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Times New Roman;&quot;&gt;迴圈語法：&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;for 迴圈&lt;br /&gt;&lt;br /&gt;語法：&lt;br /&gt;&lt;br /&gt;for(char x = initial number ; x &lt;= condition number ; x increment or decrement)&lt;br /&gt;&lt;br /&gt;ex .&lt;br /&gt;for(x = 0 ; x &lt;= 9 ; x++)&lt;br /&gt;{&lt;br /&gt;x += 1;(0+1+...+9)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ex . for(;;)，無窮迴圈&lt;br /&gt;&lt;br /&gt;while 迴圈&lt;br /&gt;&lt;br /&gt;語法：&lt;br /&gt;&lt;br /&gt;char x = initial number ;&lt;br /&gt;while(condition number) &lt;=====這裡不加分號&lt;br /&gt;{&lt;br /&gt;statement;&lt;br /&gt;x increment or decrement;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ex.&lt;br /&gt;int x = 0;&lt;br /&gt;while(x &lt; 10)&lt;br /&gt;{&lt;br /&gt;x += 1;(0+1+2....+9)&lt;br /&gt;x++;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ex. while(1)，無窮迴圈&lt;br /&gt;&lt;br /&gt;do while 迴圈&lt;br /&gt;&lt;br /&gt;語法：&lt;br /&gt;&lt;br /&gt;char x = initial number ;&lt;br /&gt;do&lt;br /&gt;{&lt;br /&gt;statement;&lt;br /&gt;x increment or decrement;&lt;br /&gt;}while(condition number); &lt;=====這裡要加分號&lt;br /&gt;&lt;br /&gt;ex.&lt;br /&gt;int x = 0;&lt;br /&gt;do&lt;br /&gt;{&lt;br /&gt;x += 1;(0+1+2....+9)&lt;br /&gt;x++;&lt;br /&gt;}while(x &lt; 10);</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/6213708461484742999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/6213708461484742999' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/6213708461484742999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/6213708461484742999'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2008/09/c-c-0-255-0-65536-module.html' title='C語言入門'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5807842345457637093.post-2155664195204068522</id><published>2008-09-14T16:13:00.000+08:00</published><updated>2012-04-21T07:30:26.388+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="基礎篇"/><title type='text'>8051入門</title><content type='html'>&lt;span style=&quot;font-family:times new roman;&quot;&gt;一、AT89S51特色&lt;/span&gt; &lt;span style=&quot;font-family:times new roman;&quot;&gt;&lt;br /&gt;1. AT89S51 為 MCS-51 相容產品。 &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;2. 4K Byte of In - System Programmable (ISP) Flash Memory。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;3. Endurance：1000 Write / Erase Cycles。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;4. 工作電壓範圍為 4.0 - 5.5 伏特。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;5. 可使用振盪器 0 - 33 MHz 。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;6. 128 * 8 bit Internel RAM。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;7. 32條可程式輸出/入線。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;8. 兩個16位元計時/計數器。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;9. 六個中斷來源。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;10.全雙工通用非同步接收及傳送序列通道。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;二、AT89S51接腳及定義：&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;該圖片摘錄於ATMEL AT89S51 Datasheet。&lt;/span&gt; &lt;span style=&quot;font-family:times new roman;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnrMtmrXWHMKswTyBz8HOdMUea7oOsK9tNpu4lVmLrgI8cEFBokDx3jTrAEbPnRSByXtsl_yZ5BCvTNyBbjj0qPbTH6W46NCoj8SA6xiSgQJ9EMgCwl2kaZiOSSCc8HnJo9b3D3C9FuOI/s1600-h/8051.h1.gif&quot;&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5245813965440948050&quot; style=&quot;FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnrMtmrXWHMKswTyBz8HOdMUea7oOsK9tNpu4lVmLrgI8cEFBokDx3jTrAEbPnRSByXtsl_yZ5BCvTNyBbjj0qPbTH6W46NCoj8SA6xiSgQJ9EMgCwl2kaZiOSSCc8HnJo9b3D3C9FuOI/s320/8051.h1.gif&quot; border=&quot;0&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;VCC：接 5V 正電壓。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;GND：接地腳。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;Port 0：&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;1. 可作為一個 8 位元輸出 / 入腳。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;2. 外部擴充接腳(例如8255晶片)時可做資料匯流排(D0 - D7)。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;3. 外部擴充記憶體(例如6116晶片)時可做位址匯流排(A0 - A7)。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;Port 1：只作為一個 8 位元輸出 / 入腳。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;Port 2：&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;1. 可作為一個 8 位元輸出 / 入腳。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;2. 外部擴充記憶體做位址匯流排(A8 - A15)。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;Port 3：&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;1. 可作為一個 8 位元輸出 / 入腳。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;2. 特殊功能：&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;● RXD (串列輸入埠 [Serial input poirt])&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Times New Roman;&quot;&gt;●TXD (串列輸出埠 [serial output point])&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Times New Roman;&quot;&gt;●INT0 (外部中斷0 [External interrupt 0])&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Times New Roman;&quot;&gt;●INT1 (外部中斷1 [External interrupt 1])&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Times New Roman;&quot;&gt;●T0 (計時/計數中斷[內部為計時；外部為計數])&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Times New Roman;&quot;&gt;●T1 (計時/計數中斷[內部為計時；外部為計數])&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Times New Roman;&quot;&gt;●WR (外部資料記憶體寫入致能信號)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Times New Roman;&quot;&gt;●RD (外部資料記憶體讀取致能信號)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;RST l：高準位時(保持2個機械週期)，可重置晶片。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;ALE / PROG：位址拴鎖致能(Address Latch Enable)。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;PSEN：程式儲存致能(Program Store Enable)。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;EA / VPP：&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:times new roman;&quot;&gt;●高電位：&lt;br /&gt;1. CPU讀取內部程式記憶體(ROM)。8051、8052&lt;br /&gt;2. 有擴充外部記憶體時：當內部記憶體不敷使用時0FFFH(8051)、1FFFH(8052)，自動讀取外&lt;br /&gt;部記憶體。&lt;br /&gt;●低電位：CPU僅讀取外部記憶體(ROM)。&lt;br /&gt;●8751燒錄：利用此腳輸入21V的燒入電壓。&lt;br /&gt;XTAL 1：接石英振盪器。&lt;br /&gt;XTAL 2：接石英振盪器。&lt;br /&gt;三、AT89S51記憶體：&lt;br /&gt;8051的記憶體包括：&lt;br /&gt;1、8051 有 128 Bytes RAM，8052 有 256 Bytes RAM。&lt;br /&gt;2、擴充外部的 RAM，最大為 64K。&lt;br /&gt;3.記憶體位址 00 ~ 7FH 較低位址共128 byte。&lt;br /&gt;4.記憶體位址 80H ~ FFH 較低位址共128 byte。&lt;br /&gt;5.特殊功能暫存器(Special Function Registor)。 &lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://wizign.blogspot.com/feeds/2155664195204068522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/5807842345457637093/2155664195204068522' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/2155664195204068522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5807842345457637093/posts/default/2155664195204068522'/><link rel='alternate' type='text/html' href='http://wizign.blogspot.com/2008/09/8051.html' title='8051入門'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnrMtmrXWHMKswTyBz8HOdMUea7oOsK9tNpu4lVmLrgI8cEFBokDx3jTrAEbPnRSByXtsl_yZ5BCvTNyBbjj0qPbTH6W46NCoj8SA6xiSgQJ9EMgCwl2kaZiOSSCc8HnJo9b3D3C9FuOI/s72-c/8051.h1.gif" height="72" width="72"/><thr:total>0</thr:total></entry></feed>