Cov txheej txheem:

Txiv kab ntxwv PI HowTo: Sau Sunxi Tool rau Windows Hauv Windows: 14 Cov Kauj Ruam (nrog Duab)
Txiv kab ntxwv PI HowTo: Sau Sunxi Tool rau Windows Hauv Windows: 14 Cov Kauj Ruam (nrog Duab)

Video: Txiv kab ntxwv PI HowTo: Sau Sunxi Tool rau Windows Hauv Windows: 14 Cov Kauj Ruam (nrog Duab)

Video: Txiv kab ntxwv PI HowTo: Sau Sunxi Tool rau Windows Hauv Windows: 14 Cov Kauj Ruam (nrog Duab)
Video: Tshuaj theem vim li cas thiaj tau nqi ?/ Siv kho mob dab tsi?/paris polyphylla использовать для? 2024, Kaum ib hlis
Anonim
Txiv kab ntxwv PI HowTo: Sau Sunxi Tool rau Windows Hauv Windows
Txiv kab ntxwv PI HowTo: Sau Sunxi Tool rau Windows Hauv Windows

UA NTEJ:

Koj yuav xav tau

  1. A (desktop) khoos phis tawj siv Windows.
  2. Kev sib txuas hauv Is Taws Nem.
  3. Ib lub txiv kab ntxwv PI board.

Qhov kawg yog xaiv tau, tab sis kuv paub tseeb, tias Koj twb muaj nws lawm. Txwv tsis pub Koj yuav tsis nyeem phau ntawv qhia no.

