<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>emzei</title>
    <link>https://emzei.tistory.com/</link>
    <description>엠제이의 공부정리블로그</description>
    <language>ko</language>
    <pubDate>Sat, 11 Jul 2026 17:20:03 +0900</pubDate>
    <generator>TISTORY</generator>
    <ttl>100</ttl>
    <managingEditor>emzei</managingEditor>
    <item>
      <title>gettimeofday()를 이용한 시간 측정하기</title>
      <link>https://emzei.tistory.com/248</link>
      <description>&lt;p data-ke-size=&quot;size16&quot;&gt;참고 출처 :&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;- &lt;a href=&quot;https://stackoverflow.com/questions/5248915/execution-time-of-c-program/5249028&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://stackoverflow.com/questions/5248915/execution-time-of-c-program/5249028&lt;/a&gt;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;- &lt;a href=&quot;https://levelup.gitconnected.com/8-ways-to-measure-execution-time-in-c-c-48634458d0f9&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://levelup.gitconnected.com/8-ways-to-measure-execution-time-in-c-c-48634458d0f9&lt;/a&gt;&lt;/p&gt;
&lt;pre id=&quot;code_1623392795332&quot; class=&quot;c++ arduino&quot; data-ke-language=&quot;c++&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;#include &amp;lt;sys/time.h&amp;gt;

struct timeval  tv1, tv2;
gettimeofday(&amp;amp;tv1, NULL);
/* stuff to do! */
gettimeofday(&amp;amp;tv2, NULL);

printf (&quot;Total time = %f seconds\n&quot;,
         (double) (tv2.tv_usec - tv1.tv_usec) / 1000000 +
         (double) (tv2.tv_sec - tv1.tv_sec));&lt;/code&gt;&lt;/pre&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;clock() 함수를 사용하라는 글들이 많이 보이지만, 해당 방식으로 헀을때는 의도와 다른 값이 출력된다. &lt;br /&gt;(왜인지는 나중에 좀 더 확인해봐야할 부분)&lt;/p&gt;</description>
      <category>NOWS/Language C, C++</category>
      <author>emzei</author>
      <guid isPermaLink="true">https://emzei.tistory.com/248</guid>
      <comments>https://emzei.tistory.com/248#entry248comment</comments>
      <pubDate>Fri, 11 Jun 2021 20:27:25 +0900</pubDate>
    </item>
    <item>
      <title>2021-04-20</title>
      <link>https://emzei.tistory.com/247</link>
      <description>&lt;pre id=&quot;code_1618921716121&quot; class=&quot;c++ arduino&quot; data-ke-language=&quot;c++&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;/* ??? 오 이게 된다고 ?  */
