I-Kerla: i-kernel entsha ebhalwe kwi-Rust kwaye iyahambelana ne-Linux ABI

Ulwazi malunga neprojekthi ye-Kerla ikhutshwe kutshanje, ephuhliswayo njenge-kernel yenkqubo yokusebenza ebhalwe ngolwimi lwe-Rust. Ikhowudi ihanjiswa phantsi kwe-Apache 2.0 kunye neelayisensi ze-MIT. Le projekthi iphuhliswa ngumphuhlisi waseJapan uSeiya Nuta, owaziwa ngokudala inkqubo yokusebenza ye-microkernel Resea, ebhalwe ngolwimi lweC.

I-kernel entsha ijolise ekuqaleni qinisekisa ukuhambelana neLinux kernel kwinqanaba le-ABI, eya kuvumela iibhinari ezingalungiswanga ezakhelwe iLinux ukuba ziqhube kwindawo esekwe kwi-Kerla.

Malunga neKeral

I-Kerla yi-monolithic yokusebenza kwe-kernel yenziwe ukusuka ekuqaleni kwiRust. Kwinqanaba langoku lophuhliso, uKerla ingaqhutywa kuphela kwiinkqubo ezine-x86_64 uyilo kwaye iphumeze iminxeba yenkqubo esisiseko njengokubhala, stat, mmap, umbhobho, kunye ne-poll, ixhasa imiqondiso, imibhobho engachazwanga magama, kunye nokutshintsha umxholo. Iifowuni ezifana nefolokhwe, wait4 kunye ne-execve zibonelela ngokulawula iinkqubo. Kukho inkxaso ye-tty kunye ne-pseudo-terminals (pty). Phakathi kweendlela zefayile ze initramfs (ezisetyenziselwa ukunyusa ingcambu yeFS), iitmpfs kunye nedevfs zisaxhaswa.

I-stack yenethiwekhi enenkxaso ye-TCP kunye ne-UDP sockets nayo ibonelelwe, esekwe kwilayibrari ye-smoltcp. Umphuhlisi ulungiselele imeko-bume ye-boot esebenza kwi-QEMU okanye kwi-Firecracker VM kunye nomlawuli we-virtio-net, onokuthi udibanise kuyo nge-SSH.. I-Musl isetyenziswa njengethala leencwadi lenkqubo kwaye iBusyBox isetyenziswa njengesixhobo somsebenzisi. Ngokusekwe kwiDocker, inkqubo yokwakha ilungisiwe ekuvumela ukuba wenze eyakho i-initramfs yokuqalisa ngeKerla kernel.

Ukuza kuthi ga ngoku, zimbalwa iinkcukacha ezinikezelweyo malunga ne-kernel yayo entsha, kodwa eyona nto itsala ingqalelo kakhulu kwiimpawu zeKerla kukuba ibhalwe kwiRust. Ke ngaba ukuyibhala ngeRust kunazo naziphi na izibonelelo ngaphezu kwezinye iilwimi okanye ngaphezulu kwekhowudi esele ikhona? Abaninzi baphendule ewe kulo mbuzo, begxininisa kwiinzuzo zokhuseleko lwememori olunikezwa lulwimi.

Ikwabonelelwa xa kuvavanywa ukuchaneka kofikelelo lwememori ngexesha lokuqhuba. Yintoni egqithisile, iMozilla ikholelwa ukuba iRust inika ukhuseleko ekuphuphumeni okupheleleyo, ifuna ukuqaliswa okusisinyanzelo kwamaxabiso aguquguqukayo phambi kokusetyenziswa, yamkele ingqikelelo yezalathisi kunye noguquguquko olungaguqukiyo ngokungagqibekanga, ibonelela ngochwethezo olomeleleyo ukuze kuncitshiswe iimpazamo ezibhadlileyo, kwaye yenze lula inkqubo yokufaka ngokuthelekisa iipateni.

Phakathi kweenzuzo, sigxininisa izixhobo ezidibeneyo zokuvavanya umgangatho wekhowudi kunye nokudala iimvavanyo zeyunithi ezingaqhutywa kuphela kwi-hardware yangempela, kodwa nakwi-QEMU. Ngokusisiseko, iMozilla ifumana iRust kulula ukuyilungisa, njengoko umqambi uya kwala iimpazamo. Nangona kunjalo, ii-cove zalatha kwezinye iingxaki kunye neRust.

“Njengakwi-C ++, phantse akunakwenzeka ukuba ubhale i-idiomatic Rust ngaphandle kokusebenzisa iitemplates, ngenxa yoko iye yaqhuma iibhinari kunye namaxesha okuqokelela acothayo. Konke oku kuhlolwa kwexesha lokuqokelela nako kuza ngexabiso. Kwakhona, ukuba ubhala kwakhona into ethile, ulahlekelwa yi-codebase endala, kwaye akukho ndlela yokuvelisa i-codebase yomgangatho ofanayo ngexesha elifanelekileyo; kungcono kakhulu ukwandisa, kunokuba ubhale kwakhona, inkqubo kwi-Rust. Kungcono ukwandisa inkqubo kunokuphinda uyibhale eRust, ”utsho injineli yesoftware.

Ngokomdali wayo, kungenxa yesi sizathu ukuba abaphuhlisi beLinux, ngakumbi uLinus Torvalds ngokwakhe, bawukhabile umbono wokubhala kwakhona yonke i-kernel eRust.

"Yenza umsebenzi othile ukwenza amakhonkco akhuselekileyo, emva koko ubhale ikhowudi eyongezelelweyo kwiRust kwaye usenokonwabela le khowudi evuthiweyo. (Yiloo nto eyenziwa nguLinux, kukho iinzame zokongeza amandla okubhala imodyuli ye-kernel kwiRust), ”wongeze watsho. Abaphuhlisi beLinux bebephonononga okunokwenzeka kokubhala iimodyuli ezithile zekernel ezintsha besebenzisa ulwimi lweRust malunga neminyaka emithathu. Oku kubangele iprojekthi ye-"Rust for Linux".

Okokugqibela, ukuba unomdla wokwazi okungakumbi ngayo, unokujonga iinkcukacha Kule khonkco ilandelayo.


Umxholo wenqaku uyabambelela kwimigaqo yethu imigaqo yokuziphatha yokuhlela. Ukuxela impazamo cofa apha.

Yiba ngowokuqala ukuphawula

Shiya uluvo lwakho

Idilesi yakho ye email aziyi kupapashwa.

*

*

  1. Uxanduva lwedatha: UMiguel Ángel Gatón
  2. Injongo yedatha: Ulawulo lwe-SPAM, ulawulo lwezimvo.
  3. Umthetho: Imvume yakho
  4. Unxibelelwano lwedatha: Idatha ayizukuhanjiswa kubantu besithathu ngaphandle koxanduva lomthetho.
  5. Ukugcinwa kweenkcukacha
  6. Amalungelo: Ngalo naliphi na ixesha unganciphisa, uphinde uphinde ucime ulwazi lwakho.