Thaum Koj Yuav Cov Txiv Kab Ntxwv PI ib lub khoos phis tawj computer nws nyob qis ib qho ntawm cov hlau tuag kom txog thaum teeb tsa kom raug. Thiab nws cov ntaub ntawv teeb tsa tseem ceeb: "script.bin" yog thawj tus yuam sij coj nws ciaj sia. Cov ntaub ntawv no nyob hauv qhov muab faib ntawm koj li bootable SD card. Thiab hmoov zoo rau peb, hauv feem ntau ntawm Linux kev faib tawm los ntawm Lub Chaw Haujlwm raug cai (https://www.orangepi.org/downloadresources/) qhov muab faib no yog FAT32 thiab tuaj yeem pom yooj yim los ntawm txhua lub khoos phis tawj Windows. Nws ua tau yooj yim tiag tiag yam, txij li tseem tsis muaj txoj hauv kev txhim khu kev qha sau rau hauv Linux ext2 faib los ntawm hauv qab Windows.

Hmoov tsis zoo rau peb tsab ntawv script.bin cov ntaub ntawv teeb tsa muaj binary hom tsis zoo rau tib neeg kho. Ib tus xav tau qee yam cuab yeej software txhawm rau txiav txim siab nws thiab rov qab rov qab tom qab qhov kev hloov kho tsim nyog tau ua. Thiab muaj cov cuab yeej zoo li no nyob. Nws yog qhov tsis zoo SUNXI-TOOLS. Yoov nyob rau hauv cov tshuaj pleev yog tias nws tau npaj los ua haujlwm hauv Linux thiab peb ib txwm yuav tsum khaws lub tshuab Linux tshwj xeeb rau tsuas yog siv cov cuab yeej sunxi, lossis nrhiav txoj hauv kev los sau lawv rau lub qhov rais.

Kuv tuaj yeem sau nws yooj yim thiab qhia qhov ua tiav, tab sis ib tus tsis paub tias lawv xav ua qhov kev tso tawm tshiab thiab Koj yuav xav tau qhov muab tso ua ke tshiab ASAP. Yog li kuv txiav txim siab los ua phau ntawv qhia yuav ua li cas sau cov cuab yeej tseem ceeb los ntawm cov peev txheej. Cia peb pib.

Kauj ruam 1: Rub tawm Sunxi-cov cuab yeej

Download Sunxi-cov cuab yeej
Download Sunxi-cov cuab yeej
Download Sunxi-cov cuab yeej
Download Sunxi-cov cuab yeej

Tau txais qhov tseeb (lossis tsim nyog) version ntawm sunxi-tools sourcecode. Go mus rau URL: https://github.com/linux-sunxi/sunxi-tools/releases thiab xaiv rub tawm ua zip archive.

Kauj ruam 2: Unzip Sourcecode

Unzip lub Sourcecode
Unzip lub Sourcecode

Thaum qhov rub tawm tiav, unzip qhov chaws rau hauv daim nplaub tshev uas koj xaiv. (ntxiv kuv yuav xav tias daim nplaub tshev no yog c: / sunxitools \, yog li hloov txoj hauv kev no los ntawm txoj kev ntawm koj tus kheej).

Kauj ruam 3: Download Code:: blocks

Download Code:: thaiv
Download Code:: thaiv

Yog tias koj muaj daim ntawv theej ntawm qee qhov ua haujlwm c ++ compiler rau windows. thiab yog tias Koj paub siv nws li cas, Koj tuaj yeem ncaj qha mus rau theem 3. Lwm tus yuav tsum tau txais cov c ++ compiler kom raug thiab lub plhaub (IDE) kom siv tau yooj yim. Qhov kev xaiv ntawm kuv yog tus lej:: thaiv rau Windows nrog rau kev txhim kho MinGW cov cuab yeej ua ntej. Koj tuaj yeem tau txais nws los ntawm no:

Rub tawm thiab nruab nws.

Kauj Ruam 4: Xeem Koj Tus IDE

Kuaj Koj IDE
Kuaj Koj IDE

Txhawm rau sim yog tias txhua yam mus tau zoo, pib codeblocks, nyem "tsim ib qhov haujlwm tshiab", xaiv "console application", xaiv ib qho c lossis c ++, ntaus lub npe ntawm qhov project checkout, khaws qhov ua tsis raug hauv lub qhov rai tom ntej thiab nyem "ua tiav" ".

Kauj Ruam 5: Xeem Xeem

Xeem Xeem
Xeem Xeem

Tom qab ntawd nyem rau daim duab peb sab ntsuab ntawm lub vaj huam sib luag sab saum toj ntawm IDE lossis siv Tsim-> Khiav cov ntawv qhia zaub mov. Yog tias txhua yam mus zoo Koj yuav tsum pom cov lus los ntawm Koj qhov kev tsim kho tshiab "Nyob zoo ntiaj teb" daim ntawv thov nyob rau hauv lub qhov rai dub "DOS".

Yog tias tsis yog, nws txhais tau tias IDE thiab tus neeg sau ntawv ua haujlwm tsis raug thiab koj yuav tsum tshuaj xyuas seb yuav teeb tsa nws li cas. Tej zaum Koj yuav tau rub lwm qhov version ntawm cov cuab yeej programming lossis txhawm rau txheeb xyuas lawv qhov kev tso cai hauv Koj li firewall/antivirus software.

Kauj Ruam 6: Tsim Txoj Haujlwm Tshiab

Tsim Txoj Haujlwm Tshiab
Tsim Txoj Haujlwm Tshiab
Tsim Txoj Haujlwm Tshiab
Tsim Txoj Haujlwm Tshiab
Tsim Txoj Haujlwm Tshiab
Tsim Txoj Haujlwm Tshiab
Tsim Txoj Haujlwm Tshiab
Tsim Txoj Haujlwm Tshiab

Tam sim no Koj yuav tsum muaj C/C ++ programmer cov cuab yeej ua haujlwm thiab tsis tau muab lub hnub ci-cov cuab yeej siv qhov chaws hauv c: / sunxitools / nplaub tshev ntawm koj lub computer. Nws yog lub sijhawm los sib sau ua ib qhov haujlwm. Tsim txoj haujlwm tshiab hauv Koj li IDE. Xaiv qhov yooj yim C (tsis yog c ++) txoj haujlwm ntawm "daim ntawv thov console" hom.

Nco ntsoov tias Koj tab tom tsim txoj haujlwm hauv c: / sunxitools / nplaub tshev thiab tsis nyob hauv qee qhov chaw. (EG codeblocks zoo li ua subfolder nrog tib lub npe raws li txoj haujlwm muaj. Yog li yog tias koj tau npe koj li haujlwm, hais "sim", thiab sim muab nws tso rau hauv c: / sunxitools \, Koj yuav xaus nrog txoj haujlwm ploj mus rau c: / sunxitools / test / yog tias koj tsis ua tib zoo txaus.) Sunxi-cov cuab yeej muaj ntau yam khoom siv, tab sis rau peb lub hom phiaj peb yuav xav tau ib qho xwb: qhov hu ua "fexc" cov khoom siv.

Kauj Ruam 7: Ntxiv Cov Ntaub Ntawv rau Txoj Haujlwm

Ntxiv Cov Ntaub Ntawv rau Txoj Haujlwm
Ntxiv Cov Ntaub Ntawv rau Txoj Haujlwm

Qhov tseeb "fexc" lub luag haujlwm yog lub luag haujlwm rau kev hloov pauv ntawm script.bin rau hauv cov ntawv nyeem thiab rau kev hloov pauv rov qab rau hauv binary. Nws yog qhov tseem ceeb uas ua tiav ntawm cov cuab yeej siv no muaj lub npe "fexc.exe", yog li nws zoo yog tias koj tau teev koj li haujlwm li "fexc". Txawm li cas los xij Koj tuaj yeem siv lwm lub npe ntawm txoj haujlwm, txij li koj ib txwm tuaj yeem hloov lub npe ua haujlwm tom qab muab tso ua ke, lossis ib qho Koj tuaj yeem xaiv "Project-> Properties" los ntawm cov ntawv qhia zaub mov sab saum toj sab saum toj thiab hauv lub qhov rai uas qhib nyem "Tsim lub hom phiaj" tab, thiab kho qhov "Output filename" teb rau ntawd txhawm rau hla lub npe ua haujlwm.

Rau Koj txoj haujlwm tsim kho koj tus kheej yuav tsum ntxiv tsib qhov ntaub ntawv:

  • fexc.c ib
  • tsab ntawv.c
  • script_bin.c
  • script_fex.c
  • script_uboot.c

thiab xya header files:

  • list.h (txav nws daim ntawv c: / sunxitools / suav nrog / nplaub tshev rau c: / sunxitools / nplaub tshev)
  • fexc.h
  • tsab ntawv.h
  • script_bin.h
  • script_fex.h
  • script_uboot.h
  • version.h tau

Nco ntsoov cais cov autogenerated main.c los ntawm txoj haujlwm, vim tias fexc.c twb muaj qhov "int main" muaj nuj nqi hauv nws. (Nco ntsoov tias ib qho haujlwm twg yuav tsum muaj ib qho haujlwm tseem ceeb xwb?).

Txhua qhov tsim nyog cov ntaub ntawv cov ntaub ntawv twb muaj nyob hauv subfolder, qhov twg koj tau unpacked qhov chaws rau. Cov ntaub ntawv header tsim nyog muaj ob lo lus, qhov twg tau txais lawv. "list.h" - feem ntau yog nyob rau hauv "suav nrog" subfolder ntawm unpacked sourcecodes teeb tsa. "version.h" - tsuas yog tsim nws koj tus kheej. Muab ib txoj hlua zoo li:

#define VERSION "Win32"

Tom qab ntawd txuag thiab kaw cov ntawv. (Koj tuaj yeem kho nws nrog #txhais thiab #ifdef yog koj xav tau.)

Yog tias koj tam sim no sim sau cov phiaj xwm nws yuav yws txog ntau qhov yuam kev thiab ib daim ntawv ploj lawm. Qhov ua yuam kev feem ntau yog vim me ntsis ntawm txoj kev ywj pheej ntau dhau, sunxi-cov cuab yeej programmers siv los thov, thiab cov ntaub ntawv ploj yog qhov vam khom tsis suav nrog hauv pob ntawm qhov chaws. Cia daws nrog cov kauj ruam no ib kauj ruam.

Kauj Ruam 8: Muaj Gcc Ua Raws Xyoo 1999 ISO C Language Standard

Muaj Gcc Ua Raws Xyoo 1999 ISO C Language Standard
Muaj Gcc Ua Raws Xyoo 1999 ISO C Language Standard

Txhawm rau tus neeg sau ntawv tsis yws qhov ua haujlwm pub dawb dhau los teeb tsa "с99" tus qauv ntawm kev suav sau. Hauv codeblocks mus rau "Project -> Build Options" ntawv qhia zaub mov thiab hauv "Compiler Settings -> Compiler Flags" kos rau "Muaj gcc ua raws li 1999 ISO C lus txheem" checkbox. Los yog Koj tsuas tuaj yeem ntxiv "-std = c99" rau hauv Koj li kev xaiv cov kab ntawv. Tam sim no yog tias koj sim suav qhov project cov tons ntawm qhov ua yuam kev yuav tsum tau tshwm sim thiab Koj yog ib tus rau ib qho uas tsis muaj kev vam khom.

Kauj Ruam 9: Nrhiav Qhov Tsis Txaus Siab

Nrhiav Qhov Tsis Txaus Siab
Nrhiav Qhov Tsis Txaus Siab

Qhov kev vam khom uas ploj lawm yog "mman.h" cov ntaub ntawv - lub taub hau ntawm qee yam ntawm linux nco tus thawj tswj hwm. Windows C ib txwm muaj tsis muaj cov ntaub ntawv zoo li, tab sis hmoov zoo muaj lub qhov rooj qhov rai ntawm nws. Mus rau https://github.com/witwall/mman-win32 rau windows. Rub lub snapshot ntawm git repository.

Kauj ruam 10: Unpack tus txiv neej

Unpack tus txiv neej
Unpack tus txiv neej

Unpack cov ntaub ntawv mman.c thiab mman.h, muab tso rau hauv c: / sunxitools / nplaub tshev.

Kauj ruam 11: Thiab Ntxiv Lawv rau Txoj Haujlwm

Thiab Ntxiv Lawv rau Txoj Haujlwm
Thiab Ntxiv Lawv rau Txoj Haujlwm

Kauj Ruam 12: Txoj Kev Ncaj Ncees

Txoj Kev Yog
Txoj Kev Yog

Thiab hauv cov ntawv "fex.c" raplece kab:

#suav nrog

rau

#suav nrog "mman.h"

Ntawm theem no Koj tus neeg sau yuav tsum tsis txhob yws dab tsi thiab Koj yuav tau txais tos ntev fexc.exe raws li qhov tso tawm. Tsis txhob zoo siab thaum ntxov. Kev siv hluav taws xob tseem tsis ua haujlwm zoo. Koj tuaj yeem ua qhov no los ntawm kev txiav txim siab qee qhov siv tau script.bin rau hauv daim ntawv - tsab ntawv script.fex nrog qhov tsim nyog encrypting script.fex cov ntaub ntawv rov qab rau hauv script.bin. Koj tuaj yeem sau tseg tias qhov loj ntawm qhov tshwm sim script.bin txawv me ntsis los ntawm qhov loj ntawm thawj tsab ntawv.bin. Thiab yog tias koj sim decrypt qhov tshwm sim ib zaug ntxiv nws yuav ua tsis tiav. Tsis yog Orange PI yuav ua haujlwm nrog tsab ntawv no.bin. Txhawm rau kom tau txais txiaj ntsig zoo peb yuav tsum tso lub foob pob, uas ib tus neeg tau muab tso rau hauv sunxi-cov cuab yeej siv qhov chaws. Nws yuav yog peb cov kauj ruam tom ntej.

Kauj Ruam 13: Exorcism

Exorcism
Exorcism

Txhawm rau tso tawm cov foob pob qhib lub fexc.c code cov ntaub ntawv thiab pom muaj kab ntawv ntawm cov ntsiab lus tom ntej:

lwm tus yog ((tawm = qhib (filename, O_WRONLY | O_CREAT | O_TRUNC, 0666)) <0) {

Tsuas yog hloov nws nrog txoj hlua tom ntej:

lwm tus yog ((tawm = qhib (filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 512)) <0) {

Yog tias tsis yog tus lej phem "666" hauv thawj kab kuv xav tias tus coder nyuam qhuav hnov qab siv tus chij O_BINARY. Tab sis Tus Naj Npawb Ntawm Beast qhia meej txog nws lub hom phiaj kom pom tseeb. Mus rau daim duab, nws txawj ntse npaum li cas: vim qhov sib txawv me me hauv yuav ua li cas cov ntaub ntawv tau ua tiav hauv Windows thiab Linux lub foob pob tsis muaj txiaj ntsig thaum lub tuam txhab tau muab tso ua ke thiab siv nyob hauv Linux. Tab sis nws rhuav tshem txhua yam thaum lub cuab yeej siv nyob hauv Windows.

Tom qab lub foob pob tau raug tshem riam phom, Thaum kawg koj tuaj yeem suav thiab siv kev nyab xeeb fexc ntawm koj lub khoos phis tawj Windows.

Kauj Ruam 14: NCO TSEG

CEEB TOOM
CEEB TOOM

1) Txhawm rau siv fexc cov khoom siv yooj yim, Koj yuav tsum tau txais ob daim ntawv ua ke:

bin2fex.bat - thiab - fex2bin.bat.

Koj tuaj yeem tau txais lawv los ntawm qee qhov faily fexc.exe tsim rau Windows nyob ntawd, lossis koj tuaj yeem ntaus lawv koj tus kheej:

  • bin2fex.bat yuav tsum muaj "fexc -I bin -O fex script.bin script.fex"
  • fex2bin.bat yuav tsum muaj "fexc -O bin -I fex script.fex script.bin"

2) Yog tias nws nyuaj nrhiav tus thawj tswj hwm rau Windows ib tus tuaj yeem zam nws qhov kev siv txhua. Txawm li cas los xij nws yuav siv ntau qhov kev hloov kho ntawm fexc.c cov ntaub ntawv thiab xav tau tsawg kawg qee qhov kev paub ntawm c. Rau Koj qhov kev ntseeg siab kuv qhia qhov kho qhov chaws ntawm fexc los ntawm sunxi-cov cuab yeej v1.4 pub dawb los ntawm kev vam khom rau mman.h nrog rau codeblocks project file thiab nrog piv txwv script.bin los ntawm qee cov txiv kab ntxwv pi. Koj tuaj yeem rub tawm fexc_nomman.zip

3) Nws muaj peev xwm hais tias hauv cov txiaj ntsig ntawm sunxi-cov cuab yeej lawv yuav ntxiv qee qhov kev vam khom ntau dua. Xav tias dawb los nrhiav lawv hauv is taws nem thiab ntxiv lawv rau Koj Txoj Haujlwm muab tso ua ke.

5) Thaum kawg ntawm no yog qhov precompiled version of fexc.exe rau Win32:

