From 39a2de5a71091847616b88216a4dbeb4e3769d6f Mon Sep 17 00:00:00 2001 From: winsdominoes Date: Mon, 18 Nov 2024 00:09:05 +0700 Subject: [PATCH] it's midnight and i am about to fall asleep --- ...2 Assessment 1 - Thanawin Pattanaphol.odt# | 2 +- ...02 Assessment 1 - Thanawin Pattanaphol.odt | Bin 71163 -> 71249 bytes fall-2024/sys-arch/sys-102/00040/source/a.out | Bin 0 -> 16936 bytes .../sys-arch/sys-102/00040/source/interrupt | Bin 0 -> 16936 bytes .../sys-arch/sys-102/00040/source/interrupt.c | 49 ++++++++++++++++++ .../sys-102/00040/source/interrupt.c~ | 45 ++++++++++++++++ .../sys-102/00040/source/interrupts.c~ | 7 +++ .../sys-arch/sys-102/00040/source/polling | Bin 0 -> 16992 bytes .../sys-arch/sys-102/00040/source/polling.c | 41 +++++++++++++++ .../sys-arch/sys-102/00040/source/polling.c~ | 40 ++++++++++++++ 10 files changed, 183 insertions(+), 1 deletion(-) create mode 100755 fall-2024/sys-arch/sys-102/00040/source/a.out create mode 100755 fall-2024/sys-arch/sys-102/00040/source/interrupt create mode 100644 fall-2024/sys-arch/sys-102/00040/source/interrupt.c create mode 100644 fall-2024/sys-arch/sys-102/00040/source/interrupt.c~ create mode 100644 fall-2024/sys-arch/sys-102/00040/source/interrupts.c~ create mode 100755 fall-2024/sys-arch/sys-102/00040/source/polling create mode 100644 fall-2024/sys-arch/sys-102/00040/source/polling.c create mode 100644 fall-2024/sys-arch/sys-102/00040/source/polling.c~ diff --git a/fall-2024/sys-arch/sys-102/00040/.~lock.SYS-102 Assessment 1 - Thanawin Pattanaphol.odt# b/fall-2024/sys-arch/sys-102/00040/.~lock.SYS-102 Assessment 1 - Thanawin Pattanaphol.odt# index 979527e..02dc304 100644 --- a/fall-2024/sys-arch/sys-102/00040/.~lock.SYS-102 Assessment 1 - Thanawin Pattanaphol.odt# +++ b/fall-2024/sys-arch/sys-102/00040/.~lock.SYS-102 Assessment 1 - Thanawin Pattanaphol.odt# @@ -1 +1 @@ -,winsdominoes,fedora,17.11.2024 20:23,file:///home/winsdominoes/.var/app/org.libreoffice.LibreOffice/config/libreoffice/4; \ No newline at end of file +,winsdominoes,fedora,17.11.2024 20:55,file:///home/winsdominoes/.var/app/org.libreoffice.LibreOffice/config/libreoffice/4; \ No newline at end of file diff --git a/fall-2024/sys-arch/sys-102/00040/SYS-102 Assessment 1 - Thanawin Pattanaphol.odt b/fall-2024/sys-arch/sys-102/00040/SYS-102 Assessment 1 - Thanawin Pattanaphol.odt index 0f169e5c2283bcb2066c04de98feee6df3bd9b9a..6d93a79fa4461bcb0d3c86557b1766c135d70891 100644 GIT binary patch delta 6918 zcmZu$1yEeeww)Pd2oT)e-3NCkSb*RfG(d0%_;&p7mP@B`rPbI?wV;CeCIqWV<^=zYgMQT5+M=Fsp zKU_q?-WC@u>K(HcwU7fv^3p;Z;C+V{_ej&axhtN|i|CvKk0({(G$^^)05Of~C8n&2 z9Ax6ec7UWb6;5%Vx8mB*tM#tI%F&{$ki;m00LnlMZ8WLcpF6K4F7TA5JCbl$*y5w8 zmkg~%E2dr!I}w+uTnK4O*aUw(l5)>y+wM=e!w}V4KgurX*Q$mpGz@+b@~Ke`SD0FG zBD~2SdXnb+r2Q~<#8Puns;DhnntSlDAoYHwEuX0Uo2=o>XV1~4Af_%>u*skb9Ja)Mx~Tlr zj0n+sj4i0P9*p7-Js<;T`bd&XFskH0`cO{cYq8A%@y<^uLb>}8sV9B7_=#@}B0!10 zc}_iPl(ZIkKU0A@vx4iT#91V4Fik%~l=hgC7}@g?;U)?%I^8gHM}DKDCoIJllIN|( zT2h1}i4G|FrylW)1iDr6zg+C~7u}qcL)#QQ?BBbuwi}Q^!(7%zaIJXuM_&YE-X8EP znWvCf#!x1!U}Nmm#*+-Q^m%uE^00r?NA!$>n35L!)wGrS@AiiKBmpuK)=1`Mt_ygp_j{-@VVEqxqZv|f8v(4C zV?*%s?+Hfir*_}X1PM$uPg8u}P}YYdYGY}fni8ee1bWK!gz z{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arch/sys-102/00040/source/a.out b/fall-2024/sys-arch/sys-102/00040/source/a.out new file mode 100755 index 0000000000000000000000000000000000000000..61fef47a4082a98cf92e58361eb374bada8609e8 GIT binary patch literal 16936 zcmeHOZ)_Y_5r22K6Q@n=vqM`q3C#);l$3aVXFHC$D9QT&IdWoSyNQs1&H8R_A3fih zyS>&fY6%L3x@o0UR6wOjgbxIS1gctss)Cv;L8*fJAt|bqFHi%CQhOn`M5Rc&cCkhn zLK7Rs3eZ%-W=IQi)na}zs0_@j$*%%9;u^3axlzV9NJ$9hoFQ_=Es{Y^#jjT>k+}#d z8FA7?vY_K*euFw-?#9XfG!;i^hH4PMMQY}59Ml%a9G`tyC9-IO9-6T(vIU zMfGk&HkhBMJehMnF-P3msh;f>3ddYYczzUlaWjOQAsq8=@@I~HAdOsh5+9|%A;N9Y zWEinQGh~B#t5OT*+~4N`hjsa|#HV?f`djWiR8#$#Q+Y*GDmm8H+LTH(rjqIWOyf*@ zTVq?Rp3CUXG6l>l3>#ikefu90!Na0}I>rY?piB;u3@(z;_Y<&T*%AK-XHRnXNbKsR z?>zJHKi(XFcTL~h-$x%j4vdLDNa#-~OBrpvNyUfUtp&gOC4AQ`qhGm}CT`{&E9;n3Rx&N7v&pnGE^^6Il2x3ofliK$GQ0+^Ud5bCP_0s64`J15R21jOkDVD`bjJK&lm6d$PqMk|vDe?*6MOwuMJ#YO zcHy>DSBkKbB6#tb@8MlHaCDwu`%rA|^1@?q6lbg60ZrgbXa1`{^uPKvIzp90bB}*; z7L2yI2Ik+WcLo@z55Y z0QuOtGaOFJvALdGuZ=^kP6yHDD7c)))3NXzw65NSR_Pp<&MGK<@+;t1z^{N`0lxx% z1^f#574R$ISHQ1;UxANR1@JqUn|f2$L{!_HxC@kl^%Xn$8)xP9V$lIz0{8&%=Ybyr zzV}A4cpUf(z<&)KziA=`9vc>cnNVQ;>Xp^UU^t53(Kf&q0^DcNp?hTrbr^pe==j^! zCN#nJ)cY#Fs0sDfH0-Ut`_bydV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?!HgGE}?a$bs`+;hV*}^bbn|4KcP|2f`ccaAR7Ev za2wT!O%0%5&i_%+2f&}}$^M}g{JT)^uPr?v*}q@<*9gAG2gz_`g*cx9J@)I)^YIn@ zp8>tbojLe(ps(`>M768_=TMKodeY-WETjvd55V=)?yAqrps)AWi1PtM`tkp1GpL8_ z=Q!!*|8&9Qb&BJz+waI9Cv_q1mU|)o2>LpIgTVP%PI?>lkPquQ&pR@X(^Iuq`7uv; zYoUBf9g8)8=?GJsM4# zaXX#OnbG`|h@~epNz1n4dT@CUa|~|jW;C0PPMcQB&Q6Q5Y;@8x^4ndc7Nhv$ASJX2nA1IvnOIIYovQvn0*6- zogD+_U~lh8&mr?rN9RBfAl&O@3|)2z4nb1h*k@bTScxUegc@cDn39 z1%m<#9j@p}xKM>ouT%2SL61ixk5rG^b~Z7Zx8XYS`dsE~%aHyx!3uJu`d`JE;u>C!W_g^14U-?&KuC->?qXc{%a?d_O}2 z4UHX%yYWXr|2G%|aQ+3#zd(3CejfL@^N#`^$2^RmBm5lU3t&US9DT4cp2sH%(4i~i zd7O2Y5{-e)Nf^UPp92BMG>qqQOeH-KE7>Q*bCp8d0NS(R!C$;zn zG%!`h^SCVH!gK%b5o zp(#XZyiWnRek6)lpn?4}p4a_!4t(i-8m4R`v7eHbWY*sT1717aKfmYlI&WUjjn_XCEE*^%O~$b2g__}rjN z`%y!BUJpqoy4g{Q@?J$v$E-cnwoAC!?E<(&@h=9cyy5@= literal 0 HcmV?d00001 diff --git a/fall-2024/sys-arch/sys-102/00040/source/interrupt.c b/fall-2024/sys-arch/sys-102/00040/source/interrupt.c new file mode 100644 index 0000000..1e76c8d --- /dev/null +++ b/fall-2024/sys-arch/sys-102/00040/source/interrupt.c @@ -0,0 +1,49 @@ +#include +#include +#include +#include + +clock_t t; +t = clock(); + +int flag = 0; +// Handling signal function +void handle_signal(int signal) +{ + // If signal is SIGINT + if (signal == SIGQUIT) + { + // Set flag to its complement + // Print the flag value + flag = !flag; + printf("Flag: %d\n", flag); + } + + if (signal == SIGINT) + { + t = clock() - t; + double time_taken = ((double)t)/CLOCKS_PER_SEC; // in seconds + printf("CPU Time: %f\n", t); + _exit(0); + } +} + +int main() +{ + // Handling signal + signal(SIGQUIT, handle_signal); + signal(SIGINT, handle_signal); + + // Let the program run until interrupt + while (1) + { + sleep(1); + } + + //t = clock() - t; + //double time_taken = ((double)t)/CLOCKS_PER_SEC; // in seconds + + printf("CPU Time: %f\n", t); + + return 0; +} diff --git a/fall-2024/sys-arch/sys-102/00040/source/interrupt.c~ b/fall-2024/sys-arch/sys-102/00040/source/interrupt.c~ new file mode 100644 index 0000000..83901c8 --- /dev/null +++ b/fall-2024/sys-arch/sys-102/00040/source/interrupt.c~ @@ -0,0 +1,45 @@ +#include +#include +#include +#include + +int flag = 0; +// Handling signal function +void handle_signal(int signal) +{ + // If signal is SIGINT + if (signal == SIGQUIT) + { + // Set flag to its complement + // Print the flag value + flag = !flag; + printf("Flag: %d\n", flag); + } + + if (signal == SIGINT) + { + _exit(0); + } +} + +int main() +{ + clock_t t; + t = clock(); + // Handling signal + signal(SIGQUIT, handle_signal); + signal(SIGINT, handle_signal); + + // Let the program run until interrupt + while (1) + { + sleep(1); + } + + t = clock() - t; + double time_taken = ((double)t)/CLOCKS_PER_SEC; // in seconds + + printf("CPU Time: %f\n", t); + + return 0; +} diff --git a/fall-2024/sys-arch/sys-102/00040/source/interrupts.c~ b/fall-2024/sys-arch/sys-102/00040/source/interrupts.c~ new file mode 100644 index 0000000..0589129 --- /dev/null +++ b/fall-2024/sys-arch/sys-102/00040/source/interrupts.c~ @@ -0,0 +1,7 @@ +#include +#include +#include + +void handle_signal(int signal) { + +} diff --git a/fall-2024/sys-arch/sys-102/00040/source/polling b/fall-2024/sys-arch/sys-102/00040/source/polling new file mode 100755 index 0000000000000000000000000000000000000000..6e463a4e6a70aae896c786059a4a4a5ab00cdf8b GIT binary patch literal 16992 zcmeHOU2Ggz6~4Q6n(a^QjZ0GJhi23!C_(Xf*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bj)?*DFfV#4|qBT`< zve0@F4%xgV?|`=JU_)?6v?g;7G(B3WP|I>Fk++A)s}XzX?I&7)Ql?_a9c21C}#`$ll2 z@qa77@O6^0Au#-WzTY3C1&YRjq=Wp20Dm9W4&48f)c=#j=keb{{9ylWz;Ug_{3`LQ z#IF($`xt=_^Lbr^`~NVM`Mf@xrH=A?3PPk{9e()?IJg#KKCgckh!1xdDcpaKWBqw3 z#kCdtyuOOj4aQJ(nPY$d2^P+gNS>n%9Kou+Z3G*2G z9vJ@ijTS=|87(S;e-}`m$~D`le*hokbN=~xLTCVjc)t@U*UKNd;zwZk`Mghfy{00z zav!#KCy>S-%O~W*^^szUKYi zQ05orv3?s0aqe*YypHGn;k*wVzrQHV!FEIeHF77`+FK#9NF@G@F!TMHE`xNd)Gyf?M zQ3kiqdNml>c94IXfCC&z^{~r&6BvAMFyy79hKy|NkV^D%pmIOde=PRCI~0S;>{L#b t5_31WuzK_I&)4r;0pr{$hC0T!E4@BYd7wM62B^>9xI^)G1_%LH{0l}m+6@2z literal 0 HcmV?d00001 diff --git a/fall-2024/sys-arch/sys-102/00040/source/polling.c b/fall-2024/sys-arch/sys-102/00040/source/polling.c new file mode 100644 index 0000000..f43f46c --- /dev/null +++ b/fall-2024/sys-arch/sys-102/00040/source/polling.c @@ -0,0 +1,41 @@ +#include +#include +#include + +int main() +{ + int c; + int flag = 0; + + /* + THIS IS A REPLACEMENT FOR THE _KBHIT FUNCTION + */ + + // These structs are for saving tty parameters + static struct termios old_term, new_term; + + // Get parameters associated with the tty + // Set the new tty parameters to the old one + tcgetattr(STDIN_FILENO, &old_term); + new_term = old_term; + + // Set the new tty parameters to canonical mode + new_term.c_lflag &= ~(ICANON); + + // Set tty attributes + tcsetattr(STDIN_FILENO, TCSANOW, &new_term); + + // Get character input by user + while ((c = getchar()) != EOF) + { + flag = !flag; + printf("\n"); + printf("Flag: %d\n", flag); + } + + // Done retriving input + // Set tty parameters back to old tty parameters + tcsetattr(STDIN_FILENO, TCSANOW, &old_term); + + return 0; +} diff --git a/fall-2024/sys-arch/sys-102/00040/source/polling.c~ b/fall-2024/sys-arch/sys-102/00040/source/polling.c~ new file mode 100644 index 0000000..f13c3e1 --- /dev/null +++ b/fall-2024/sys-arch/sys-102/00040/source/polling.c~ @@ -0,0 +1,40 @@ +#include +#include +#include + +int main() +{ + int c; + int flag = 0; + + /* + THIS IS A REPLACEMENT FOR THE _KBHIT FUNCTION + */ + + // These structs are for saving tty parameters + static struct termios old_term, new_term; + + // Get parameters associated with the tty + // Set the new tty parameters to the old one + tcgetattr(STDIN_FILENO, &old_term); + new_term = old_term; + + // Set the new tty parameters to canonical mode + new_term.c_lflag &= ~(ICANON); + + // Set tty attributes + tcsetattr(STDIN_FILENO, TCSANOW, &new_term); + + // Get character input by user + while ((c = getchar()) != EOF) + { + flag = !flag; + printf("Flag: %d\n", flag); + } + + // Done retriving input + // Set tty parameters back to old tty parameters + tcsetattr(STDIN_FILENO, TCSANOW, &old_term); + + return 0; +}