Add text file with explanation for each solved exercise#2
Open
maranicolae wants to merge 1 commit intomasterfrom
Open
Add text file with explanation for each solved exercise#2maranicolae wants to merge 1 commit intomasterfrom
maranicolae wants to merge 1 commit intomasterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Laboratorul 2
Exercițiul 0
Exercițiul 1
make build
make copy
make boot
Mesajele de la început se suprascriu, bufferul este limitat. De aia nu se mai vede cu dmesg mesajul "chars".
Exercițiul 2
Nu am voie să fac sleep între operațiile de spinlock lock și unlock.
Exercițiul 3
Am alocat memorie pentru ti folosind kmalloc și am inițializat câmpurile de PID și timestamp.
Am adăugat un nou header (
#include <linux/jiffies.h>) și am declarat jiffiles (extern unsigned long volatile jiffies) pentru a inițializa timestamp.Exercițiul 4
După ce am inițializat structura ti, a fost adăugată la listă folosind membrul list din interiorul structurii. Am iterat prin elementele listei și am eliberat memoria pentru fiecare membru întâlnit pentru a-l șterge.
Exercițiul 5
Asemenator cu exercițiul anterior, am iterat prin elementele listei verificând membrul pid al elementului curent cu parametrul formal. În caz de egalitate se va întoarce obiectul corespunzător.
Exercițiul 6
Am uitilizat spinlock folosind funcțiile lock și unlock. Variabila globală de spinlock este inițializată în funcția init înainte de orice altă operație cu liste. Am marcat funcțiile ce vor fi utilizate la exercițiul următor cu
EXPORT_SYMBOL_GPL.Exercițiul 7
După ce am dat load modulului din exercițiul 6, am încercat să fac același lucru pentru modulul exercițiului curent însă am întâmpinat eroarea
Unknown symbol in modulepentru funcțiile ce au fost exportate la exercițiul 6. Am rezolvat problema înlocuindEXPORT_SYMBOLcuEXPORT_SYMBOL_GPL. (https://lynxbee.com/insmod-error-could-not-insert-module-hello-ko/#.Yi_FGnVBxH5)