fexc_nomman.zip

Yog tias koj tub nkeeg txaus xav siv ver. Txawm li cas los ceev faj tias nws yuav tsis hloov kho tshiab yog tias/thaum qhov hloov tshiab ntawm SunxiTools/Windows yuav muaj. Yog li nws zoo dua los kawm yuav ua li cas sau lawv dua li vam khom qee qhov kev tsim kho binary, Kuv xav tias.

4) "Orange PI", "Code:: Blocks", "Windows", "Linux", "Sunxi-Tools", "Allwinner", thiab lwm yam … yog cov cim lag luam ntawm lawv tus tswv.

5) Yog tias koj tus neeg sau ntawv yws yws txog qhov tsis pom mman ua haujlwm, xws li:

undefined siv rau '_imp_mmap'

yuav tsum paub tias txhais cov neeg nyiam ntawm mman kev txhim kho zej zog tau hnov qab tias cov lej tuaj yeem suav ua ke tsis yog raws li lub tsev qiv ntawv dll. Nws kuj tseem tuaj yeem yog tsev qiv ntawv zoo li qub lossis ib tus lej ib leeg zoo li peb muaj ntawm no. Txhawm rau kho qhov teeb meem hloov "mman.h" cov ntaub ntawv raws li hauv qab no:

a) nrhiav cov hlua:

#if txhais (MMAN_LIBRARY)

#define MMANSHARED_EXPORT _declspec (dllexport) #else #define MMANSHARED_EXPORT _declspec (dllimport) #endif

b) ntxiv txoj hlua

#define MMANSHARED_EXPORT

tsuas yog hauv qab cov hlua pom ntawm cov kauj ruam dhau los

Pom zoo: