歡迎
大家好,很高興你我能在CSDN上遇見,由于個人能力有限,如有缺漏,還請私信斧正!
使用開發闆為三星S3C2440,基于linux開發環境
Linux系統安裝及其網絡配置
安卓VMware Workstation 虛拟機,下載下傳Ubuntu
教程過多,不再示範
下載下傳VIM編輯器
因為下載下傳源的關系下載下傳很慢,可以先用gedit編輯器更換下載下傳源,但是我習慣用vim
sudo apt-get install vim
更換國内下載下傳源
sudo vim /etc/apt/sources.list
修改下載下傳源,在原有的網址上加上#,将國内阿裡雲或者清華源複制拷貝
阿裡源
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
清華源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
更新源操作
sudo apt-get update
VSCODE 安裝及其配置
在浏覽器下下載下傳 Visual Studio Code 的linux 版本
在linux下用終端打開其deb格式的安裝包輸入
sudo dpkg -i + 檔案名
Visual Studio Code功能極其強大,其強大的功能需要安裝插件
涉及到編譯以及中文漢化的插件:
![](https://img.laitimes.com/img/__Qf2AjLwojIjJCLyojI0JCLiAzNfRHLGZkRGZkRfJ3bs92YsYTMfVmepNHLxUEVOJzaU1UeRpHW4Z0MMBjVtJWd0ckW65UbM5WOHJWa5kHT20ESjBjUIF2X0hXZ0xCMx81dvRWYoNHLrdEZwZ1Rh5WNXp1bwNjW1ZUba9VZwlHdssmch1mclRXY39CXldWYtlWPzNXZj9mcw1ycz9WL49zZuBnL5cjMyEzN1kTM0EzMwAjMwIzLc52YucWbp5GZzNmLn9Gbi1yZtl2Lc9CX6MHc0RHaiojIsJye.png)
涉及字元高亮,顔色主題等插件推薦使用:
共享檔案夾設定
建立共享檔案夾
mkdir /home/user/share (user 為使用者名)
設定檔案夾權限
chmod 777 /home/home/share
下載下傳 Samba
sudo apt-get install samba
配置Samba配置檔案
sudo vim /etc/samba/smb.conf
在配置檔案最後一行加上
[share]
path = /home/user/share
available = yes
browseable = yes smbpasswd
writable = yes
public = yes
建立使用者
sudo useradd user
設定密碼
sudo smbpasswd -a user
擷取IP
ip addr
在windows下 WIN+R 打開運作 輸入
\\ +IP
輸入使用者名密碼登入即可通路共享檔案夾,在此檔案夾下windows和linux對此檔案夾都有讀寫權限
windows 下遠端連接配接虛拟機
工具:PuTTY
安裝SSH
sudo apt-get install SSH
查詢IP
ip addr
啟動PuTTY 輸入查詢的IP 和端口,端口号22
在指令行輸入使用者名密碼
交叉工具鍊安裝
将工具鍊壓縮包複制到共享檔案夾中
将共享檔案夾中的壓縮包移動到/opt目錄下
mv /user/home/share/xxxx.tar.bz2 /opt
解壓交叉工具鍊壓縮包
sudo tar -jxvf xxxx.tar.bz2
設定環境變量,假設工具在/opt/xxx/xx/bin中
sudo vim /etc/environment
在PATH 後加上
:/opt/xxx/xx/bin
如圖
重新開機LINUX系統,等待環境變量生效
重新開機之後終端輸入
arm-linux-gcc -v
或者您相應的工具鍊
若顯示了您的工具鍊版本号,則工具鍊安裝成功,但未顯示,也有很多原因導緻,如果您的gcc代碼能不能補全,則說明您的環境變量設定有問題,如果能補全,但是顯示找不到檔案,則說明您遇到和我一樣的問題,這個問題我找了一整天,試了很多版本的系統和工具鍊,最終找到答案,因為我裝的是64位作業系統,使用我這個版本的工具鍊必須安裝lsb-core
apt-get install lsb-core
然而在ubuntu 16上可以用以上代碼解決,但是在ubuntu 18 需要輸入
sudo apt-get install lib32z1