Kubalulekile ukuqaphela ukuthi ukuhlela kwe-kernel kwehluka kakhulu kuhlelo lomsebenzisi. I-kernel iyibhizinisi elizimele, elingakwazi ukusebenzisa mitapo yolwazi yendawo yomsebenzisi, ngisho ne-libc ku-Linux noma i-kernel32.dll ivuliwe Windows. Ngenxa yalokho, imisebenzi evamile esetshenziswa endaweni yomsebenzisi (printf, malloc, free, open, read, write, memcpy, strcpy, njll.) ngeke isakwazi ukusetshenziswa.
Sengiphetha, uhlelo lwe-kernel lusekelwe ku-API entsha futhi ezimele engahlobene ne-API ku-userspace, noma ngabe sibhekisela ku-POSIX , Win32 noma ANSI C. Umehluko obalulekile ohlelweni lwe-kernel ukuthi ungafinyelela kanjani kuyo. kanye nokwabiwa kwenkumbulo. Ngenxa yokuthi uhlelo lwe-kernel lwenziwa ezingeni eliseduze kakhulu nomshini ophathekayo, kunemithetho ebalulekile mayelana nokuphathwa kwenkumbulo.
Okokuqala, isebenza ngezinhlobo ezimbalwa zenkumbulo:
– inkumbulo engokoqobo
– inkumbulo ebonakalayo esikhaleni sekheli le-kernel
– inkumbulo ebonakalayo evela esikhaleni sekheli senqubo
– inkumbulo yomhlali - sazi ngokuqinisekile ukuthi amakhasi afinyelelwe akhona kumemori ebonakalayo
I-virtual memory esikhaleni sekheli senqubo ayikwazi ukubhekwa njengehlala ngenxa yezindlela zememori ezisetshenziswa uhlelo lokusebenza: amakhasi kungenzeka ukuthi ashintshiwe, noma angahle angabi khona. kunkumbulo engokomzimba njengomphumela wesicelo sokupheja indlela.
Inkumbulo esikhaleni sekheli le-kernel ingase ibe isakhamuzi noma ingabi isakhamuzi. Kokubili amasegimenti edatha kanye nekhodi yemojuli kanye nesitaki se-kernel senqubo kuhlala.
Inkumbulo enamandla ingahlala noma ingabi khona, kuye ngokuthi yabiwe kanjani. Lapho usebenza ngememori ehlala, izinto zilula: inkumbulo ingafinyelelwa nganoma yisiphi isikhathi. Kodwa-ke, uma usebenza ngememori okungeyona indawo yokuhlala, lapho-ke ingafinyelelwa ezimweni ezithile kuphela.
Inkumbulo okungeyona indawo yokuhlala ingafinyelelwa kuphela kungqikithi yenqubo. Ukufinyelela inkumbulo okungeyona indawo yokuhlala kusuka kumongo wokuphazamiseka kunemiphumela engalindelekile, ngakho-ke, lapho isistimu yokusebenza ithola lokho kufinyelela, izothatha izinyathelo ezinqala: ukuvimba noma ukusetha kabusha isistimu, ukuvimbela ukonakala okukhulu.
I-memori ebonakalayo yenqubo ayikwazi ukufinyelelwa ngokuqondile kusuka ku-kernel. Ngokuvamile, akukhuthazwa ngokuphelele ukufinyelela indawo yekheli lenqubo, kodwa kunezimo lapho umshayeli wedivayisi kufanele akwenze khona. Isimo esijwayelekile yilapho umshayeli wedivayisi kufanele afinyelele isigcinalwazi esivela endaweni yomsebenzisi. Kulokhu, umshayeli wedivayisi kufanele asebenzise imisebenzi ekhethekile futhi angafinyeleli ku-buffer ngokuqondile. Lokhu kuyadingeka ukuze uvimbele ukufinyelela ezindaweni zememori ezingavumelekile.
Omunye umehluko kusukela ekuhleleni ku-userspace, okuhlobene nokusebenza ngenkumbulo, ungenxa yesitaki, isitaki saso usayizi waso olungisiwe futhi unomkhawulo. Ku-Linux kernel, isitaki se-4K sisetshenziswa ngokuzenzakalelayo, futhi ku-Windows, isitaki esingu-12K siyasetshenziswa. Ngalesi sizathu, ukunikezwa kwezakhiwo ezinkulu kusitaki noma ukusetshenziswa kwezingcingo eziphindaphindwayo kufanele kugwenywe.
Mayelana nemodi yokusebenzisa ku-kernel, sihlukanisa okuqukethwe okubili: inqubo yokuqukethwe nokuphazamisa umongo. Sikumongo wenqubo lapho sisebenzisa ikhodi silandela ikholi yesistimu noma lapho sisebenza kumongo wochungechunge lwe-kernel. Uma sisebenza ohlelweni lokubhekana nekhefu noma isenzo esihlehlisiwe, sisebenza esimweni sekhefu.
Esinye sezici ezibaluleke kakhulu zohlelo lwe-kernel ukuhambisana. Zombili i-Linux ne-Windows zisekela izinhlelo ze-SMP ezinamaphrosesa amaningi, kodwa futhi i-kernel isekela ngokuzenzakalelayo amaphrosesa amaningi. Lokhu kwenza uhlelo lwe-kernel lube nzima kakhulu ngoba ukufinyelela kokuguquguqukayo komhlaba wonke kumele kuvumelaniswe ne-spinlock noma i-blocking primitives.
Kokubili i-Linux ne-Windows zisebenzisa izikhwebu zangaphambi kwesikhathi. Umbono wokwenza izinto eziningi ngaphambi kwesikhathi akufanele udideke nombono we-preemptive kernel. Umqondo wokwenza imisebenzi eminingi ngaphambi kokunye ubhekisele eqinisweni lokuthi isistimu yokusebenza iphazamisa ukusebenza kwenqubo ngendlela ephoqelelwe, lapho isiphelelwe yisikhathi futhi isebenza endaweni yomsebenzisi, ukuze iqhube enye inqubo.
Ngokwenza izinhlelo ohlelweni I-Linux kernel, ingqungquthela esetshenziselwa ukubiza imisebenzi ukukhombisa impumelelo iyafana naleyo ekuhlelo lwe-UNIX: 0 ukuze uphumelele, noma inani elingaphandle kuka-0 ukwehluleka.