Chimiro muRust chinogona kuitwa muKernel kusimudzira madhiraivha

Ngura Linux Kernel

Josh Triplett, kambani yeIntel-based uye nhengo yedare redziviriro reCrate.io, akatotaridza boka rinoshanda mazuva mashoma apfuura mukutaura kwake kuO Open Source Technology Summit iyo inotarisira kuunza Rust par pamwe neC mune Linux kernel programming.

Muboka rinoshanda, riri munzira yekugadzirwa, Vagadziri veRust, pamwe chete neinjiniya dzeIntel, vachagadzirira zvirevo iyo inogona kujekesa mashandiro ayo Rust inoda kuitisa pakuronga mukati meLinux kernel. Zvirongwa zveSystem kazhinji zvinoda manyorerwo epasi-pasi, akadai sekupa rairosi processor mirayiridzo uye kuwana ruzivo rwakadzama nezve mamiriro epurosesa.

Pamafaniro akafanana atove kugadzirirwa Rust, tsigiro yezvivakwa zvisina zita inotsigirwa, mibatanidzwa (mubatanidzwa), assembler insert (iyo "asm!" macro), uye iyo BFLOAT16 inoyerera nhamba yenhamba fomati.

Josh anotenda kuti ramangwana rehurongwa hwekuronga ririmo neRust, uye mutauro weC mune zvazvino uno unoti inzvimbo yaAssembler munguva yakapfuura. Ngura haisi kungorerutsira vanogadzira mamwe matambudziko eC mitauro anomuka nekuda kwebasa repasi-nhepfenyuro neyekuyeuka, asi zvakare inopa kushanda mukuvandudzwa kwemazuvano epurogiramu maparadigms.

Panguva yekukurukurirana kwekutaura kwaJosh, pfungwa iyi yakaratidzwa kune:

wedzera kugona kukudziridza madhiraivha emitauro yeRust kuLinux kernel, iyo inobvumidza nekuedza kushoma kugadzira vatyairi vari nani uye vakachengeteka avo vanorerutsa matambudziko sekuwana nzvimbo yekuyeuka mushure mekusunungura, kutaurisa null pointer, uye kubuda zvimwe zvinopfuura miganho. yeiyo buffer.

Greg Kroah-Hartman, basa rekuchengetedza bazi rakagadzikana reLinux kernel, uyex yakaratidza kuda kuwedzera Rust driver driver kune iyo kernel kana iine chero chaicho chakanakira pamusoro peC, semuenzaniso, ichapa zvisungo zvakachengetedzeka pamusoro peiyo yepamoyo API. Zvakare, Greg anoona fomati iyi senge chisarudzo chisinga shande nekumisikidza, kuti isasanganise Rust muhuwandu hweyekutanga gungano kutsamira.

Zvakazoitika kuti zvikwata zvinoverengeka zviri kutoshanda mune ino nzira. Semuenzaniso, Hove mune yeBarrel vagadziri vakagadzira chishandiso chekunyora rinotakurika ma module eLinux kernel mumutauro weRust, vachishandisa seti yemabhureki pamusoro penzvimbo dzemukati uye zvimiro zvekuwedzera kuchengetedzeka.

Matunhu epakati anogadzirwa otomatiki zvichienderana neiyo kernel musoro mafaera anowanikwa uchishandisa bhendi rekushandisa. Clang inoshandiswa kuvaka zvidimbu zvepakati. Yakaunganidzwa ma module, kuwedzera kune zvidimbu, shandisa iyo staticlib package.

Panguva imwecheteyo, imwe chirongwa chiri kuvandudzwa, chakanangana nekuvandudzwa kwevatungamiriri veakadzika midzi uye Internet yezvinhu zvishandiso, iyo zvakare inoshandisa bindgen kugadzira makorari akavakirwa pane kernel musoro mafaera.

Iyo sisitimu inokutendera iwe kuvandudza mutyairi chengetedzo pasina kuita shanduko kune iyo kernel; Panzvimbo pekugadzira mamwe mazinga ekuzviparadzanisa evatyairi mukernel, zvinokurudzirwa kuvhara nyaya padanho rekushandisa uchishandisa yakachengeteka Rust mutauro.

Izvo zvinofungidzirwa kuti vagadziri vemidziyo vanogona kukudziridza nzira iyi nekuchimbidza pasina kuongororwa kwakafanira.

Haasi ese mashandiro ehurongwa akaitwa izvozvi, asi fomati yatove yakakodzera basa uye inoshandiswa kunyora mutyairi anoshanda weanopihwa LAN9512 USB Ethernet controller pane Raspberry Pi 3 bhodhi.

Mutyairi aripo smsc95xx akanyorwa sekureva kwekushandisa kana uchinyora iyo Rust driver muC mutauro.

Izvo zvinoonekwa kuti saizi yemu module uye pamusoro pezvinhu zvekumhanya nguva hazvina kukosha kana uchigadzira mutyairi weRust, iyo inokutendera kuti ushandise chimiro chemidziyo ine zviwanikwa zvishoma.

mabviro: https://hub.packtpub.com


Izvo zviri muchinyorwa zvinoomerera pamisimboti yedu ye tsika dzekunyora. Kuti utaure chikanganiso tinya pano.

Mhinduro, siya zvako

Siya yako yekutaura

Your kero e havazobvumirwi ichibudiswa.

*

*

  1. Inotarisira data: AB Internet Networks 2008 SL
  2. Chinangwa cheiyo data: Kudzora SPAM, manejimendi manejimendi.
  3. Legitimation: Kubvuma kwako
  4. Kutaurirana kwedata
  5. Dhata yekuchengetedza: Dhatabhesi inobatwa neOccentus Networks (EU)
  6. Kodzero: Panguva ipi neipi iwe unogona kudzora, kupora uye kudzima ruzivo rwako

  1.   L1ch akadaro

    Ini handisi kuwana ruzivo rwe smsc95xx mutyairi mune sosi kana kuti chimwe chinhu chiri kuzoitwa muRust paLinux.