## Lecture 01 - Introduction to Computer systems **Computer System Structure:** ![[os-lecture-1.drawio.png]] Important points are that - **Machine instructions** - are part of **machine language** consist of Test commands, jump commands (*BRANCH*), transport commands (*MOV*) and arithmetic (*ADD*) and logical commands (*CMP, SHIFT*) - **Instruction set** - represents amount of machine instructions - **Micro programs** and micro code - implement every command are part of **Firmware**, which are pillar for two basic computer architectures (hardware models): 1. Von Neumann architecture / Von Neumann computer which was made from components such as: - Central Processing Unit (CPU) - containing: - CU Control Unit - which fetches instructions into memory and executes them - PU Processing Unit - executes operations - ALU Arithmetic Logical Unit - executes arichmetic operation - Main Memory or RAM - stay machine commands and data to be processed - I/O - interface for inside/outside connection - CPU Bus or System bus - connects all components which has capacity of 32 or 64 bit ![[Pasted image 20240131131516.png]] *Developed by John von Neumann in 1946* 2. Harvard Architecture / Harvard Computers - uses 2 separate memories one for data and other for machine commands, also it has 2 dedicated bus systems which has advantage of twice as many lines available, but in other hand it was additional hardware effort and as wall as separating data from commands was not that much trivial and it is very rarely used today *Developed from 1939 to 1944 at Harvard University* ###### Terminology **Cache** - is fast buffer memory that is used in different storage levels, the closer to the CPI the faster the access speed is, and level can be L1, L2 which implies the smaller the number the faster the cache modern computers have usually up to the 2-3 cache levels ![[Pasted image 20240215191714.png|inlR|300]] *Typical use of cache* - L1 and L2 - mostly on CHIP L3+ outside **Bus system** - is a number of parallel data lines with which as many bits can be transferred in parallel between CPU and main memory (it could be 32-bit or 64-bit). Modern serial bus system such as **QuickPath Interconnection** at Intel or **HyperTransport** at AMD but all of them originated from **Front Side Bus** which was used up to the 2009 **CPU Registers** - is a small but fast set of memory which sits directly on CPU which are also called register, they are needed for executing machine commands and machine instructions which often write their operands into registers or read operands from registers. An example would be: - **Counter Program** which contains the main memory address of the next instructions to be executed - **Instruction Register** - contains the current machine command to be executed - **Stack pointer Register** - refers to the current program stack - **Status register** a.k.a. Program Status Word **PWS** - is used for comparison operations and contain further control bits such as the current mode (user || kernel) **Multicore CPU** (multi-core processors) - are processors with several complete CPUs, where several complete CPUs components with exception of buses and caches are replicated, they are cheaper to develop than the individual CPU. ![[Pasted image 20240215191823.png|inlR|350]] *Multicore CPU example* **Hyper-threading CPU** - is Intel technology in Core i series, where multi-threaded single core processors with multiple program counters and register sets as well as interrupt controllers, which present themselves as multi-core processors compared to the operating system ![[Pasted image 20240215191933.png|inlR|300]] *Intel Chip example: which in most cases use multi-core with hyper-treading* **UMA Unified Memory Access** - allow unified access to system memory at all times **NUMA Non Unified Memory** - allow for non unified memory access meaning multiple threads can read/write memory at the same time. **Die** - is the naked chip or a rectangular semiconductor chip which contain multiple CPUs as well as other components **Chipset** - allows access to storage and external devices, it is usually placed on mother board and it consist of two components such as: - the external devices such as hard drives that are connected via south bridge - the graphic card which is connected over north bridge that is faster - or on main memory which was the case with older motherboards Some CPUs access the north and south bridge via the front side bus or another technology, but newer CPUs already integrate some or all parts of a north bridge for speed reasons. ![[Pasted image 20240215191201.png]] *Simplified architecture of a computer system* **64-bit or n-bit attribute** - means that CPU is designed for parallel processing of **n**-bits also data and address buss width as well as register sizes and instruction sets are of a **n** size. Meaning that for example 64-bit processor has 64 data lines that allow data to be transferred in parallel between CPUs and main memory. ![[Pasted image 20240215191516.png|inlR|300]]![[Pasted image 20240215191531.png|inlR|400]] ##### Types of Operating Systems ![[Pasted image 20240215192105.png]] **Mainframe**, **Server**, **PC** operating system and **Tablet/Mobile OS** - are general purpose or multipurpose OS but not for strict real-time requirements ##### Tasks of Operating Systems OS is intended to hide user/application developer of hardware details. Modern structured operating system encapsulate access to resources which only works via operating system services/functions, it is technically a virtual machine on top of the hardware, and its main task is resource management. Hardware and software resources of computer system are referred to as resources which are processes, processor, main memory, files, and peripheral devices like I/O. We can distinguish between real and virtual OS resources which are virtual main memory, virtual printers, virtual coprocessors ... ![[Pasted image 20240215192652.png]] *Most important resources* Equipment can be classified into few categories like: - **Hardware or software resources** - processor which is HW resource and process which is SW - **Removable and non-removable resources** - such as processors which are removable and printers which can't be removable - **Resources that can be used exclusively or shared** - processor which is exclusive and magnetic disk or hard drive which is shared, all exclusive resources must be ensured to be used without conflict that is managed by OS and decision is made by scheduling algorithm.