主頁 > 作業系統 > 沁恒CH32V103C8T6(二): Linux RISC-V編譯和燒錄環境配置

沁恒CH32V103C8T6(二): Linux RISC-V編譯和燒錄環境配置

2022-07-18 06:25:18 作業系統

目錄

  • 沁恒CH32V103C8T6(一): 核心板焊接和Windows開發環境配置
  • 沁恒CH32V103C8T6(二): Linux RISC-V編譯和燒錄環境配置

硬體準備

  • CH32V103 開發板/核心版
  • WCH-Link

軟體準備

軟體主要是用于編譯的 RISC-V GCC , 和用于燒錄的 OpenOCD.

  • RISC-V GCC 可以選擇公版或者WCH版
  • OpenOCD 暫時只能用WCH定制版本, 用公版的無法識別 wlink

公版 RISC-V GCC

前往 https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases 下載

MounRiver 提供的工具鏈, 包含 RISC-V GCC 和 OpenOCD

前往 http://mounriver.com/download 下載 MRS_Toolchain_Linux_x64, 當前是 MRS_Toolchain_Linux_x64_V1.50.tar.xz, RISC-V GCC 版本為 8.2.0.

解壓工具鏈壓縮包, 目錄結構為

── beforeinstall
│     ├── 50-wch.rules
│     ├── 60-openocd.rules
│     ├── libhidapi-hidraw.so -> libhidapi-hidraw.so.0.0.0
│     ├── libhidapi-hidraw.so.0 -> libhidapi-hidraw.so.0.0.0
│     ├── libhidapi-hidraw.so.0.0.0
│     ├── libhidapi-libusb.so -> libhidapi-libusb.so.0.0.0
│     ├── libhidapi-libusb.so.0 -> libhidapi-libusb.so.0.0.0
│     ├── libhidapi-libusb.so.0.0.0
│     ├── libjaylink.so -> libjaylink.so.0.1.0
│     ├── libjaylink.so.0 -> libjaylink.so.0.1.0
│     ├── libjaylink.so.0.1.0
│     ├── libmcuupdate.so
│     ├── libncurses.so.5 -> libncurses.so.5.9
│     ├── libncurses.so.5.9
│     ├── libtinfo.so.5 -> libtinfo.so.5.9
│     ├── libtinfo.so.5.9
│     ├── libusb-1.0.so -> libusb-1.0.so.0.3.0
│     ├── libusb-1.0.so.0 -> libusb-1.0.so.0.3.0
│     ├── libusb-1.0.so.0.3.0
│     └── start.sh
├── OpenOCD
│     ├── bin
│     │     ├── openocd
│     │     ├── wch-arm.cfg
│     │     └── wch-riscv.cfg
│     ├── README.md
│     └── share
├── README
└── RISC-V Embedded GCC
    ├── bin
    ├── distro-info
    ├── include
    │     └── gdb
    │         └── jit-reader.h
    ├── lib
    │     ├── bfd-plugins
    │     └── gcc
    ├── lib64
    │     ├── libcc1.so -> libcc1.so.0.0.0
    │     ├── libcc1.so.0 -> libcc1.so.0.0.0
    │     ├── libcc1.so.0.0.0
    │     ├── libgcc_s.so.1
    │     ├── libstdc++.so.6 -> libstdc++.so.6.0.24
    │     └── libstdc++.so.6.0.24
    ├── libexec
    │     └── gcc
    ├── README.md
    ├── riscv-none-embed
    └── share

其中

  • beforeinstall 目錄下是需要配置到Ubuntu中的元件檔案, 和設備規則檔案
    • start.sh 這個檔案里面有設定環境的命令
  • OpenOCD 這個目錄下有一定制的 openocd 可執行檔案, 以及對應的 wch-arm 和 wch-riscv 的組態檔
  • RISC-V Embedded GCC RISC-V 編譯器

安裝

RISC-V GCC 安裝

這部分比較簡單, 在 /opt 目錄下建一個 gcc-riscv 目錄, 將工具解壓后復制過去, 用公版或WCH工具鏈中帶的版本都行. 設定好相應的權限, 路徑在后面配置 Makefile 的時候需要使用, 用 --version驗證一下是否正常

/opt/gcc-riscv$ /opt/gcc-riscv/riscv-none-embed-gcc-10.2.0-1.2/bin/riscv-none-embed-gcc --version

