🔔 با توجه به بهبود نسبی اینترنت، آمادهسازی دورهها آغاز شده است. به دلیل تداوم برخی اختلالات، بارگذاری دورهها ممکن است با کمی تأخیر انجام شود. مدت اشتراکهای تهیهشده محفوظ است.
لطفا جهت اطلاع از آخرین دوره ها و اخبار سایت در
کانال تلگرام
عضو شوید.
آموزش وقفه ها و نیمه پایینی ها در هسته لینوکس
- آخرین آپدیت
دانلود Interrupts and Bottom Halves in Linux Kernel
نکته:
ممکن هست محتوای این صفحه بروز نباشد ولی دانلود دوره آخرین آپدیت می باشد.
پیش نیاز: آشنایی با نوشتن، کامپایل، بارگذاری و تخلیه ماژولهای Hello World کرنل لینوکس
آنچه در این دوره خواهید آموخت:
در این دوره جامع برنامهنویسی کرنل لینوکس، به بررسی عمیق وقفه ها (Interrupts) و نیمه پایینی (Bottom Halves) میپردازیم. این مفاهیم اساسی برای درک نحوه عملکرد سیستمعامل لینوکس و توسعه درایورها ضروری هستند.
وقفه ها و استثناها
انواع وقفه ها و استثناها: Level Triggerred, Edge Triggerred, Traps, Faults
کنترلر وقفه برنامه پذیر، کنترلر وقفه برنامه پذیر پیشرفته (APIC) - IO APIC, Local APIC
یافتن اطلاعات در مورد CPU x86 خود با استفاده از دستورالعمل CPUID
چه اتفاقی می افتد وقتی که وقفه رخ می دهد
چگونه CPU هندلر وقفه را پیدا می کند: درخواست وقفه، بردار وقفه و جدول توصیفگر وقفه
مدیریت وقفه و آمار در کرنل لینوکس: اشتراک گذاری وقفه، مقادیر بازگشتی، IRQ Affinity
درایور لینوکس برای وقفه های صفحه کلید، ماوس، اترنت
نوشتن یک Keylogger در کرنل لینوکس که تمام کاراکترهای تایپ شده را ثبت می کند
فعال / غیرفعال کردن وقفه ها
چه اتفاقی می افتد وقتی که خواب و تأخیر را در هندلر وقفه اضافه می کنیم
نیمه بالایی و پایینی: Threaded IRQs، Softirqs، Tasklets و Workqueues (System Workqueues و workqueues خود)
تفاوت بین softirqs، tasklets و workqueues
فایلهای مهم:
/proc/cpuinfo
/proc/interrupts
/proc/irq
/proc/softirqs
API ها، ماکروها و ساختارها:
در این دوره با APIها، ماکروها و ساختارهای کلیدی مرتبط با مدیریت وقفه ها و نیمه پایینی در کرنل لینوکس آشنا خواهید شد.
What happens when we pass NULL as last argument in case of shared irq-ویدیو-3-7-وقتی NULL را به عنوان آخرین آرگومان در مورد irq اشتراکی ارسال میکنیم چه اتفاقی میافتد
What happens when we pass NULL as last argument in case of shared irq
Print irq and device identifier in irq handler-ویدیو-3-8-چاپ irq و شناسه دستگاه در کنترلکننده irq
Print irq and device identifier in irq handler
Enabling and Disabling Interrupts-فصل-4-فعال و غیرفعال کردن وقفهها
Enabling and Disabling Interrupts
Enable & Disable Interrupt-ویدیو-4-1-فعال و غیرفعال کردن وقفه
Enable & Disable Interrupt
Why do we need to disable interrupts-ویدیو-4-2-چرا باید وقفهها را غیرفعال کنیم
Why do we need to disable interrupts
Linux Kernel Module example disabling and enabling interrupts on current process-ویدیو-4-3-مثال ماژول هسته لینوکس برای غیرفعال و فعال کردن وقفهها در فرایند جاری
Linux Kernel Module example disabling and enabling interrupts on current process
Saving interrupt state before disabling interrupts-ویدیو-4-4-ذخیره وضعیت وقفه قبل از غیرفعال کردن وقفهها
Saving interrupt state before disabling interrupts
Disabling a specific interrupt line-ویدیو-4-5-غیرفعال کردن یک خط وقفه خاص
Disabling a specific interrupt line
What happens when we call disable_irq twice and enable_irq once-ویدیو-4-7-وقتی disable_irq را دو بار و enable_irq را یک بار فراخوانی میکنیم چه اتفاقی میافتد
What happens when we call disable_irq twice and enable_irq once
What happens when we disable shared interrupt line-ویدیو-4-8-وقتی خط وقفه اشتراکی را غیرفعال میکنیم چه اتفاقی میافتد
What happens when we disable shared interrupt line
Find out whether interrupts on local processor are disabled-ویدیو-4-9-مشخص کنید که آیا وقفهها روی پردازنده محلی غیرفعال شدهاند یا خیر
Find out whether interrupts on local processor are disabled
Macro to find out whether we are in interrupt context-ویدیو-4-11-ماکرو برای یافتن اینکه آیا در زمینه وقفه هستیم یا خیر
Macro to find out whether we are in interrupt context
Using in_interrupt to allocate memory-ویدیو-4-12-استفاده از in_interrupt برای تخصیص حافظه
Using in_interrupt to allocate memory
Adding a delay in interrupt handler-ویدیو-4-13-افزودن تاخیر در کنترلکننده وقفه
Adding a delay in interrupt handler
Printing call trace in interrupt handler-ویدیو-4-14-چاپ ردیابی فراخوانی در کنترلکننده وقفه
Printing call trace in interrupt handler
Can we use current macro inside interrupt handler-ویدیو-4-15-آیا میتوانیم از ماکرو current در داخل کنترلکننده وقفه استفاده کنیم
Can we use current macro inside interrupt handler
What happens when we call sleep in interrupt handler-ویدیو-4-16-وقتی sleep را در کنترلکننده وقفه فراخوانی میکنیم چه اتفاقی میافتد
What happens when we call sleep in interrupt handler
Threaded IRQs-فصل-5-IRQهای ترد شده
Threaded IRQs
Introduction-ویدیو-5-1-مقدمه
Introduction
Example of Top and bottom halves-ویدیو-5-2-مثال نیمههای بالا و پایین
Example of Top and bottom halves
Threaded IRQs-ویدیو-5-3-IRQهای ترد شده
Threaded IRQs
Example of Threaded IRQs-ویدیو-5-4-مثال IRQهای ترد شده
Example of Threaded IRQs
Kernel Module example printing context in threaded irqs-ویدیو-5-5-مثال ماژول هسته برای چاپ زمینه در irqهای ترد شده
Kernel Module example printing context in threaded irqs
IRQF_ONESHOT-ویدیو-5-6-IRQF_ONESHOT
IRQF_ONESHOT
Printing call trace in threaded irqs-ویدیو-5-7-چاپ ردیابی فراخوانی در irqهای ترد شده
Printing call trace in threaded irqs
Printing PID and process name in threaded irqs-ویدیو-5-8-چاپ PID و نام فرآیند در irqهای ترد شده
Printing PID and process name in threaded irqs
Are interrupts enabled in threaded irqs-ویدیو-5-9-آیا وقفهها در irqهای ترد شده فعال هستند
Are interrupts enabled in threaded irqs
Softirqs-فصل-6-Softirqها
Softirqs
Introduction-ویدیو-6-1-مقدمه
Introduction
Statistics of softirqs-ویدیو-6-2-آمار softirqها
Statistics of softirqs
Create a new softirq-ویدیو-6-4-ایجاد یک softirq جدید
Create a new softirq
Linux Kernel Driver Example of softirq-ویدیو-6-5-مثال درایور هسته لینوکس از softirq
Linux Kernel Driver Example of softirq
Find out the context of softirq handler-ویدیو-6-6-مشخص کردن زمینه کنترلکننده softirq
Find out the context of softirq handler
Find out whether interrupts are enabled or disabled in softirq handler-ویدیو-6-7-مشخص کنید که آیا وقفهها در کنترلکننده softirq فعال یا غیرفعال هستند
Find out whether interrupts are enabled or disabled in softirq handler
Value of current in softirq handler-ویدیو-6-8-مقدار current در کنترلکننده softirq
Value of current in softirq handler
Prints call trace in softirq handler-ویدیو-6-9-چاپ ردیابی فراخوانی در کنترلکننده softirq
Prints call trace in softirq handler
Checking processor id in interrupt and softirq handler-ویدیو-6-10-بررسی شناسه پردازنده در کنترلکننده وقفه و softirq
Checking processor id in interrupt and softirq handler
Adding a delay in softirq handler-ویدیو-6-11-افزودن تاخیر در کنترلکننده softirq
Adding a delay in softirq handler
Find out whether softirq is running in hard or soft irq context-ویدیو-6-12-مشخص کنید که آیا softirq در زمینه irq سخت یا نرم اجرا میشود
Find out whether softirq is running in hard or soft irq context
Important points related to softirq-ویدیو-6-13-نکات مهم مربوط به softirq
Important points related to softirq
ksoftirqd-ویدیو-6-14-ksoftirqd
ksoftirqd
Example of ksoftirqd-ویدیو-6-15-مثال ksoftirqd
Example of ksoftirqd
Find out pending softirqs-ویدیو-6-16-مشخص کردن softirqهای در انتظار
Find out pending softirqs
When are pending softirqs executed-ویدیو-6-17-چه زمانی softirqهای در انتظار اجرا میشوند
When are pending softirqs executed
Macro to tell whether you are running in softirq or not-ویدیو-6-18-ماکرو برای تشخیص اینکه آیا در حال اجرای softirq هستید یا خیر
Macro to tell whether you are running in softirq or not
Disabling and Enabling softirqs-ویدیو-6-19-غیرفعال و فعال کردن softirqها
Disabling and Enabling softirqs
Are interrupts enabled when we call spinlock-ویدیو-6-20-آیا وقفهها هنگام فراخوانی spinlock فعال هستند
Are interrupts enabled when we call spinlock
Locking between user context and softirqs-ویدیو-6-21-قفلگذاری بین زمینه کاربر و softirqها
Locking between user context and softirqs
Tasklets-فصل-7-تسکلتها
Tasklets
Introduction-ویدیو-7-1-مقدمه
Introduction
State and count field of tasklet-ویدیو-7-2-فیلد state و count تسکلت
State and count field of tasklet
Tasklet API-ویدیو-7-3-API تسکلت
Tasklet API
Example of using tasklet-ویدیو-7-4-مثال استفاده از تسکلت
Example of using tasklet
Example of scheduling tasklets static initialization-ویدیو-7-6-مثال زمانبندی تسکلتها مقداردهی اولیه استاتیک
Example of scheduling tasklets static initialization
Example of scheduling tasklets dynamic initialization-ویدیو-7-7-مثال زمانبندی تسکلتها مقداردهی اولیه پویا
Example of scheduling tasklets dynamic initialization
Steps performed by tasklet_schedule-ویدیو-7-8-مراحل انجام شده توسط tasklet_schedule
Steps performed by tasklet_schedule
Steps performed by tasklet softirq handlers-ویدیو-7-9-مراحل انجام شده توسط کنترلکنندههای tasklet softirq
Steps performed by tasklet softirq handlers
How kernel avoids running same tasklet on multiple processors-ویدیو-7-10-هسته چگونه از اجرای یک تسکلت مشابه بر روی چند پردازنده جلوگیری میکند
How kernel avoids running same tasklet on multiple processors
Can i sleep in tasklet handler-ویدیو-7-11-آیا میتوانم در کنترلکننده تسکلت بخوابم
Can i sleep in tasklet handler
Are interrupts enabled when tasklet runs-ویدیو-7-12-آیا وقفهها هنگام اجرای تسکلت فعال هستند
Are interrupts enabled when tasklet runs
Find out the context of tasklet handler-ویدیو-7-13-مشخص کردن زمینه کنترلکننده تسکلت
Find out the context of tasklet handler
Printing PID and process name in tasklet handler-ویدیو-7-14-چاپ PID و نام فرآیند در کنترلکننده تسکلت
Printing PID and process name in tasklet handler
Printing call trace in tasklet handler-ویدیو-7-15-چاپ ردیابی فراخوانی در کنترلکننده تسکلت
Printing call trace in tasklet handler
Find out whether tasklet is running in hard or soft irq context-ویدیو-7-16-مشخص کنید که آیا تسکلت در زمینه irq سخت یا نرم اجرا میشود
Find out whether tasklet is running in hard or soft irq context
What happens when we call tasklet_schedule twice-ویدیو-7-18-وقتی tasklet_schedule را دو بار فراخوانی میکنیم چه اتفاقی میافتد
What happens when we call tasklet_schedule twice
Checking processor id in tasklet handler and irq handler-ویدیو-7-19-بررسی شناسه پردازنده در کنترلکننده تسکلت و کنترلکننده irq
Checking processor id in tasklet handler and irq handler
Softirq vs tasklet which one will execute first-ویدیو-7-20-Softirq در مقابل tasklet کدام یک اول اجرا میشود
Softirq vs tasklet which one will execute first
Enabling and Disabling tasklets-ویدیو-7-21-فعال و غیرفعال کردن تسکلتها
Enabling and Disabling tasklets
API to queue work-ویدیو-8-4-API برای به صف کردن کار
API to queue work
API to create workqueue-ویدیو-8-5-API برای ایجاد صف کاری
API to create workqueue
What happens when we queue same work twice-ویدیو-8-6-وقتی یک کار مشابه را دو بار به صف میکنیم چه اتفاقی میافتد
What happens when we queue same work twice
Example of queue_work_on-ویدیو-8-7-مثال queue_work_on
Example of queue_work_on
Scheduling work-ویدیو-8-8-زمانبندی کار
Scheduling work
Passing private data into work function-ویدیو-8-9-ارسال دادههای خصوصی به تابع کار
Passing private data into work function
Printing PID and process name in work function-ویدیو-8-10-چاپ PID و نام فرآیند در تابع کار
Printing PID and process name in work function
Find out the context of work function-ویدیو-8-11-مشخص کردن زمینه تابع کار
Find out the context of work function
Are interrupts enabled when work function execute-ویدیو-8-12-آیا وقفهها هنگام اجرای تابع کار فعال هستند
Are interrupts enabled when work function execute
Cancelling work-ویدیو-8-13-لغو کار
Cancelling work
Adding delay in work function-ویدیو-8-14-افزودن تاخیر در تابع کار
Adding delay in work function
Scheduling two work items-ویدیو-8-15-زمانبندی دو مورد کار
Scheduling two work items
Flushing work-ویدیو-8-16-تخلیه کار
Flushing work
Delayed work-ویدیو-8-17-کار تاخیری
Delayed work
Example of delayed work-ویدیو-8-18-مثال کار تاخیری
Example of delayed work
Flushing delayed work-ویدیو-8-19-تخلیه کار تاخیری
Flushing delayed work
Cancelling delayed work-ویدیو-8-20-لغو کار تاخیری
Cancelling delayed work
Softirqs vs Tasklets vs Workqueues-ویدیو-8-21-Softirqها در مقابل تسکلتها در مقابل صفهای کاری
Softirqs vs Tasklets vs Workqueues
Own Workqueues-فصل-9-صفهای کاری شخصی
Own Workqueues
kworker-ویدیو-9-1-kworker
kworker
Dedicated workqueues API-ویدیو-9-2-API های صفهای کاری اختصاصی
Dedicated workqueues API
Queuing two workitems in workqueue with max active flags to 1-ویدیو-9-4-به صف کردن دو مورد کار در صف کاری با حداکثر پرچمهای فعال روی 1
Queuing two workitems in workqueue with max active flags to 1
Queuing two workitems in workqueue with max active flags to 2-ویدیو-9-5-به صف کردن دو مورد کار در صف کاری با حداکثر پرچمهای فعال روی 2
Queuing two workitems in workqueue with max active flags to 2
نمایش نظرات