<br />
<b>Warning</b>:  Declaration of Jetpack_IXR_Client::query() should be compatible with IXR_Client::query(...$args) in <b>/www/wwwroot/tech.aqarmap.com/wp-content/plugins/jetpack/vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-client.php</b> on line <b>54</b><br />
{"id":47,"date":"2019-08-08T07:32:12","date_gmt":"2019-08-08T07:32:12","guid":{"rendered":"https:\/\/tech.aqarmap.com\/?p=47"},"modified":"2019-11-11T08:00:05","modified_gmt":"2019-11-11T08:00:05","slug":"a-quick-journey-inside-your-smartphone-hardware-how-smartphone-works","status":"publish","type":"post","link":"https:\/\/tech.aqarmap.com\/?p=47","title":{"rendered":"A Quick Journey inside your smartphone hardware (How smartphone works?)"},"content":{"rendered":"\n<p>In the Name of ALLAH, Most Gracious, Most Merciful.<\/p>\n\n\n\n<p>We will have a short journey in the x86 architecture starting from a hardware input till the final output.<\/p>\n\n\n\n<p>This journey will help you understand in a bit of detail how the computer works so if you are a software developer you might find it useful to take such a journey before we start we need to know the main system components.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>Any modern PC, laptop, smartphone or almost any programmable device has main three hardware parts:<\/p>\n\n\n\n<ul><li>The central processing unit (CPU)<\/li><li>The Random access memory (RAM)<\/li><li>Input\/output components e.g. mouse, touch screen, keyboard, sound card ..etc<\/li><\/ul>\n\n\n\n<p>These three components are connected together physically through indirect channels, the first known one how makes this architecture is&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/John_von_Neumann\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>John von Neumann<\/strong><\/a><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"785\" height=\"538\" src=\"https:\/\/tech.aqarmap.com\/wp-content\/uploads\/2019\/11\/von-neumann-architecture-diagram.png\" alt=\"\" class=\"wp-image-48\" srcset=\"https:\/\/tech.aqarmap.com\/wp-content\/uploads\/2019\/11\/von-neumann-architecture-diagram.png 785w, https:\/\/tech.aqarmap.com\/wp-content\/uploads\/2019\/11\/von-neumann-architecture-diagram-300x206.png 300w, https:\/\/tech.aqarmap.com\/wp-content\/uploads\/2019\/11\/von-neumann-architecture-diagram-768x526.png 768w\" sizes=\"(max-width: 785px) 100vw, 785px\" \/><figcaption>The main three parts of the system with an extra declaration.<\/figcaption><\/figure><\/div>\n\n\n\n<p>What important to us at this time is that:<\/p>\n\n\n\n<ol><li>The three parts can send and receive data from\/to each other.<\/li><li>All programs have to be loaded first in RAM, it called random because of that: we can access any byte in it at any time.<\/li><li>The CPU is the brain of the computer,smartphone or Machine.<\/li><li>The CPU usually as almost all computers today have multi-cores, every core can execute specific instructions(some code) independently.<\/li><\/ol>\n\n\n\n<p>Before starting there is an existing note :<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>There is no pure output components!<\/p><\/blockquote>\n\n\n\n<p>How?!<\/p>\n\n\n\n<p>I\u2019ll tell you.<\/p>\n\n\n\n<p>For example, did you think your connected LED\/LCD screen is purely an output device? I meant the non-touch ones.<\/p>\n\n\n\n<p>So tell me how the operating system knows the screen manufacturer and model&nbsp;so?<\/p>\n\n\n\n<p>Sure it stored in the screen itself and this an input.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>Let\u2019s start our journey\u2026<\/p>\n\n\n\n<p>Say you\u2019ve touched your smartphone screen, a visible button on it.<\/p>\n\n\n\n<p>If you don\u2019t know, the screen is different from it\u2019s touch the touch is separate hardware layer above the screen which responsible for detecting your finger touched points and send these data(where and how you touched and\/or release your finger<strong>s<\/strong>) to the next station in our journey, the next station is the touch controller which is a hardware responsible for storing these data and tells the processor that:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>Hey man we have inputs here are you ready to receive these data?<\/p><\/blockquote>\n\n\n\n<p>This action is called CPU external&nbsp;<strong><em>interruption<\/em><\/strong><\/p>\n\n\n\n<p>If the CPU ready, it will read it and go to the fourth station, to be aligned here is the sequence again:<\/p>\n\n\n\n<ol><li>You touched the screen.<\/li><li>Touch information converted to a store-able data and stored in touch controller.<\/li><li>When CPU is ready or any of its cores, data will received and stored inside the core memory say the cache of the CPU.<\/li><\/ol>\n\n\n\n<p>After that the CPU will take action according to the IDT<\/p>\n\n\n\n<p><em>(<\/em><strong><em>I<\/em><\/strong><em>nterrupt&nbsp;<\/em><strong><em>D<\/em><\/strong><em>escriptor&nbsp;<b>Table:<\/b><\/em><em> simply this is a table in the CPU, the kernel of the Operating System fills this table at loading time just after boot) this table tells the CPU when any internal or external interruption happened what to do, every interruption type has its handler in Operating System kernel code.<\/em><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/tech.aqarmap.com\/wp-content\/uploads\/2019\/11\/idt-1024x768.jpeg\" alt=\"\" class=\"wp-image-49\" srcset=\"https:\/\/tech.aqarmap.com\/wp-content\/uploads\/2019\/11\/idt.jpeg 1024w, https:\/\/tech.aqarmap.com\/wp-content\/uploads\/2019\/11\/idt-300x225.jpeg 300w, https:\/\/tech.aqarmap.com\/wp-content\/uploads\/2019\/11\/idt-768x576.jpeg 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>Image contains some of IDT entries in an intel CPU, IDT has up to 256 entry<\/figcaption><\/figure><\/div>\n\n\n\n<p>CPU will say that according to IDT:<br><em>Hey touch handler takes this data it\u2019s for you.<\/em><\/p>\n\n\n\n<p>The operating system formerly it\u2019s kernel is now the current driver.<\/p>\n\n\n\n<p>To the fifth station, this is a layer in the operating system which responsible for drawing the apps UI and also manages the connection between apps and kernel.<\/p>\n\n\n\n<p>This layer takes the information to&nbsp;<strong><em>the current foreground app<\/em><\/strong><\/p>\n\n\n\n<p>And pass it to its parent view through the UI hierarchy, and finally reaches the developer code for the click or touch Listener.<\/p>\n\n\n\n<p>Then the action of updating UI or executing the desired functionality<br>Happen through another journey!<\/p>\n\n\n\n<p>There are some important points that you have to know :<\/p>\n\n\n\n<p>1. at any area of these sequences the action can be prevented from reaching its final destination, here is the developer code, e.g. the OS&nbsp;<strong><em>may not<\/em><\/strong>&nbsp;send these data to the UI Layer because of system lag.<br>2.The Systems (as hardware) built driven by the interruption!<br>3. this Sequence Happens(the interruption itself) many many times duration even one second (not the external interruption), can reach millions of times in a second to be aware the slowest CPU know can run at speed on average 2GH which is 2 billion cycles in a second!<\/p>\n\n\n\n<p>Thanks for reading ?<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">References<\/h4>\n\n\n\n<ol><li>IDT<ul><li><a rel=\"noreferrer noopener\" href=\"https:\/\/wiki.osdev.org\/IDT\" target=\"_blank\">https:\/\/wiki.osdev.org\/IDT<\/a><\/li><li><a rel=\"noreferrer noopener\" href=\"https:\/\/en.wikipedia.org\/wiki\/Interrupt_descriptor_table\" target=\"_blank\">https:\/\/en.wikipedia.org\/wiki\/Interrupt_descriptor_tabl<\/a><\/li><\/ul><\/li><li>GUI Layer (Windowing System)<ul><li><a rel=\"noreferrer noopener\" href=\"https:\/\/en.wikipedia.org\/wiki\/Windowing_system\" target=\"_blank\">https:\/\/en.wikipedia.org\/wiki\/Windowing_system<\/a><\/li><li><a rel=\"noreferrer noopener\" href=\"https:\/\/en.wikipedia.org\/wiki\/Desktop_environment\" target=\"_blank\">https:\/\/en.wikipedia.org\/wiki\/Desktop_environment<\/a><\/li><li><a rel=\"noreferrer noopener\" href=\"https:\/\/web.archive.org\/web\/20080704182940\/http:\/\/learn.clemsonlinux.org\/wiki\/Window_managers_and_desktop_environments\" target=\"_blank\">https:\/\/web.archive.org\/web\/20080704182940\/http:\/\/learn.clemsonlinux.org\/wiki\/Window_managers_and_desktop_environments<\/a><\/li><\/ul><\/li><\/ol>\n","protected":false},"excerpt":{"rendered":"<p>This journey will help you understand in a bit of detail how the computer works so if you are a software developer you might find it useful to take such a journey before we start we need to know the main system components.<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":""},"categories":[7],"tags":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"amp_validity":null,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/tech.aqarmap.com\/index.php?rest_route=\/wp\/v2\/posts\/47"}],"collection":[{"href":"https:\/\/tech.aqarmap.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.aqarmap.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.aqarmap.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.aqarmap.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=47"}],"version-history":[{"count":6,"href":"https:\/\/tech.aqarmap.com\/index.php?rest_route=\/wp\/v2\/posts\/47\/revisions"}],"predecessor-version":[{"id":59,"href":"https:\/\/tech.aqarmap.com\/index.php?rest_route=\/wp\/v2\/posts\/47\/revisions\/59"}],"wp:attachment":[{"href":"https:\/\/tech.aqarmap.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=47"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.aqarmap.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=47"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.aqarmap.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=47"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}