riscv-none-embed-gcc (xPack GNU RISC-V Embedded GCC x86_64) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

OpenOCD 安裝

也是解壓后復制到 /opt 目錄下, 驗證一下

/opt/gcc-riscv$ /opt/openocd/wch-openocd/bin/openocd --version

Open On-Chip Debugger 0.11.0+dev-02215-gcc0ecfb6d-dirty (2022-06-23-10:21)
Licensed under GNU GPL v2
For bug reports, read
  http://openocd.org/doc/doxygen/bugs.html

環境配置

在openocd可以正常燒錄前, 需要進行一些環境配置, 參考 WCH 工具包下的 beforeinstall 目錄

1. 配置元件

因為環境中還安裝了其他的工具, 為避免沖突, 對 start.sh 中的步驟手工安裝. 在 /usr/lib 下創建一個單獨的目錄, 用于放置這些元件檔案

cd /usr/lib
sudo mkdir wch-moun-river
sudo cp ./beforeinstall/lib* wch-moun-river/

為這個新的鏈接庫檔案目錄增加ldconfig配置, 在 /etc/ld.so.conf.d/ 下創建檔案 wch-moun-river.conf , 內容如下

more /etc/ld.so.conf.d/wch-moun-river.conf 
# lib for wch moun river studio
/usr/lib/wch-moun-river

然后更新生效

sudo ldconfig

如果出現這樣的提示, 說明環境中存在多個同樣名稱的元件, 如果不想看到這些警告可以將這些檔案洗掉, 也可以忽略

/sbin/ldconfig.real: /usr/lib/wch-moun-river/libtinfo.so.5 is not a symbolic link

2. 配置設備權限

先檢查一下 /etc/udev/ 下是否已經存在相關的配置, 如果有, 需要和這兩個規則整合一下, 如果沒有, 直接復制然后更新就可以了

sudo cp ./50-wch.rules /etc/udev/rules.d
sudo cp ./60-openocd.rules  /etc/udev/rules.d
# Reload rules
sudo udevadm control  --reload-rules

3. 檢查是否生效

將 WCH-Link 和開發板連接到電腦, 此時dmesg應該能正常檢測到 WCH-Link 設備, 檢查一下 WCH-Link 是否運行在 WCH-Link 模式, 如果運行在 DAP-Link模式下, 需要切換一下.

[ 2449.285125] usb 2-3: USB disconnect, device number 2
[ 2452.341042] usb 2-3: new full-speed USB device number 5 using xhci_hcd
[ 2452.494530] usb 2-3: New USB device found, idVendor=1a86, idProduct=8010, bcdDevice= 2.05
[ 2452.494543] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2452.494549] usb 2-3: Product: WCH-Link
[ 2452.494554] usb 2-3: Manufacturer: wch.cn
[ 2452.494558] usb 2-3: SerialNumber: 0001A0000000
[ 2452.498525] cdc_acm 2-3:1.1: ttyACM0: USB ACM device

到工具鏈解壓目錄下, 用 OpenOCD 檢查是否能正常連接

./openocd -f wch-riscv.cfg -c init -c halt

# 如果有以下的顯示說明配置正確
Open On-Chip Debugger 0.11.0+dev-02215-gcc0ecfb6d-dirty (2022-06-23-10:21)
Licensed under GNU GPL v2
For bug reports, read
  http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Ready for Remote Connections
Info : WCH-Link-CH549  mod:RV version 2.5 
Info : wlink_init ok
Info : This adapter doesn't support configurable speed
Info : JTAG tap: riscv.cpu tap/device found: 0x00000001 (mfg: 0x000 (<invalid>), part: 0x0000, ver: 0x0)
Warn : Bypassing JTAG setup events due to errors
Info : [riscv.cpu.0] datacount=2 progbufsize=8
Info : Examined RISC-V core; found 1 harts
Info :  hart 0: XLEN=32, misa=0x0
[riscv.cpu.0] Target successfully examined.
Info : starting gdb server for riscv.cpu.0 on 3333
Info : Listening on port 3333 for gdb connections
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections

如果顯示下面的錯誤, 說明元件配置有誤

./openocd: symbol lookup error: ./openocd: undefined symbol: jaylink_device_get_usb_bus_ports