/* 코드블록 삽입이 된다니  */
/* - 흔한 고인돌의 반응 - */&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;회사를 입사하고 나서는 줄곧 사내 시스템에서만 문서를 쓰다보니, 자연스레 블로그는 멀어졌습니다.&lt;/p&gt;
&lt;p&gt;어느순간 블로그는 비공개로 개발 메모장이 되어있네요..&lt;/p&gt;
&lt;p&gt;예전에는 (꽤 오래전에는) 블로그에 코드 입력하기가 조금 번거로웠는데 (그래서 제 글들은 어설픈 표안에 코드들이 들어있지만) 말이죠&lt;/p&gt;
&lt;p&gt;친구들이 요즘에는 티스토리에도 코드 삽입하기가 수월하대서 로그인을 부랴부랴 해봤습니다&lt;/p&gt;
&lt;p&gt;최근에는 Notion이라는 툴을 적극 활용하여 필요한 내용들을 정리해보고 있는데, 요즘엔 참 편한 툴이 많네요.&lt;/p&gt;
&lt;p&gt;바쁜 일들이 이따금 정리되면 다시 블로그를 활용하겠다고 결심해보며 이만 줄입니다.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>Daily</category>
      <author>emzei</author>
      <guid isPermaLink="true">https://emzei.tistory.com/247</guid>
      <comments>https://emzei.tistory.com/247#entry247comment</comments>
      <pubDate>Tue, 20 Apr 2021 21:36:43 +0900</pubDate>
    </item>
    <item>
      <title>mount 명령어</title>
      <link>https://emzei.tistory.com/243</link>
      <description>&lt;div class=&quot;txc-textbox&quot; style=&quot;border-style: dashed; border-width: 1px; border-color: rgb(203, 203, 203); background-color: rgb(255, 255, 255); padding: 10px;&quot;&gt;&lt;p&gt;The standard form of the mount command is:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;b&gt;mount -t type device dir&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&amp;lt;Example&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;mount -t cramfs -o loop,ro,noexec &amp;nbsp;.17E424.cramfs ./rootfs/&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;-t : file system type&lt;/p&gt;&lt;p&gt;cramfs : compressed rom file system&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;-o : options&lt;/p&gt;&lt;p&gt;loop : mount 시 사용되는 device (/dev/loop*)&lt;/p&gt;&lt;p&gt;ro : read only&lt;/p&gt;&lt;p&gt;noexec : no execution&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>NOWS/MEMO</category>
      <author>emzei</author>
      <guid isPermaLink="true">https://emzei.tistory.com/243</guid>
      <comments>https://emzei.tistory.com/243#entry243comment</comments>
      <pubDate>Thu, 7 Sep 2017 17:29:47 +0900</pubDate>
    </item>
    <item>
      <title>(임베디드) Command injection vulnerability check 커맨드 인젝션 취약점 점검</title>
      <link>https://emzei.tistory.com/241</link>
      <description>&lt;hr class=&quot;tx-hr-image-4&quot; style=&quot;background: url(//i1.daumcdn.net/deco/contents/horizontalrule/line08.gif?v=2) repeat-x scroll left; height: 15px; border:0; width:54px; margin:30px auto&quot;&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;커맨드 인젝션 취약점&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;- OWASP :&amp;nbsp;&lt;a href=&quot;https://www.owasp.org/index.php/Command_Injection&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://www.owasp.org/index.php/Command_Injection&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;hr class=&quot;tx-hr-image-1&quot; style=&quot;background: url(//i1.daumcdn.net/deco/contents/horizontalrule/line03.gif?v=2) repeat-x scroll left; height: 15px; border:0&quot;&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;커맨드 인젝션 취약점에 노출될 가능성이 있는 함수&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;u&gt;시스템 함수&lt;/u&gt;의 사용을 권고하지 않음 (제약해야함)&lt;/p&gt;&lt;ul style=&quot;list-style-type: disc;&quot;&gt;&lt;li&gt;open() / seek() / write() / close()&lt;/li&gt;&lt;li&gt;system ()&lt;/li&gt;&lt;li&gt;exec(), execlv(), execve() 등 exec 계열 함수&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;hr class=&quot;tx-hr-image-1&quot; style=&quot;background: url(//i1.daumcdn.net/deco/contents/horizontalrule/line03.gif?v=2) repeat-x scroll left; height: 15px; border:0&quot;&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;* 임베디드 리눅스 환경이라 가정&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;1) &lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;커맨드 인젝션 취약점에 노출될 가능성이 있는 함수&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt; 를 사용하는 프로그램 &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;탐지/식별&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;ul style=&quot;list-style-type: disc;&quot;&gt;&lt;ul style=&quot;list-style-type: disc;&quot;&gt;&lt;li&gt;How To?&lt;/li&gt;&lt;ul style=&quot;list-style-type: disc;&quot;&gt;&lt;li&gt;&lt;b&gt;&lt;span style=&quot;color: rgb(9, 0, 255);&quot;&gt;$ find . -type f -executable&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;(OR) &lt;span style=&quot;color: rgb(9, 0, 255);&quot;&gt;&lt;b&gt;$find . -type f perm&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;b&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;(1) &lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;함수 이름과 같은 문자열을 포함하고 있는 실행파일 식별&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;ul style=&quot;list-style-type: disc;&quot;&gt;&lt;li&gt;&lt;b&gt;&lt;span style=&quot;color: rgb(9, 0, 255);&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;$ find (PATH) &lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;-type f -executable -exec grep system {} \;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;b&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;(2) 함수를 사용하는지 확인&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;ul style=&quot;list-style-type: disc;&quot;&gt;&lt;li&gt;&lt;b&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;$ readelf -s (FileName) | grep system&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: rgb(9, 0, 255);&quot;&gt;&lt;b&gt;(example) $ readelf -s &lt;/b&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;sbin/dhcpd &lt;/span&gt;&lt;b&gt;| grep system&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;&lt;ul style=&quot;list-style-type: disc;&quot;&gt;&lt;li&gt;프로그램 내에 system() 사용하는 흔적이 있는지 찾음&lt;/li&gt;&lt;li&gt;IDA로 점검 필요&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;b&gt;cf. 파일 형식 및 아키텍쳐 정보 확인: &lt;/b&gt;&lt;span style=&quot;color: rgb(9, 0, 255);&quot;&gt;&lt;b&gt;$file&lt;/b&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt; sbin/dhcpd&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;cf. &lt;u&gt;&lt;b&gt;filtering&lt;/b&gt;&lt;/u&gt; vs. &lt;b&gt;&lt;u&gt;sanitizing&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;필터링 - 유효하지 않은 인자값 거르기&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;살균 - 유효하지 않은 인자값을 안전하게 가공&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;cf. 리눅스 시스템 함수 - 라이브러리 함수, 윈도우 라이브러리 - dll&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;cf. 리눅스 - ELF&lt;/p&gt;&lt;hr class=&quot;tx-hr-image-4&quot; style=&quot;background: url(//i1.daumcdn.net/deco/contents/horizontalrule/line08.gif?v=2) repeat-x scroll left; height: 15px; border:0; width:54px; margin:30px auto&quot;&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;2) &lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;취약한 함수&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;에 전달되는&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;파라미터&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt; 조사&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;* IDA 함수 윈도우에서 system 함수를 찾아, system함수를 호출하는 지점들을 확인&lt;br /&gt;(실습에서는 sendACK() 함수로 이동)&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;&lt;b&gt;&amp;lt;점검 항목&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 4em;&quot;&gt;&lt;b&gt;2-1) 명령어 문자열이 동적으로 생성되는가?&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 4em;&quot;&gt;&lt;b&gt;2-2) 동적으로 생성되는 명령어 문자열에 사용자 입력값 / 외부입력값이 포함되는가?&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 6em;&quot;&gt;&lt;b&gt;* 외부? 다른 프로세스 등 실행중인 프로세스 이외의 것&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 4em;&quot;&gt;&lt;b&gt;2-3) 권한 없는 사용자가 입력값을 임의대로 조작할 수 있는가?&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 4em;&quot;&gt;&lt;b&gt;2-4) 적절하게 필터링 또는 sanitizing을 수행하는가?&lt;/b&gt;&lt;/p&gt;&lt;ul style=&quot;list-style-type: disc;&quot;&gt;&lt;ul style=&quot;list-style-type: disc;&quot;&gt;&lt;li&gt;How to? -- IDA&lt;/li&gt;&lt;ul style=&quot;list-style-type: disc;&quot;&gt;&lt;li&gt;example : dhcpd - MIPS Little endian.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;table class=&quot;txc-table&quot; width=&quot;464&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; style=&quot;border:none;border-collapse:collapse;;font-family:&quot; 맑은=&quot;&quot; 고딕&quot;,=&quot;&quot; sans-serif;font-size:13px&quot;=&quot;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;width:464;height:24;border-bottom:1px solid #ccc;border-right:1px solid #ccc;border-top:1px solid #ccc;border-left:1px solid #ccc;;&quot;&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;$s&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;0 = get_option(&amp;amp;packet, DHCP_HOSTNAME)&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;memset($1, 0x00, 0x18)&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;b&gt;memcpy($s1, $s0)&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;b&gt;sprintf($s0, &quot;echo %s %d &amp;gt; /var/hostname&quot;, $s1)&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;b&gt;system($s0)&amp;nbsp; &amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;li&gt;Yes/Yes/Yes ==&amp;gt; 취약한 것으로 판단&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;div&gt;Cf. 네트워크 관련 파이썬 라이브러리 : Scapy&lt;/div&gt;&lt;ul style=&quot;list-style-type: disc;&quot;&gt;&lt;ul style=&quot;list-style-type: disc;&quot;&gt;&lt;li&gt;관련 링크 : &lt;a href=&quot;http://www.secdev.org/projects/scapy/&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;http://www.secdev.org/projects/scapy/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;div&gt;Cf. DHCP 동작순서&amp;nbsp;&amp;nbsp;: D-O-R-A&lt;/div&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;b&gt;D&lt;/b&gt;iscover/&amp;nbsp;&lt;b&gt;O&lt;/b&gt;ffer/&amp;nbsp;&lt;b&gt;R&lt;/b&gt;equest/&amp;nbsp;&lt;b&gt;A&lt;/b&gt;cknowledge&lt;/div&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;ref.&amp;nbsp;&lt;a href=&quot;http://www.geekinterview.com/question_details/55539&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;http://www.geekinterview.com/question_details/55539&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;ul style=&quot;list-style-type: disc;&quot;&gt;&lt;li&gt;DHCP : Stateless&lt;/li&gt;&lt;li&gt;Scapy를 활용한 python 진단 코드&lt;/li&gt;&lt;/ul&gt;&lt;hr class=&quot;tx-hr-image-4&quot; style=&quot;background: url(//i1.daumcdn.net/deco/contents/horizontalrule/line08.gif?v=2) repeat-x scroll left; height: 15px; border:0; width:54px; margin:30px auto&quot;&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;3) 취약점 검증&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;&amp;nbsp;(예 DHCP)&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;3-1) /etc/dhcp/dhclient.conf 파일 수정&lt;/p&gt;&lt;p style=&quot;margin-left: 4em;&quot;&gt;&lt;b&gt;send host-name &quot;;/sbin/reboot;&quot;;&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;3-2) dhcp client 재실행&lt;/p&gt;&lt;p style=&quot;margin-left: 4em;&quot;&gt;&lt;b&gt;$ sudo kill -9 $(pidof dhclient)&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 4em;&quot;&gt;&lt;b&gt;$ sudo dhclient eth0&amp;nbsp;&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 6em;&quot;&gt;cf. 네트워크 인터페이스명은 다를 수 있음&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;3-3) UART 메시지 확인&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;3-4) 취약점 확인&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;margin-left: 4em;&quot;&gt;&lt;b&gt;$ wget -qO- --post-data=&quot;echo -e 'Content-type: text/plain\n';PATH=\$PATH:/sbin ifconfig&quot; http://192.168.0.1/cgi-bin/sh&lt;/b&gt;&lt;/p&gt;</description>
      <category>NOWS/Security</category>
      <author>emzei</author>
      <guid isPermaLink="true">https://emzei.tistory.com/241</guid>
      <comments>https://emzei.tistory.com/241#entry241comment</comments>
      <pubDate>Thu, 7 Sep 2017 13:19:47 +0900</pubDate>
    </item>
    <item>
      <title>Firmware 이해하기 (2) IDA</title>
      <link>https://emzei.tistory.com/239</link>
      <description>&lt;p&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;printf(&quot;abc&quot;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;파라미터 셋업 - 파라미터 주소 설정&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;출력 함수 호출&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;주소는 어떻게 알까?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;컴파일 후, 링커가 설정해준다.&lt;/span&gt;&lt;/p&gt;&lt;hr class=&quot;tx-hr-image-4&quot; style=&quot;background: url(//i1.daumcdn.net/deco/contents/horizontalrule/line08.gif?v=2) repeat-x scroll left; height: 15px; border:0; width:54px; margin:30px auto&quot;&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Arial; font-size: 14pt;&quot;&gt;&lt;b&gt;시작 주소값 확인.&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Arial; font-size: 14pt;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Arial; font-size: 12pt;&quot;&gt;&lt;b&gt;1) li 파라미터 값 확인하기&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 12pt;&quot;&gt;2) UART&lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: 12pt;&quot;&gt;&amp;nbsp;Boot Message 확인하기&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;u&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;Entry at&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt; 0x80001000&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;u&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;Starting program at&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt; 0x80001000&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;...&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Arial; font-size: 12pt;&quot;&gt;&lt;b&gt;3) BSS 초기화 코드 찾아서 Load address 찾기&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;BSS 영역 : 초기화되지 않은 전역변수, 초기화되지않은 정적변수&lt;/span&gt;&lt;/p&gt;&lt;table class=&quot;txc-table&quot; width=&quot;464&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; style=&quot;border:none;border-collapse:collapse;;font-family:&quot; 맑은=&quot;&quot; 고딕&quot;,=&quot;&quot; sans-serif;font-size:13px&quot;=&quot;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;width:464;height:24;border-bottom:1px solid #ccc;border-right:1px solid #ccc;border-top:1px solid #ccc;border-left:1px solid #ccc;;&quot;&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;nop&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;li $a0, 0x1234 //BSD 시작주소&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;li $a1, 0x2344 //BSD 끝주소&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;font face=&quot;Arial&quot;&gt;BSS 초기화하는 코드 - 일정한 패턴이 있음&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face=&quot;Arial&quot;&gt;BSS 시작주소를 알 수 있다&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face=&quot;Arial&quot;&gt;&quot; BSS 시작주소 - Boot Code Size = Boot Code &quot; 시작주소 추정 가능&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>NOWS/Security</category>
      <author>emzei</author>
      <guid isPermaLink="true">https://emzei.tistory.com/239</guid>
      <comments>https://emzei.tistory.com/239#entry239comment</comments>
      <pubDate>Wed, 6 Sep 2017 17:56:45 +0900</pubDate>
    </item>
    <item>
      <title>Firmware 이해하기 (1) MIPS 이해하기</title>
      <link>https://emzei.tistory.com/238</link>
      <description>&lt;p&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;(1) MIPS basic&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;- CISC vs. &lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;RISC&lt;/span&gt;&lt;/u&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;MIPS&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;RISC :&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;* 모든 inst 사이즈가 동일 (32bit - 4Byte) 코드 사이즈 줄이는데에 불리&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;* 같은 면적의 CPU Die를 더 효율적으로 이용할 수 있음&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;Register:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;* 레지스터 이름은 $로 시작한다&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;* $zero : /dev/zero와 용도가 비슷. &amp;nbsp;읽기전용. 읽으면 16진수 0x0 반환. 초기화 시 사용.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;* load XX : 데이터 로드. lb, lw, li&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;cf. &lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;byte, word, immediate(const value)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;* save XX : 데이터 저장. sb, sw, si&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;* branch XX : 분기. &lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;bne (branch not equal), be&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;* jump XX : 함수 호출 시 사용. JAL (jump and link), JALR(jump and link - register)&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;ex) JAL FunctionName : 지역함수 호출&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;ex) JALR RegisterName : 라이브러리 호출&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;* return address : $ra에 저장&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;* parameter : $a0, $a1, $a2, $a3&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 2em;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;* return value :&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;* move XX : 값 복사.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;MIPS Specialty - Branch Delay Slot&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;* 파이프라인 성능 개선위해 설계된 사항&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;* branch 문 실행 전 bubble 삽입을 통해 이미 가져온 명령어 수행&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;font face=&quot;Verdana&quot;&gt;* 참고)&amp;nbsp;&lt;a href=&quot;https://en.wikipedia.org/wiki/Delay_slot#Branch_delay_slots&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://en.wikipedia.org/wiki/Delay_slot#Branch_delay_slots&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face=&quot;Verdana&quot;&gt;* 참고) &lt;a href=&quot;https://cseweb.ucsd.edu/classes/wi02/cse141/c14branchHazard.ppt&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;https://&lt;/a&gt;&lt;/font&gt;&lt;span style=&quot;color: rgb(0, 102, 33); font-family: &amp;quot;Apple SD Gothic Neo&amp;quot;, arial, sans-serif; font-size: 14px; white-space: nowrap;&quot;&gt;&lt;a href=&quot;https://cseweb.ucsd.edu/classes/wi02/cse141/c14branchHazard.ppt&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;cseweb.ucsd.edu/classes/wi02/cse141/c14branchHazard.ppt&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;</description>
      <category>NOWS/Security</category>
      <author>emzei</author>
      <guid isPermaLink="true">https://emzei.tistory.com/238</guid>
      <comments>https://emzei.tistory.com/238#entry238comment</comments>
      <pubDate>Wed, 6 Sep 2017 17:29:33 +0900</pubDate>
    </item>
    <item>
      <title>mac osx 에서 mysql 설치</title>
      <link>https://emzei.tistory.com/237</link>
      <description>&lt;p&gt;* 환경 : max osx 10.10.5 (요세미티)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;pre-requisite : homebrew 설치&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div style=&quot;background: url(//i1.daumcdn.net/deco/contents/horizontalrule/line03.gif?v=2) repeat-x scroll left;  width: 99%; height: 15px&quot;&gt;&lt;hr style=&quot;border: black 0 none; left: -9999px; position: relative; top: -9999px&quot;&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;설치 및 실행&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;$ brew install mysql&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;$ mysql.server start&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;cf. 여기서 아래와 같은 에러가 뜰 수 있음.&lt;/p&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border: 1px dashed rgb(193, 193, 193); padding: 10px; background-color: rgb(238, 238, 238);&quot;&gt;&lt;p&gt;... ERROR! The server quit without updating PID file (/usr/local/var/mysql/emzeiui-MacBook-Air.local.pid).&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;해결책 -- &lt;b&gt;$ ps aux | grep mysql&amp;nbsp;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;이미 실행중인 mysql 의 pid를 확인하여 사살 -- &lt;b&gt;$ kill (mysql_pid)&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;mysql 재실행 --&lt;b&gt; $ mysql.server restart&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;$ mysql -u root&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Welcome to the MySQL monitor. &amp;nbsp;Commands end with ; or \g.&lt;/p&gt;&lt;p&gt;Your MySQL connection id is 3&lt;/p&gt;&lt;p&gt;Server version: 5.7.13 Homebrew&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Oracle is a registered trademark of Oracle Corporation and/or its&lt;/p&gt;&lt;p&gt;affiliates. Other names may be trademarks of their respective&lt;/p&gt;&lt;p&gt;owners.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;mysql&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div style=&quot;background: url(//i1.daumcdn.net/deco/contents/horizontalrule/line03.gif?v=2) repeat-x scroll left;  width: 99%; height: 15px&quot;&gt;&lt;hr style=&quot;border: black 0 none; left: -9999px; position: relative; top: -9999px&quot;&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;기타 mysql 참고 매뉴얼 :&amp;nbsp;&lt;a href=&quot;http://dev.mysql.com/doc/refman/5.7/en/connecting-disconnecting.html&quot; target=&quot;_blank&quot; class=&quot;tx-link&quot;&gt;http://dev.mysql.com/doc/refman/5.7/en/connecting-disconnecting.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>NOWS/MEMO</category>
      <author>emzei</author>
      <guid isPermaLink="true">https://emzei.tistory.com/237</guid>
      <comments>https://emzei.tistory.com/237#entry237comment</comments>
      <pubDate>Tue, 12 Jul 2016 01:54:26 +0900</pubDate>
    </item>
    <item>
      <title>mac osx (10.10 이상)  에서 mysql 삭제</title>
      <link>https://emzei.tistory.com/236</link>
      <description>&lt;p&gt;sql 연습하려고 설치 시도하는데, 처음엔 홈페이지에서 dmg 파일 받아서 패키지 설치까진 했는데... 그러고나서 터미널에서 할 줄 몰라서 헤매다가 homebrew로 또 설치... 두개 헷갈려서 brew꺼 지웠는데, 다시 dmg로 설치한거 하려니까...이상해서 이거 uninstall을 하고싶었는데...인터넷 검색결과 따라하려니까 파일이 없다?...&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;참고링크 : http://php-built.com/uninstall-mysql-from-os-x-yosemite/&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;기존에 uninstall 방법에서와 차이점은&amp;nbsp;&lt;/p&gt;&lt;p&gt;요세미티 (10.10) 에서는 &amp;nbsp;/etc/hostconfig 파일이 존재하지 않는다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;대신에 이거 두개를 해줘야 함&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;$ sudo rm -rf /Library/LaunchDaemons/com.microsoft.office.licensing.helper.plist&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;$ sudo rm -rf /private/var/db/receipts/*mysql*&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;









&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;즉, uninstall을 위한 총 명령은 아래와 같다&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border: 1px dashed rgb(193, 193, 193); padding: 10px; background-color: rgb(238, 238, 238);&quot;&gt;&lt;p style=&quot;margin: 0.4em 0px 0.5em; line-height: 19.05px; font-family: sans-serif; font-size: 12.7px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;$ sudo rm /usr/local/mysql&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0.4em 0px 0.5em; line-height: 19.05px; font-size: 12.7px;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;$ sudo rm -rf /usr/local/mysql*&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0.4em 0px 0.5em; line-height: 19.05px; font-size: 12.7px;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;$ sudo rm -rf /Library/StartupItems/MySQLCOM&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0.4em 0px 0.5em; line-height: 19.05px; font-size: 12.7px;&quot;&gt;&lt;b style=&quot;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;$ sudo rm -rf /Library/PreferencePanes/My*&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;$ sudo rm -rf /Library/LaunchDaemons/com.microsoft.office.licensing.helper.plist&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0.4em 0px 0.5em; line-height: 19.05px; font-family: sans-serif; font-size: 12.7px;&quot;&gt;&lt;/p&gt;&lt;p style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 13px; line-height: normal;&quot;&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;p1&quot; style=&quot;margin-top: 0px; margin-bottom: 0px; color: rgb(0, 0, 0); font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;$ sudo rm -rf /private/var/db/receipts/*mysql*&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; line-height: 19.05px; font-family: sans-serif; font-size: 12.7px;&quot;&gt;&lt;b style=&quot;font-size: 12.7px; line-height: 19.05px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;$ rm -rf ~/Library/PreferencePanes/My*&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; line-height: 19.05px; font-family: sans-serif; font-size: 12.7px;&quot;&gt;&lt;b style=&quot;font-size: 12.7px; line-height: 19.05px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;$ sudo rm -rf /Library/Receipts/mysql*&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; line-height: 19.05px; font-family: sans-serif; font-size: 12.7px;&quot;&gt;&lt;b style=&quot;font-size: 12.7px; line-height: 19.05px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;$ sudo rm -rf /Library/Receipts/MySQL*&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; line-height: 19.05px; font-family: sans-serif; font-size: 12.7px;&quot;&gt;&lt;b style=&quot;font-size: 12.7px; line-height: 19.05px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;$ sudo rm -rf /var/db/receipts/com.mysql.*&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/div&gt;&lt;p style=&quot;margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; line-height: 19.05px; font-family: sans-serif; font-size: 12.7px;&quot;&gt;&lt;b style=&quot;font-size: 12.7px; line-height: 19.05px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; line-height: 19.05px; font-family: sans-serif; font-size: 12.7px;&quot;&gt;&lt;b style=&quot;font-size: 12.7px; line-height: 19.05px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0.4em 0px 0.5em; line-height: 19.05px; font-family: sans-serif; font-size: 12.7px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>NOWS/MEMO</category>
      <author>emzei</author>
      <guid isPermaLink="true">https://emzei.tistory.com/236</guid>
      <comments>https://emzei.tistory.com/236#entry236comment</comments>
      <pubDate>Tue, 12 Jul 2016 00:36:05 +0900</pubDate>
    </item>
    <item>
      <title>프로세스 - part 1. 프로세스 기술(description) 과 제어</title>
      <link>https://emzei.tistory.com/235</link>
      <description>&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;part 1. 프로세스 기술(description) 과 제어
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;li&gt;프로세스 :&amp;nbsp;수행 중인 프로그램&lt;/li&gt;&lt;/ul&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;li&gt;프로세스의 필수 적인 요소&lt;ul&gt;&lt;li&gt;프로그램 코드 및 연계된 데이터의 집합&lt;/li&gt;&lt;li&gt;프로세스를 식별하기 위한 구조 : Process Control Block (PCB)&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;li&gt;PCB의 주요 역할 : 프로세스의 다중처리 지원을 위해 프로세스 문맥의 정보를 유지&lt;ul&gt;&lt;li&gt;프로세스가 인터럽트 될 때, PCB에 정보를 저장하고 추후 재 스케줄링 될 때 해당 정보를 적절히 복구하여, 프로세스 수행에 차질이 없도록 함&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;li&gt;프로세스 상태&lt;ul&gt;&lt;li&gt;2-상태 프로세스 모델 : 수행-비수행&lt;/li&gt;&lt;li&gt;5-상태 프로세스 모델 : 생성-(준비-수행-블록)-종료&lt;ul&gt;&lt;li&gt;cf. 준비큐. 블록큐.&lt;/li&gt;&lt;li&gt;보류된 프로세스의 특성&lt;ul&gt;&lt;li&gt;즉시 수행 불가&lt;/li&gt;&lt;li&gt;보류 상태를 명시적으로 해제하지 않는 이상 해당 상태에서 벗어날 수 없다&lt;/li&gt;&lt;li&gt;보류 이유 : 스와핑. 운영체제의 다른 이유. 타이밍. 부모 프로세스의 요청 등&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;보류된 프로세스 (suspended process) -&amp;gt;&amp;nbsp;swapping의 필요성&lt;ul&gt;&lt;li&gt;OS의 욕심 : 더 많은 프로세스들을 수용하기 위해 주기억 장치를 확장&lt;/li&gt;&lt;li&gt;문제점 1 : 주기억 장치의 비용 문제&lt;/li&gt;&lt;li&gt;문제점 2 : 메모리 가격의 하락 속도 만큼 프로그램의 메모리 요구량이 증가하므로, 메모리의 용량이 커져도 프로세스 크기가 늘어남.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;cf. 스와핑 (swapping)&lt;ul&gt;&lt;li&gt;프로세스의 일부나 전체를 주기억장치에서 디스크로 옮겨놓는 방법&lt;/li&gt;&lt;li&gt;스와핑은 i/o 연산이므로, 문제 해결에 도움을 주려다가 오히려 더 악화 시킬 수 있음. 그러나 disk i/는 일반적으로 시스템에서 가장 빠른 i/o 작업이라 성능을 향상시킬 수 있다고 봄.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;li&gt;프로세스 생성과 종료&lt;ul&gt;&lt;li&gt;프로세스 생성&lt;ul&gt;&lt;li&gt;cf. 기존 프로세스가 생성 (process spawning) -&amp;nbsp;명시적 요청에 의한 새로운 프로세스 생성 - fork()&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;프로세스 종료&lt;ul&gt;&lt;li&gt;정상 종료&lt;/li&gt;&lt;li&gt;비정상 종료&lt;ul&gt;&lt;li&gt;timeout, 메모리부족, 부모 요청, 부모 종료, 데이터 오용 등&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;li&gt;프로세스 기술 (description)&lt;ul&gt;&lt;li&gt;운영체제 제어 구조&lt;ul&gt;&lt;li&gt;운영체제 프로세스 및 자원 관리를 위해 현재 상태를 나타내는 정보 필요&lt;/li&gt;&lt;li&gt;메모리 테이블&lt;ul&gt;&lt;li&gt;주기억장치와 보조기억장치의 자취를 유지하기 위해 사용&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;입출력 테이블&lt;/li&gt;&lt;li&gt;파일테이블&lt;/li&gt;&lt;li&gt;프로세스 테이블&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;프로세스 제어 구조&lt;ul&gt;&lt;li&gt;PCB, 프로세스 디스크립터, 태스트 제어블록(TCB)&lt;/li&gt;&lt;li&gt;프로세스 이미지&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;프로세스 속성&lt;ul&gt;&lt;li&gt;PCB에 있는 정보들&lt;/li&gt;&lt;li&gt;cf. PCB의 역할&lt;ul&gt;&lt;li&gt;운영체제에게 필요한 프로세스의 모든 정보 포함&lt;/li&gt;&lt;li&gt;스케줄링, 자원할당, 인터럽트 처리 등과 관련된 모듈들 포함&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;p&gt;&lt;div style=&quot;background: url(//i1.daumcdn.net/deco/contents/horizontalrule/line03.gif?v=2) repeat-x scroll left;  width: 99%; height: 15px&quot;&gt;&lt;hr style=&quot;border: black 0 none; left: -9999px; position: relative; top: -9999px&quot;&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;&lt;b&gt;프로세스 제어
&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;li&gt;수행모드 (mode of execution) … x86 기준&lt;/li&gt;&lt;ul&gt;&lt;li&gt;User mode (사용자 모드)&lt;ul&gt;&lt;li&gt;사용자 프로그램들이 일반적으로 이 모드에서 수행&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Kernel mode (커널 모드)&lt;ul&gt;&lt;li&gt;더 많은 권한을 가진 모드는 system mode와 control mode&lt;/li&gt;&lt;li&gt;운영체제 커널과 관련&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;2가지 모드를 사용하는 이유&lt;ul&gt;&lt;li&gt;운영체제 및 PCB와 같은 주요 정보를 사용자 프로그램의 간섭으로부터 보호하기 위해&lt;/li&gt;&lt;li&gt;커널모드에서 수행되는 프로그램은 처리기, 모든 명령, 레지스터, 메모리를 완전히 제어할 수 있기 때문에, 해당 제어 수준을 사용자로 부터 분리해야 함&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;2가지 모드 사용의 문제점 및 해결 방법&lt;/li&gt;&lt;ul&gt;&lt;li&gt;어떤 모드에서 수행중인가 -PSW - process state word 의 bit를 통해 표시&lt;/li&gt;&lt;li&gt;모드 변경 방법&lt;/li&gt;&lt;ul&gt;&lt;li&gt;특정 이벤트에 따라 커널모드와 사용자 모드 변경&lt;/li&gt;&lt;li&gt;사용자 모드 --&amp;gt; 커널 모드&lt;ul&gt;&lt;li&gt;예) 사용자가 OS 서비스 호출&lt;/li&gt;&lt;li&gt;예) 인터럽트가 OS 커널 수행을 trigger&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;커널모드 --&amp;gt; 사용자 모드&lt;/li&gt;&lt;ul&gt;&lt;li&gt;제어가 OS 서비스를 수행 뒤 사용자 프로세스로 복귀 (return from syscall)&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;li&gt;프로세스 생성 단계&lt;ul&gt;&lt;li&gt;새로운 프로세스에 유일한 프로세스 식별자 할당&lt;/li&gt;&lt;li&gt;프로세스에 공간 할당&lt;/li&gt;&lt;li&gt;프로세스 제어 블록 초기화&lt;/li&gt;&lt;li&gt;적절한 linkage 설정&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;프로세스 교환 방법&lt;ul&gt;&lt;li&gt;cf. mode switching vs. process switching&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;프로세스 교환 시점&lt;ul&gt;&lt;li&gt;인터럽트 &amp;nbsp;(h/w interrupt)&lt;ul&gt;&lt;li&gt;현재 명령어 수행과 별개로 비 동기적인 외부 사건에 의해 발생&lt;/li&gt;&lt;li&gt;인터럽트 핸들러에서 시스템 관리작업 처리 후 유형에 따라 관련 OS 루틴으로 분기하여 핸들링&lt;/li&gt;&lt;li&gt;(ex) HW interrupt — clock interrupt, i/o interrupt, memory fault&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;트랩&amp;nbsp;&lt;ul&gt;&lt;li&gt;현재 수행중인 프로세스와 관련되어, 오류나 예외 처리를 위해 발생&lt;/li&gt;&lt;li&gt;관련 오류 또는 예외가 치명적인지 여부에 따라 프로세스 종료 or 복구 프로시저 수행 or 프로세스 교환 or 사용자 통보 등.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;슈퍼바이저 호출&lt;ul&gt;&lt;li&gt;프로그램 수행 중 OS 기능에 대해 명시적 요청을 통해 발생&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;li&gt;모드 전환 (mode switching)&lt;ul&gt;&lt;li&gt;프로그램 카운터를 인터럽트 핸들러의 시작주소로 설정&lt;/li&gt;&lt;li&gt;커널모드로 전환 후 인터럽트 처리코드 수행&lt;/li&gt;&lt;li&gt;기존 문맥 저장 후 인터럽트 핸들링 뒤 기존 문맥 복구&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;/p&gt;&lt;ul style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;li&gt;모드 전환 vs. 프로세스 전환&lt;ul&gt;&lt;li&gt;모드 전환 : 현재 수행상태에 있는 프로세스의 상태를 바꾸지 않고 수행 가능&lt;/li&gt;&lt;li&gt;프로세스 교환 : 교환을 위해 환경을 변경해야하고, 모드전환에 비해 많은 작업이 필요&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>NOWS/Operating Systems</category>
      <author>emzei</author>
      <guid isPermaLink="true">https://emzei.tistory.com/235</guid>
      <comments>https://emzei.tistory.com/235#entry235comment</comments>
      <pubDate>Mon, 11 Jul 2016 16:18:44 +0900</pubDate>
    </item>
    <item>
      <title>ch 6. Formal Relational Query Languages (Part 2. Tuple Relational Calculus &amp;amp; Domain Relational Calculus)</title>
      <link>https://emzei.tistory.com/234</link>
      <description>&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 24pt;&quot;&gt;Part 2.&amp;nbsp;Tuple Relational Calculus &amp;amp;&amp;nbsp;Domain Relational Calculus&lt;/span&gt;
&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;li&gt;관계대수는 기호의 순서에 따라, 절차에 맞게 처리해야하기 때문에 순차적이다. 하지만 6장의 관계대수 부분 다음에 나오는 아래 이야기들은 표현의 절차를 없앰으로써, 비절차적으로 수행할 수 있음을 보여준다.&lt;/li&gt;&lt;li&gt;관계 대수에 비하여 큰 비중을 차지하지 않으나, 어떤 개념인지 파악하고 넘어가면 좋을 것 같다.&lt;/li&gt;&lt;/ul&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;Tuple Relational Calculus (튜플 관계 해석)
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;ul style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;li&gt;비절차적 쿼리 언어로서, 각 쿼리는 다음과 같은 형태를 지닌다.&lt;ul&gt;&lt;li&gt;(db1)&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;이 것은 조건 P를 만족하는 모든 t에 대한 집합을 나타낸다.&lt;/li&gt;&lt;li&gt;t는 튜플변수로서, t[A]는 속성 A에 대한 튜플 t의 값을 나타낸다&lt;ul&gt;&lt;li&gt;T[ID], t[dept_name], t[salary]&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;t&amp;nbsp;∈ r 은 릴레이션 r에 t가 속함을 나타낸다.&lt;/li&gt;&lt;li&gt;P는 식(formula)으로서, predicate calculus와 유사하다.&lt;/li&gt;&lt;li&gt;튜플 관계 해석이란, 즉, 사용자가 원하는 정보를 얻는 방법은 명시하지 않고, &lt;u&gt;원하는 정보의 내용&lt;/u&gt;만 기술함을 의미한다.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Pedicate Calculus Formula 는 다음과 같이 정의한다&lt;ul&gt;&lt;li&gt;1. 속성과 상수의 집합&lt;/li&gt;&lt;li&gt;2. 비교 연산자의 집합&amp;nbsp;&lt;/li&gt;&lt;li&gt;3. 연결자의 집합 ; and, or, not&lt;/li&gt;&lt;li&gt;4. 암시 (implication); x&amp;nbsp;⇒ y : x가 참이면 y도 참.&lt;ul&gt;&lt;li&gt;X (참)&amp;nbsp;&amp;nbsp;⇒ Y (참) : 참&lt;/li&gt;&lt;li&gt;&lt;b&gt;X (참)&amp;nbsp;&amp;nbsp;⇒ Y (거짓) : 거짓&lt;/b&gt;&lt;/li&gt;&lt;li&gt;X (거짓)&amp;nbsp;&amp;nbsp;⇒ Y (참) : 참&lt;/li&gt;&lt;li&gt;X (거짓)&amp;nbsp;&amp;nbsp;⇒ Y (거짓) : 참&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;5. 한정자의 집합&lt;ul&gt;&lt;li&gt;어떤 t에 대해~&lt;/li&gt;&lt;li&gt;모든 t에 대해~&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;쿼리 예제 1-1 : &amp;nbsp;salary가 80000보다 큰 instructor의 ID, name, dept_name, salary를 찾아라&lt;ul&gt;&lt;li&gt;&lt;b&gt;{t | t ∈ instructor&amp;nbsp; ⋀ t [salary] &amp;gt; 80000)}&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;쿼리 예제 1-2 : 이전 쿼리에서, 오직 ID 속성값만 출력하라&lt;ul&gt;&lt;li&gt;&lt;b&gt;{t | ∃ s ∈ instructor (t [ID] = s [ID] ⋀ s [salary] &amp;gt; 80000)}&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;(&lt;/b&gt;cf. t는 ID 속성에만 정의되어있으므로, ID만 결과로 출력)&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;쿼리 예제 2 : instructor의 department가 Watson 건물에 있다면, 해당 instructor의 name을 모두 출력하라&lt;ul&gt;&lt;li&gt;&lt;b&gt;{t | ∃ s ∈ instructor (t [name] = s [name] ⋀ ∃ u ∈ department (u [dept_name] = s[dept_name] ⋀ u[building]=“Watson”))}&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;쿼리 예제 3 : 2009 년 가을(fall) 학기에 개설되었거나, 2010년 봄(spring) 학기에 개설되었던 모든 course를 출력하라&lt;ul&gt;&lt;li&gt;&lt;b&gt;{t | ∃ s ∈ section (t [course_id ] = s [course_id ] ⋀ s [semester] = “Fall” ⋀ s [year] = 2009 v ∃ u ∈ section (t [course_id ] = u [course_id ] ⋀ u [semester] = “Spring” ⋀ u [year] = 2010)}&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;Safety of Expressions (표현의 안정성)
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;ul style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;li&gt;튜플 대수 식을 씀으로써 무한정의 릴레이션을 생성할 수 있다.&lt;/li&gt;&lt;li&gt;예를 들어서,&amp;nbsp;{t | ¬ t ∈ r} 은, 릴레이션 r의 속성의 범위가 무한일 경우, 무한 릴레이션을 낳는다. (r에 속하지 않는 튜플의 수!?!! 무한...ㅇㅅㅇ?!!!)&lt;/li&gt;&lt;li&gt;이러한 문제를 해결하기 위해선, 안전한 표현을 위해 허용가능한 식을 제한해야 함.&lt;/li&gt;&lt;li&gt;만약에 t의 모든 컴포넌트가 P에 속하는 릴레이션/튜플/상수 중 한 곳에서 나타난다면, 관계 대수에서 {t | P(t)} 식은 안전하다고 할 수 있다.&lt;/li&gt;&lt;/ul&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;Universal Quantification
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;ul style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;li&gt;Biology 학과에서 개설한 모든 과목을 수강한 모든 학생을 찾아라&lt;ul&gt;&lt;li&gt;{t | ∃ r ∈ student (t [ID] = r [ID]) ⋀&lt;br /&gt;(∀ u ∈ course (u [dept_name]=“Biology”&lt;br /&gt;⇒ ∃ s ∈ takes (t [ID] = s [ID ] ⋀ s [course_id] = u [course_id] ) ) }&lt;/li&gt;&lt;li&gt;cource 릴레이션의 모든 튜플 U에 대해, 만약 u의 dept_name속성 값이 “biology”이면, 학생 ID와 course_id를 포함하는 takes 릴레이션 튜플이 존재한다.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;&lt;b&gt;Domain Relational Calculus
&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;&lt;span style=&quot;font-size: 18pt;&quot;&gt;&lt;b&gt;

&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style=&quot;font-family:'Helvetica Neue';font-size:14px;&quot;&gt;&lt;li&gt;비절차적 쿼리 언어는 튜플 관계 대수와 그 영향력이 같다.&lt;/li&gt;&lt;li&gt;각 쿼리는 다음과 같은 형식으로 표현된다 :&lt;ul&gt;&lt;li&gt;{ &amp;lt; x1, x2, … , xn &amp;gt; | P(x1, x2, …, xn)}&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;x1, x2, …, xn 은 도메인 변수를 나타낸다.&lt;ul&gt;&lt;li&gt;전체 튜플 값 대신에 속성의 도메인으로부터의 값들을 취함&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;P는 predicate calculus와 유사한, 하나의 식이다.&lt;/li&gt;&lt;li&gt;쿼리 예제 1-1 : &amp;nbsp;salary가 80000보다 큰 instructor의 ID, name, dept_name, salary를 찾아라&lt;ul&gt;&lt;li&gt;&lt;b&gt;{ &amp;lt;i, n, d, s&amp;gt; | &amp;lt;i,n,d,s&amp;gt; ∈ instructor&amp;nbsp; ⋀ s &amp;gt; 80000)}&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;쿼리 예제 1-2 : 이전 쿼리에서, 오직 ID 속성값만 출력하라&lt;ul&gt;&lt;li&gt;&lt;b&gt;{ &amp;lt;i&amp;gt; | &amp;lt;i,n,d,s&amp;gt; ∈ instructor&amp;nbsp; ⋀ s&amp;nbsp; &amp;gt; 80000 } (도메인 관계해석)&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;{ t &amp;nbsp;|&lt;/b&gt; &lt;b&gt;∃ s ∈ instructor (t [ID] = s[ID]&lt;/b&gt; &lt;b&gt;⋀ s[salary] &amp;nbsp;&amp;gt; 80000) }&amp;nbsp;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;쿼리 예제 2 : instructor의 department가 Watson 건물에 있다면, 해당 instructor의 name을 모두 출력하라&lt;ul&gt;&lt;li&gt;&lt;b&gt;{ &amp;lt;n&amp;gt; | ∃ i,d,s ( &amp;lt;i,n,d,s&amp;gt; ∈ instructor ⋀ ∃ b,a (&amp;lt;d,b,a&amp;gt;&amp;nbsp; ∈ department&amp;nbsp; ⋀ b =“Watson”))}&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>Computers/Databases</category>
      <author>emzei</author>
      <guid isPermaLink="true">https://emzei.tistory.com/234</guid>
      <comments>https://emzei.tistory.com/234#entry234comment</comments>
      <pubDate>Mon, 11 Jul 2016 15:09:11 +0900</pubDate>
    </item>
  </channel>
</rss>