Iyo yechinomwe vhezheni yezvigamba zveRust mutyairi rutsigiro paLinux yakaburitswa

Mazuva mashoma apfuura, Miguel Ojeda, inotarisira kusimudzira uye kuendesa zvikumbiro izvi uye munyori weiyo Rust-for-Linu chirongwax akafumura chirevo chechikamu chechinomwe yekuvandudza mutyairi wemudziyo ngura yeLinux kernel vanogadzira kufunga.

Iyi ndiyo yechinomwe edition yezvigamba uye kune iyo kunyange Rust tsigiro inoonekwa seyekuyedza, asi yakatoverengerwa mulinux-rinotevera bazi uye yakakura zvakakwana kuti itange kushanda pakugadzira abstraction layers pamusoro pekernel subsystems, pamwe nekunyora controllers uye modules. Kuvandudzwa uku kunotsigirwa neGoogle neISRG (Internet Security Research Group), inova muvambi weLet Encrypt project uye inosimudzira HTTPS nekuvandudzwa kwetekinoroji yekuwedzera kuchengetedzeka kweInternet.

Idzo shanduko dzakarongwa dzinoita kuti zvikwanise kushandisa Rust semutauro wechipiri wekugadzira vatyairi uye kernel module. Rutsigiro rutsigiro runounzwa sechisarudzo chisingagoneswe nekukasira uye hachikonzereri kuti Rust ibatanidzwe pakati pezvinodiwa zvekuvaka kernel. Kushandisa Rust kugadzira madhiraivha kuchakubvumidza kuti ugadzire madhiraivha ari nani uye akachengeteka nekuedza kushoma, pasina matambudziko sekuwana nzvimbo yendangariro mushure mekuisunungura, dereference null pointers, uye buffer mafashama.

Main novelties muchinomwe chirevo

Chikumbiro chitsva ichi chinosimbisa izvozvo the toolkit uye musiyano wealloc library, iyo yakabvisa chizvarwa chinogona kuitika che "kutya" mamiriro pamusoro pezvikanganiso, yakagadziridzwa kushanduro Rust 1.60 uye kuti nokudaro inodzikamisa rutsigiro rwe "may_uninit_extra" modhi inoshandiswa muma kernel patches.

Mukuwedzera kune izvi, zvinoonekwa kuti yakawedzera kugona kumhanyisa bvunzo kubva muzvinyorwa (bvunzo dzinoshandiswa panguva imwe chete semienzaniso muzvinyorwa), nekushandura compile-nguva bvunzo dzakasungwa kukernel API kuita KUnit bvunzo dzinomhanya panguva yekernel boot. Iyo bvunzo inodiwa kuti isaburitse Clippy linter yambiro, sezvakaita musimboti Rust kodhi.

Pane rimwe divi kutanga kuita kwe "net" module ine network mabasa inokurudzirwa. Rust kodhi inopa mukana kune kernel network zvimiro zvakaita se "Namespace" (zvichienderana ne "struct net" kernel chimiro), SkBuff (struct sk_buff), TcpListener, TcpStream (struct socket), Ipv4Addr (struct in_addr), SocketAddrV4 (struct sockadd_in) uye yayo IPv6 yakaenzana.

kumucheto kumashure rustc_codegen_gcc, yaita kugona kutanga iyo rustc compiler. Compiler commissioning inoreva kukwanisa kwerustc kushandisa GCC-based code generator kuvaka rustc compiler.

Zvakare, iyo ichangobva kubuda yeGCC 12.1 inosanganisira zvigadziriso kune libgccjit izvo zvinodiwa kuti rustc_codegen_gcc ishande nemazvo. Gadziriro dziri kuitika kupa kugona kuisa rustc_codegen_gcc uchishandisa rustup utility.

Of the dzimwe shanduko dzinomira pachena yeiyi vhezheni itsva:

  • Yekutanga tsigiro yakashandiswa kune asynchronous programming nzira (async), inoshandiswa muchimiro chekasync module.
  • Yakawedzerwa mambure ::sefa module yekushandisa network packet mafirita. Yakawedzerwa muenzaniso rust_netfilter.rs ine kusefa kwekushandisa muRust mutauro.
  • Yakawedzera kuisirwa kweyakapusa mutex smutex::Mutex isingade pinning.
  • Yakawedzera kiyi yeNoWaitLock isingamirire kuburitswa, uye kana yakagarwa neimwe shinda, inotadza kuyedza kutora kiyi panzvimbo yekumisa munhu anofona.
  • Yakawedzera kiyi yeRawSpinLock, yakaonekwa neraw_spinlock_t mukernel, inoshanda kune zvikamu zvisingaite.
  • Yakawedzerwa ARef mhando yezvinyorwa zvinongedzo kune iyo nzira yekuverengera inoshandiswa (inorambwa nguva dzose).
  • Kufambira mberi kunoonekwa mukuvandudzwa kweGCC's gccrs frontend nekushandiswa kweRust mutauro compiler yakavakirwa paGCC. Parizvino kune vaviri vanogadzira nguva yakazara vanoshanda pagccrs.

Finalmente Kana iwe uchifarira kuziva zvakawanda nezvazvo, unogona kutarisa ruzivo mu chinotevera chinongedzo.


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

Iva wekutanga kutaura

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