如果顯示下面的錯誤, 說明使用的不是 wch 提供的定制 openocd

wch-riscv.cfg:2: Error: invalid command name "adapter"
in procedure 'script' 
at file "embedded:startup.tcl", line 60
at file "wch-riscv.cfg", line 2

運行示例專案

匯出專案

從 GitHub 匯出專案到本地

git clone https://github.com/IOsetting/ch32v103-template.git

修改專案配置

打開 Makefile 將工具路徑配置為自己的路徑

TOOL_CHAIN_PATH ?= /opt/gcc-riscv/riscv-none-embed-gcc-10.2.0-1.2/bin
OPENOCD_PATH    ?= /opt/openocd/wch-openocd/bin

專案名稱可以修改

PROJECT_NAME    = test001

編譯專案

# 清理
make clean

# 編譯
make

燒錄

make flash

附錄

編譯命令和引數說明

編譯命令的基本格式如下

riscv-none-embed-gcc 
  -march=rv32imac 
  -mabi=ilp32 
  -msmall-data-limit=8 
  -mno-save-restore 
  -Os 
  -fmessage-length=0 
  -fsigned-char 
  -ffunction-sections
  -fdata-sections
  -Wunused 
  -Wuninitialized  
  -g 
  -I"/home/milton/WorkRiscV/ch32v_ws001/ch32v103_test001/Debug" 
  -I"/home/milton/WorkRiscV/ch32v_ws001/ch32v103_test001/Core" 
  -I"/home/milton/WorkRiscV/ch32v_ws001/ch32v103_test001/User" 
  -I"/home/milton/WorkRiscV/ch32v_ws001/ch32v103_test001/Peripheral/inc" 
  -std=gnu99 
  -MMD
  -MP
  -MF"Peripheral/src/ch32v10x_crc.d"
  -MT"Peripheral/src/ch32v10x_crc.o"
  -c
  -o "Peripheral/src/ch32v10x_crc.o"
  "../Peripheral/src/ch32v10x_crc.c"

各引數的說明, 引自 RISC-V-Options, GCC C Dialect Options GCC Preprocessor Options

-march=ISA-string 設定指令集架構

Generate code for given RISC-V ISA (e.g. ‘rv64im’). ISA strings must be lower-case. Examples include ‘rv64i’, ‘rv32g’, ‘rv32e’, and ‘rv32imaf’.

When -march= is not specified, use the setting from -mcpu.

If both -march and -mcpu= are not specified, the default for this argument is system dependent, users who want a specific architecture extensions should specify one explicitly.

-mabi=ABI-string 設定應用程式二進制介面

Specify integer and floating-point calling convention. ABI-string contains two parts: the size of integer types and the registers used for floating-point types. For example ‘-march=rv64ifd -mabi=lp64d’ means that ‘long’ and pointers are 64-bit (implicitly defining ‘int’ to be 32-bit), and that floating-point values up to 64 bits wide are passed in F registers. Contrast this with ‘-march=rv64ifd -mabi=lp64f’, which still allows the compiler to generate code that uses the F and D extensions but only allows floating-point values up to 32 bits long to be passed in registers; or ‘-march=rv64ifd -mabi=lp64’, in which no floating-point arguments will be passed in registers.

The default for this argument is system dependent, users who want a specific calling convention should specify one explicitly. The valid calling conventions are: ‘ilp32’, ‘ilp32f’, ‘ilp32d’, ‘lp64’, ‘lp64f’, and ‘lp64d’. Some calling conventions are impossible to implement on some ISAs: for example, ‘-march=rv32if -mabi=ilp32d’ is invalid because the ABI requires 64-bit values be passed in F registers, but F registers are only 32 bits wide. There is also the ‘ilp32e’ ABI that can only be used with the ‘rv32e’ architecture. This ABI is not well specified at present, and is subject to change.

-msmall-data-limit=n 將小于n位元組的全域和靜態資料放到一個特定區域

Put global and static data smaller than n bytes into a special section (on some targets).

-mno-save-restore

Do or don’t use smaller but slower prologue and epilogue code that uses library function calls. The default is to use fast inline prologues and epilogues.

-Os 尺寸優化

Optimize for size. -Os enables all -O2 optimizations except those that often increase code size:

-falign-functions  -falign-jumps 
-falign-labels  -falign-loops 
-fprefetch-loop-arrays  -freorder-blocks-algorithm=stc

-fmessage-length=n

Try to format error messages so that they fit on lines of about n characters. If n is zero, then no line-wrapping is done; each error message appears on a single line. This is the default for all front ends.

Note - this option also affects the display of the ‘#error’ and ‘#warning’ pre-processor directives, and the ‘deprecated’ function/type/variable attribute. It does not however affect the ‘pragma GCC warning’ and ‘pragma GCC error’ pragmas.

-fsigned-char

Let the type char be signed, like signed char.

Note that this is equivalent to -fno-unsigned-char, which is the negative form of -funsigned-char. Likewise, the option -fno-signed-char is equivalent to -funsigned-char.

-ffunction-sections, -fdata-sections

Place each function or data item into its own section in the output file if the target supports arbitrary sections. The name of the function or the name of the data item determines the section’s name in the output file.

Use these options on systems where the linker can perform optimizations to improve locality of reference in the instruction space. Most systems using the ELF object format have linkers with such optimizations. On AIX, the linker rearranges sections (CSECTs) based on the call graph. The performance impact varies.

Together with a linker garbage collection (linker --gc-sections option) these options may lead to smaller statically-linked executables (after stripping).

-Wunused

Warns, all the -Wunused options combined.

-Wuninitialized

Warn if an object with automatic or allocated storage duration is used without having been initialized. In C++, also warn if a non-static reference or non-static const member appears in a class without constructors.

-g

generates debug information to be used by GDB debugger.

  • -g0 no debug information
  • -g1 minimal debug information
  • -g default debug information
  • -g3 maximal debug information

-MD

-MD is equivalent to -M -MF file, except that -E is not implied. The driver determines file based on whether an -o option is given. If it is, the driver uses its argument but with a suffix of .d, otherwise it takes the name of the input file, removes any directory components and suffix, and applies a .d suffix.

-MMD

Like -MD except mention only user header files, not system header files.

-MP

This option instructs CPP to add a phony target for each dependency other than the main file, causing each to depend on nothing. These dummy rules work around errors make gives if you remove header files without updating the Makefile to match.

This is typical output:

test.o: test.c test.h
test.h:

-MF file

When used with -M or -MM, specifies a file to write the dependencies to. If no -MF switch is given the preprocessor sends the rules to the same place it would send preprocessed output.

When used with the driver options -MD or -MMD, -MF overrides the default dependency output file.

If file is -, then the dependencies are written to stdout.

-MT target

Change the target of the rule emitted by dependency generation. By default CPP takes the name of the main input file, deletes any directory components and any file suffix such as ‘.c’, and appends the platform’s usual object suffix. The result is the target.

An -MT option sets the target to be exactly the string you specify. If you want multiple targets, you can specify them as a single argument to -MT, or use multiple -MT options.

For example, -MT '$(objpfx)foo.o' might give

$(objpfx)foo.o: foo.c

燒錄命令

# 擦寫
./openocd -f wch-riscv.cfg -c init -c halt -c "flash erase_sector wch_riscv 0 last " -c exit
# 寫入
./openocd -f wch-riscv.cfg -c init -c halt -c "program ./obj/ch32v103_test001.elf" -c exit
# 校驗
./openocd -f wch-riscv.cfg -c init -c halt -c "verify_image ./obj/ch32v103_test001.elf" -c exit
# 重置,運行
./openocd -f wch-riscv.cfg -c init -c halt -c wlink_reset_resume -c exit

燒錄命令執行記錄

milton@/OpenOCD/bin$ ./openocd -f wch-riscv.cfg -c init -c halt -c "flash erase_sector wch_riscv 0 last " -c exit
Open On-Chip Debugger 0.11.0+dev-02215-gcc0ecfb6d-dirty (2022-06-23-10:21)
Licensed under GNU GPL v2
For bug reports, read
  http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Ready for Remote Connections
Info : WCH-Link-CH549  mod:RV version 2.5 
Info : wlink_init ok
Info : This adapter doesn't support configurable speed
Info : JTAG tap: riscv.cpu tap/device found: 0x00000001 (mfg: 0x000 (<invalid>), part: 0x0000, ver: 0x0)
Warn : Bypassing JTAG setup events due to errors
Info : [riscv.cpu.0] datacount=2 progbufsize=8
Info : Examined RISC-V core; found 1 harts
Info :  hart 0: XLEN=32, misa=0x0
[riscv.cpu.0] Target successfully examined.
Info : starting gdb server for riscv.cpu.0 on 3333
Info : Listening on port 3333 for gdb connections
Info : device id = 0x3c83abcd
Info : flash size = 64kbytes
erased sectors 0 through 63 on flash bank 0 in 0.019672s

milton@/OpenOCD/bin$ ./openocd -f wch-riscv.cfg -c init -c halt -c "program ch32v103_test001/obj/ch32v103_test001.elf" -c exit
Open On-Chip Debugger 0.11.0+dev-02215-gcc0ecfb6d-dirty (2022-06-23-10:21)
Licensed under GNU GPL v2
For bug reports, read
  http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Ready for Remote Connections
Info : WCH-Link-CH549  mod:RV version 2.5 
Info : wlink_init ok
Info : This adapter doesn't support configurable speed
Info : JTAG tap: riscv.cpu tap/device found: 0x00000001 (mfg: 0x000 (<invalid>), part: 0x0000, ver: 0x0)
Warn : Bypassing JTAG setup events due to errors
Info : [riscv.cpu.0] datacount=2 progbufsize=8
Info : Vector support with vlenb=0
Info : Examined RISC-V core; found 1 harts
Info :  hart 0: XLEN=32, misa=0xffffffff
[riscv.cpu.0] Target successfully examined.
Info : starting gdb server for riscv.cpu.0 on 3333
Info : Listening on port 3333 for gdb connections
Info : JTAG tap: riscv.cpu tap/device found: 0x00000001 (mfg: 0x000 (<invalid>), part: 0x0000, ver: 0x0)
Warn : Bypassing JTAG setup events due to errors
** Programming Started **
Info : device id = 0x3c83abcd
Info : flash size = 64kbytes
** Programming Finished **

milton@/OpenOCD/bin$ ./openocd -f wch-riscv.cfg -c init -c halt -c "verify_image ch32v103_test001/obj/ch32v103_test001.elf" -c exit
Open On-Chip Debugger 0.11.0+dev-02215-gcc0ecfb6d-dirty (2022-06-23-10:21)
Licensed under GNU GPL v2
For bug reports, read
  http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Ready for Remote Connections
Info : WCH-Link-CH549  mod:RV version 2.5 
Info : wlink_init ok
Info : This adapter doesn't support configurable speed
Info : JTAG tap: riscv.cpu tap/device found: 0x00000001 (mfg: 0x000 (<invalid>), part: 0x0000, ver: 0x0)
Warn : Bypassing JTAG setup events due to errors
Info : [riscv.cpu.0] datacount=2 progbufsize=8
Info : Vector support with vlenb=0
Info : Examined RISC-V core; found 1 harts
Info :  hart 0: XLEN=32, misa=0xffffffff
[riscv.cpu.0] Target successfully examined.
Info : starting gdb server for riscv.cpu.0 on 3333
Info : Listening on port 3333 for gdb connections
Info : Verify Success

milton@/OpenOCD/bin$ ./openocd -f wch-riscv.cfg -c init -c halt -c wlink_reset_resume -c exit
Open On-Chip Debugger 0.11.0+dev-02215-gcc0ecfb6d-dirty (2022-06-23-10:21)
Licensed under GNU GPL v2
For bug reports, read
  http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Ready for Remote Connections
Info : WCH-Link-CH549  mod:RV version 2.5 
Info : wlink_init ok
Info : This adapter doesn't support configurable speed
Info : JTAG tap: riscv.cpu tap/device found: 0x00000001 (mfg: 0x000 (<invalid>), part: 0x0000, ver: 0x0)
Warn : Bypassing JTAG setup events due to errors
Info : [riscv.cpu.0] datacount=2 progbufsize=8
Info : Examined RISC-V core; found 1 harts
Info :  hart 0: XLEN=32, misa=0x0
[riscv.cpu.0] Target successfully examined.
Info : starting gdb server for riscv.cpu.0 on 3333
Info : Listening on port 3333 for gdb connections

轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/499496.html

標籤:嵌入式

上一篇:Color Wheel for Mac (數字色輪)

下一篇:ZOC for Mac(最好用的終端仿真器)

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • CA和證書

    1、在 CentOS7 中使用 gpg 創建 RSA 非對稱密鑰對 gpg --gen-key #Centos上生成公鑰/密鑰對(存放在家目錄.gnupg/) 2、將 CentOS7 匯出的公鑰,拷貝到 CentOS8 中,在 CentOS8 中使用 CentOS7 的公鑰加密一個檔案 gpg -a ......

    uj5u.com 2020-09-10 00:09:53 more
  • Kubernetes K8S之資源控制器Job和CronJob詳解

    Kubernetes的資源控制器Job和CronJob詳解與示例 ......

    uj5u.com 2020-09-10 00:10:45 more
  • VMware下安裝CentOS

    VMware下安裝CentOS 一、軟硬體準備 1 Centos鏡像準備 1.1 CentOS鏡像下載地址 下載地址 1.2 CentOS鏡像下載程序 點擊下載地址進入如下圖的網站,選擇需要下載的版本,這里選擇的是Centos8,點擊如圖所示。 決定選擇Centos8后,選擇想要的鏡像源進行下載,此 ......

    uj5u.com 2020-09-10 00:12:10 more
  • 如何使用Grep命令查找多個字串

    如何使用Grep 命令查找多個字串 大家好,我是良許! 今天向大家介紹一個非常有用的技巧,那就是使用 grep 命令查找多個字串。 簡單介紹一下,grep 命令可以理解為是一個功能強大的命令列工具,可以用它在一個或多個輸入檔案中搜索與正則運算式相匹配的文本,然后再將每個匹配的文本用標準輸出的格式 ......

    uj5u.com 2020-09-10 00:12:28 more
  • git配置http代理

    git配置http代理 經常遇到克隆 github 慢的問題,這里記錄一下幾種配置 git 代理的方法,解決 clone github 過慢。 目錄 git配置代理 git單獨配置github代理 git配置全域代理 配置終端環境變數 git配置代理 主要使用 git config 命令 git單獨 ......

    uj5u.com 2020-09-10 00:12:33 more
  • Linux npm install 裝包時提示Error EACCES permission denied解

    npm install 裝包時提示Error EACCES permission denied解決辦法 ......

    uj5u.com 2020-09-10 00:12:53 more
  • Centos 7下安裝nginx,使用yum install nginx,提示沒有可用的軟體包

    Centos 7下安裝nginx,使用yum install nginx,提示沒有可用的軟體包。 18 (flaskApi) [root@67 flaskDemo]# yum -y install nginx 19 已加載插件:fastestmirror, langpacks 20 Loading ......

    uj5u.com 2020-09-10 00:13:13 more
  • Linux查看服務器暴力破解ssh IP

    在公網的服務器上經常遇到別人爆破你服務器的22埠,用來挖礦或者干其他嘿嘿嘿的事情~ 這種情況下正確的做法是: 修改默認ssh的22埠 使用設定密鑰登錄或者白名單ip登錄 建議服務器密碼為復雜密碼 創建普通用戶登錄服務器(root權限過大) 建立堡壘機,實作統一管理服務器 統計爆破IP [root ......

    uj5u.com 2020-09-10 00:13:17 more
  • CentOS 7系統常見快捷鍵操作方式

    Linux系統中一些常見的快捷方式,可有效提高操作效率,在某些時刻也能避免操作失誤帶來的問題。 ......

    uj5u.com 2020-09-10 00:13:31 more
  • CentOS 7作業系統目錄結構介紹

    作業系統存在著大量的資料檔案資訊,相應檔案資訊會存在于系統相應目錄中,為了更好的管理資料資訊,會將系統進行一些目錄規劃,不同目錄存放不同的資源。 ......

    uj5u.com 2020-09-10 00:13:35 more
最新发布
  • vim的常用命令

    Vim的6種基本模式 1. 普通模式在普通模式中,用的編輯器命令,比如移動游標,洗掉文本等等。這也是Vim啟動后的默認模式。這正好和許多新用戶期待的操作方式相反(大多數編輯器默認模式為插入模式)。 2. 插入模式在這個模式中,大多數按鍵都會向文本緩沖中插入文本。大多數新用戶希望文本編輯器編輯程序中一 ......

    uj5u.com 2023-04-20 08:43:21 more
  • vim的常用命令

    Vim的6種基本模式 1. 普通模式在普通模式中,用的編輯器命令,比如移動游標,洗掉文本等等。這也是Vim啟動后的默認模式。這正好和許多新用戶期待的操作方式相反(大多數編輯器默認模式為插入模式)。 2. 插入模式在這個模式中,大多數按鍵都會向文本緩沖中插入文本。大多數新用戶希望文本編輯器編輯程序中一 ......

    uj5u.com 2023-04-20 08:42:36 more
  • docker學習

    ###Docker概述 真實專案部署環境可能非常復雜,傳統發布專案一個只需要一個jar包,運行環境需要單獨部署。而通過Docker可將jar包和相關環境(如jdk,redis,Hadoop...)等打包到docker鏡像里,將鏡像發布到Docker倉庫,部署時下載發布的鏡像,直接運行發布的鏡像即可。 ......

    uj5u.com 2023-04-19 09:26:53 more
  • 設定Windows主機的瀏覽器為wls2的默認瀏覽器

    這里以Chrome為例。 1. 準備作業 wsl是可以使用Windows主機上安裝的exe程式,出于安全考慮,默認情況下改功能是無法使用。要使用的話,終端需要以管理員權限啟動。 我這里以Windows Terminal為例,介紹如何默認使用管理員權限打開終端,具體操作如下圖所示: 2. 操作 wsl ......

    uj5u.com 2023-04-19 09:25:49 more
  • docker學習

    ###Docker概述 真實專案部署環境可能非常復雜,傳統發布專案一個只需要一個jar包,運行環境需要單獨部署。而通過Docker可將jar包和相關環境(如jdk,redis,Hadoop...)等打包到docker鏡像里,將鏡像發布到Docker倉庫,部署時下載發布的鏡像,直接運行發布的鏡像即可。 ......

    uj5u.com 2023-04-19 09:19:04 more
  • Linux學習筆記

    IP地址和主機名 IP地址 ifconfig可以用來查詢本機的IP地址,如果不能使用,可以通過install net-tools安裝。 Centos系統下ens33表示主網卡;inet后表示IP地址;lo表示本地回環網卡; 127.0.0.1表示代指本機;0.0.0.0可以用于代指本機,同時在放行設 ......

    uj5u.com 2023-04-18 06:52:01 more
  • 解決linux系統的kdump服務無法啟動的問題

    問題:專案麒麟系統服務器的kdump服務無法啟動,沒有相關日志無法定位問題。 1、查看服務狀態是關閉的,重啟系統也無法啟動 systemctl status kdump 2、修改grub引數,修改“crashkernel”為“512M(有的機器數值太大太小都會導致報錯,建議從128M開始試,或者加個 ......

    uj5u.com 2023-04-12 09:59:50 more
  • 解決linux系統的kdump服務無法啟動的問題

    問題:專案麒麟系統服務器的kdump服務無法啟動,沒有相關日志無法定位問題。 1、查看服務狀態是關閉的,重啟系統也無法啟動 systemctl status kdump 2、修改grub引數,修改“crashkernel”為“512M(有的機器數值太大太小都會導致報錯,建議從128M開始試,或者加個 ......

    uj5u.com 2023-04-12 09:59:01 more
  • 你是不是暴露了?

    作者:袁首京 原創文章,轉載時請保留此宣告,并給出原文連接。 如果您是計算機相關從業人員,那么應該經歷不止一次網路安全專項檢查了,你肯定是收到過資訊系統技術檢測報告,要求你加強風險監測,確保你提供的系統服務堅實可靠了。 沒檢測到問題還好,檢測到問題的話,有些處理起來還是挺麻煩的,尤其是線上正在運行的 ......

    uj5u.com 2023-04-05 16:52:56 more
  • 細節拉滿,80 張圖帶你一步一步推演 slab 記憶體池的設計與實作

    1. 前文回顧 在之前的幾篇記憶體管理系列文章中,筆者帶大家從宏觀角度完整地梳理了一遍 Linux 記憶體分配的整個鏈路,本文的主題依然是記憶體分配,這一次我們會從微觀的角度來探秘一下 Linux 內核中用于零散小記憶體塊分配的記憶體池 —— slab 分配器。 在本小節中,筆者還是按照以往的風格先帶大家簡單 ......

    uj5u.com 2023-04-05 16:44:11 more