=== Part 01 === [0:06] Byungkwan Jung: All right. [00:09] Byungkwan Jung: So, today we are going to proceed to the Chapter Two, the operating system structure. So, this is our second second chapter here, so welcome back. [00:28] Byungkwan Jung: So what we are going to do is go over the chapter objectives and proceed with each of the topics. [00:39] Byungkwan Jung: So, here we have the we have a chapter of the Chapter Two to describe the services and operating system provides to users, processes, and the systems, and also that we discuss the various ways of the structuring and operating systems. [00:57] Byungkwan Jung: And then we to explain the how operating systems are installed and customized to the to the roots. [01:06] Byungkwan Jung: Operating systems provide an environment where the programs execute. Think of the operating system as a service provider. Applications constantly request services, the operating system responds. The first service that you'll be looking into is the user interface. [01:24] Byungkwan Jung: where almost every operating system provides a way for a user to interact. The command line interface, graphic interface, the batch interface. Without these interfaces, interacting with the computers will be very difficult. [01:41] Byungkwan Jung: Next is a program execution. The operating system must load the programs into the memory, start the execution, monitor the execution, and terminate the programs. Like when you double-click Chrome, operating system loads Chrome into the memory and begins execution like that. [02:00] Byungkwan Jung: And input-output operations. Programs frequently need to input and output. That means reading files, writing files, using these keyboards, and displaying information. Operating system provides safe and consistent ways to perform these operations. [02:19] Byungkwan Jung: Another. [02:20] Byungkwan Jung: Import services are file system manipulation. [02:26] Byungkwan Jung: Creating files, deleting the files, renaming the files, search files, set permissions, these kind of these operations. Without these system supports, the application would have to understand raw disk sectors. The operating system hides that complexity. [02:44] Byungkwan Jung: Communications processes often needs to exchange information, like browser communicating with web servers, chat application, exchanging messages, processes, and sharing memory. The operating system facilitates these communications errors. [03:05] Byungkwan Jung: The error detection error can occur everywhere in CPU, memory, storage devices, network, and user programs. Operating system constantly monitors these failures, like division by zeros or the illegal memory access or device failures, when errors occur. [03:24] Byungkwan Jung: Opera system attempts to recover or safely terminate the affected processes. [03:31] Byungkwan Jung: Debugging, debugging facilities. [03:34] Byungkwan Jung: The operating system often provides tools that help programs to diagnose problems. This becomes important later when discussing debugging and crash analysis. [03:51] Byungkwan Jung: This slide discusses service that helps the operating systems itself, like resource allocation. [03:59] Byungkwan Jung: We have, we do not have it, we don't have unlimited resources. They are all limited, like CPU cycles, memory storage, and devices. If multiple users or programs need resource simultaneously, who decides? [04:14] Byungkwan Jung: Opera Assistance. [04:16] Byungkwan Jung: Accounting operating system tracks resource usages, like who used CPU type, how much memory was consumed, and which user accessed storages. Accounting becomes especially important in shared system and the cloud environment. [04:35] Byungkwan Jung: Protection and security, where the protection controls access security defense against attacks like user authentication and permission checking and malware differences, malware defense. These mechanisms help maintain the system integrities. [04:58] Byungkwan Jung: We are looking at the figure that summarizes the operating system service that we have discussed. Notice how everything revolves around the operating systems. Applications interact the operating system, user interact the operating system, hardware resources are managed by the operating system. These visualizations reinforce the central theme [05:20] Byungkwan Jung: Of the operating systems, so the operating system is the intermediary, where applications rarely interact directly with hardware. Instead, the application directly operating system and operating system interact with the hardware. This abstraction makes a software development. [05:40] Byungkwan Jung: easier, safer, and more portable. [05:47] Byungkwan Jung: We look into these operators as the interface, the command line interface, or command interpreter. [05:57] Byungkwan Jung: or known as shell. [05:59] Byungkwan Jung: Instead of clicking icons, it uses it needs users to type commands. [06:07] Byungkwan Jung: Like some, so you can have access through the Windows command prompt with a PowerShell or a Linux bash or the Unix shell. [06:17] Byungkwan Jung: The shell performs a simple task, like read command, interpret the command, and execute the command. [06:27] Byungkwan Jung: It will also, this kind of a, for these kind of shells and these command line interface. [06:39] Byungkwan Jung: New features have often been added without the modifying the shell itself. The commands may simply invoke some external programs. [06:51] Byungkwan Jung: What you see is a figure talks about the Borne shell command interpreter. Historically, the Borne shell became one of the most influential Unix shells. Many modern shells inherit the idea from it. [07:07] Byungkwan Jung: like Bash, Corn Shell, and Z Shell. [07:11] Byungkwan Jung: The shell acts as a Mihir between the user command and the operating systems. Notice how commands eventually results in the system calls and the kernel activities. The shell itself is not an operating system, though. It is a program that uses the operating system services. [07:30] Byungkwan Jung: Another that we have to look at is a graphic user interface. Most users interact with the operating system using the graphic user interface, like Windows Desktop, Mac OS, Linux Gnome, and KDE as such. These GUIs are using Windows icons, menus, and pointers, and often called as the disk. [07:52] Byungkwan Jung: Top metaphor file that appears as icons, folders appear as directories, and the mouse actions are triggered in commands. Historically, these graphic user interface concepts originated from the Xerox part. Many later systems adopted these ideas. [08:11] Byungkwan Jung: like Macintosh and Windows and modern Linux desktops. [08:18] Byungkwan Jung: Modern operating system supports both with a command line interface and a graphic user interface. They each serving the different users and the task. [08:33] Byungkwan Jung: Touchscreen interfaces is also here. [08:42] Byungkwan Jung: Play. [08:47] Byungkwan Jung: Nowadays, smartphones and tablets change the user interface designs from the traditional mouse interactions to the impractical ones. [08:58] Byungkwan Jung: Touchscreen interfaces users interact through the gestures, like taps, swipes, pinches, and drags. You also can have some virtual keyboards replace the physical keyboards, or voice assistant providing another interface layer. === Part 02 === [00:50] Byungkwan Jung: like Siri, Google Assistant, and Alexa. These interfaces are optimized for the mobilities and conveniences. Of course, next we have the macOS graphic user interface. Now, it also it has it has icons, windows, the menus, and desktop metaphors. [01:11] Byungkwan Jung: All of these elements of the hide operating system complexities and the users focus on the task rather than the system internals. And interestingly, underneath this graphic interface is still a Unix-based operating system. And this demonstrates important ideas. The different interface can exist on top of the same operating system cores. [01:37] Byungkwan Jung: System calls provide the programming interface to the operating system services. This concept absolutely is fundamental, and the application cannot directly control the hardware. Instead, they request the service from the operating systems. Those requests are like opening the files. [01:58] Byungkwan Jung: create the process, allocating the memory, and sending the messages. Most programmers do not invoke system calls directly. Instead, they use what we call as APIs, the Application Programming Interface. [02:14] Byungkwan Jung: Such as Windows 32 API that is used in Windows, POSIX API that is used in Linux, and the Mac OS and Java API that is used by the Java programs. [02:27] Byungkwan Jung: These APIs eventually invoke the system calls behind the scene. [02:34] Byungkwan Jung: This is the example of the system calls that are how is, I mean, this seems like very simple, but many systems system calls occur here. Typical sequence is that you open up a source file and open a destination file, the reading data, the write data, and close the source data. [02:56] Byungkwan Jung: At A cross-destination file, each operation requires operating system involvement. Notice how frequently applications depend on the operating system services. Even simple tasks involve multiple system calls. This slide introduces the standard API example. [03:16] Byungkwan Jung: The key idea here is that application call API functions and API translates requests into a system calls. This provides a separate advantages such as simplicity, portability, and an abstraction. For simplicity, progress user friendly function name instead of the actual system call. [03:37] Byungkwan Jung: And the portability is application becoming easier to move between the systems and abstraction because the details are remaining hidden. Think of the API as a translator between the applications and operating system services. The application developer focuses on the functionalities and the operating system handles the hardware interactions. [04:00] Byungkwan Jung: The this separation is the one of the reasons the modern software development is a manageable. [04:12] Byungkwan Jung: On the previous slides, we learned that application requests a request operating system service through the system calls. Now, the question becomes, how does the operating system know which service is being requested? The answer is the system call numbers. Every system call is assigned. [04:31] Byungkwan Jung: a unique identifier. Think of it as calling a customer service. So instead of saying, I need help, you select, press 1 for the billing, press 2 for the technical support, press 3 for the console information. The operating system does something very similar. Each system call receives. [04:51] Byungkwan Jung: A unique, not a unique number here, like open files, create process, array the file, allocate memory, each corresponds to a different entry. System call interface is a is a something like a the table mess system call number to a specific kernel function. [05:12] Byungkwan Jung: When an application requests a service, system call number is provided, interface looks up the table, correct kernel function is executed, and results return to an application. [05:27] Byungkwan Jung: Programmers does not need to know anything about the kernel implementation details, memory locations, or hardware instructions whatsoever. The API hides the complexity. [05:42] Byungkwan Jung: Here, we have the figure that illustrates the API, how the API is API and a system call and operating systems are related together. [05:57] Byungkwan Jung: So, Application Program is a software that's written by programmers. [06:04] Byungkwan Jung: like Chrome, Word, Zoom, and the Python programs, and they call the API functions. They like POSIX API or Windows 32 API or Java API. And the API eventually invokes the system call. And finally, operating system kernel [06:23] Byungkwan Jung: is going to be tapped and the kernel performs the requested operations. This layered approach provides simplicity, portability, and security. The applications do not directly manipulate the hardware. Everything is passed through the controlled interface. The architecture is similar. [06:41] Byungkwan Jung: to the many real world organizations, like how the customers communicate with the recession desk and the recession desk talks with the manager and managers discuss it with this service department. [06:55] Byungkwan Jung: Applications never bypass the operating systems. [07:03] Byungkwan Jung: Suppose an application wants to open a file. Is it enough to simply say open the file? No. The operating system needs additional information. [07:15] Byungkwan Jung: Like file name, access mode, and the permissions. [07:19] Byungkwan Jung: And these are called parameters. The question becomes, how do you pass parameters to an operating system? This slide introduces the three methods. Number one, the registers. Parameters are stored directly into the CPU registers. It's fast, it's simple, but it's very limited. [07:39] Byungkwan Jung: because CPUs only contain small number of registers. Number 2 is a memory block. Map parameters stored in a table or block in the memory and address of the block is passed in a register. Linux and Solaris. [07:58] Byungkwan Jung: Commonly used this approach, and advantage is that large number of parameters is supported, and the method #3 is stack. [08:09] Byungkwan Jung: Panels are pushed onto the stack and operating system removes them when processing requests. It's flexible. There's no strict limit on the panel code. [08:23] Byungkwan Jung: The important idea here is that system calls require information. [08:29] Byungkwan Jung: And the operating system must receive the information in a structured manner. [08:38] Byungkwan Jung: The figure demonstrates the memory block parameter passing. Notice this sequence here, the step one, the application phase parameters into memory, and address of parameter block is stored in the register, and then system call is executed and operating system. [08:57] Byungkwan Jung: Follow this address, and the pattern is retrieved. Why do we use this method? Because some system calls require many parameters, like creating processes, like network communications and file operations, passing a memory address, or void register. [09:17] Byungkwan Jung: Limitations. [09:21] Byungkwan Jung: There are types of the system calls that we have a process control. The first category is a process control. Remember, the process is a programming execution. The operating system must manage processes throughout their lifecycle, and a common process control [09:40] Byungkwan Jung: Controls system calls include creating the processes and the terminate the processes, load and execute, and then get a set process attributes, wait for an event, and the memory allocation, debugging supports, locks, and then we have the file. [09:59] Byungkwan Jung: Management, we have the create file, delete file, open, close, read, write, reposition, and then get set file attributes. They are all in the file management section, and then we have these device management. [10:20] Byungkwan Jung: where the devices also require management system support, like printers, keyboards, cameras, and disks. System calls allow programs to request device, release device, read data, write data, and retrieve data. The operating system acts as an intermediary between the application and the entire hardware. [10:42] Byungkwan Jung: We also have the information maintenance for the for retrieve or modify system information. For the communications, the processor often needs to communicate, so the operating system provides a mechanism such as message passing, where the process exchange of messages. [11:05] Byungkwan Jung: For the client server communication and the network applications, a shared memory for a shared memory regions for multiple processes, which is very fast and common in the high-performance systems. [11:22] Byungkwan Jung: And then we have a protection, which is where the system calls control access to resources. Who can access file, who can modify a file, and who can execute a program. Opera systems enforce these policies. [11:39] Byungkwan Jung: So we have the examples of the Windows and Unix system calls. This is just to show that what is the is equivalent in the Unix into the Windows Windows Windows system calls here. I think it will be it will be interesting for you to have a look at it. [11:57] Byungkwan Jung: And here we have the slide demonstrate the important concept. Let's say that we have a C program calls, like a printf hello world. Students often assume that printf is the system call. Actually, it is a library function. So the C library of processes of formatting [12:17] Byungkwan Jung: Eventually, it invokes the right function, which is the actual system call. This illustrates the application invoked the library function that invokes the system call to access to have a kernel and make a change. [12:36] Byungkwan Jung: Here, we have an example of the MS-DOS, which is historically important, and it's a very simple architecture. It's a single tasking allows the one program execute at a time. [12:53] Byungkwan Jung: There is no true multitasking in the MS DOS here. When a program launches, it occupies memory, most existing contents are overrated. [13:04] Byungkwan Jung: and the shell disappears temporarily and the program exits and the shell already loads. The advantage is that simple and low overhead, where the disadvantage is that limited functionality and the poor multitasking supports is not suitable for the modern day workloads. [13:24] Byungkwan Jung: Next, we have the example of the FreeBSD that represents a modern Unix style of operating systems. Unlike MS DOS, multitasking is supported, so it allows the users to log in, and the shell will start, and it executes in a fork; it will be forking and creating multiple new processes. [13:45] Byungkwan Jung: And then execute a desired program, and the parent shell may wait or continue accepting the commands. This design allows multiple processes to coexist simultaneously, and you exit the code with the communication communicate results with the exit code zero. [14:05] Byungkwan Jung: then is a success, exit code is greater than the zero, then is an error condition. This mechanism remains common in Linux and Unix systems today. [14:16] Byungkwan Jung: System programs here provide a convenient environment for the development and execution. Interestingly, the most users interact with the system programs far more often than the system call, like file manipulation programs, like copy, move, and rename, and delete. [14:36] Byungkwan Jung: and status information of programs that displays system information. Programming language supports for compilers, assemblers, and debuggers, which you all use a lot. And the program loading execution is a tool that prepared application for execution and communication programs for the emails. [14:56] Byungkwan Jung: messaging and the networking utilities, most users view these programs as a part of the operating systems. [15:06] Byungkwan Jung: File management is a programs that create, file, delete, copy, rename, and print files. And these also have these commands like a Linux CP command, Linux MV command, and status information programs that supports the current delete current dates, memory usages, and disk usages, and the number of users. [15:27] Byungkwan Jung: And then registry, where configuration databases are storing operating system settings. [15:36] Byungkwan Jung: And then file modification programs, like, like text centers, search utilities, text transformation tools, I mean, like, like for the notepads, like VIMs, EMX, and they are similar, they are the similar ones. [15:54] Byungkwan Jung: For the program language supports, we have the GCC, like a CLang and the Java compilers. They are being the ones that converts the source code into the executable programs. Program loading execution, including loaders, linkers, and debuggers, which are preparing programs for the execution, and communication programs that provide the communication, like an email, web [16:16] Byungkwan Jung: browsers, remote logins, and the file transfers. Without these programs, using modern computers will be much more difficult than before. [16:32] Byungkwan Jung: Continuing our discussion on the system programs, this slide introduces the two important categories like the back-end services and application programs. Back-end services are these are programs operate so that behind the scene many start automatically when the operating system is booted. [16:52] Byungkwan Jung: Users may not even realize they are running, like process scheduling services, printing services, disk changing utilities, logging services, and network services. Some services start, complete their task, and terminate. Others remain active from the system startup until the shutdown. [17:12] Byungkwan Jung: Now. [17:16] Byungkwan Jung: In Linux, the Linux systems, these are commonly called as statements, like... [17:23] Byungkwan Jung: SSHD, cron, and syslog. In systems, in Windows, they are often called as services. An important observation here is that these programs generally execute in the user mode, not in the kernel mode, even though they support the operating system functionalities. [17:44] Byungkwan Jung: They are not part of the kernel itself. [17:48] Byungkwan Jung: Application programs are the programs the users intentionally run, like Microsoft Word, like Chrome, Zoom, Photoshop, and such. Applications focus on solving user problems rather than managing the operating systems. Think of the operating system as a city and a background service as a... [18:08] Byungkwan Jung: Public utilities and application programs are businesses that a citizens visit. [18:17] Byungkwan Jung: Designing operating systems is one of the most challenging tasks in computer science. Unlike solving the math equations, there is no single correct answer. Different operating systems use different design. The first step in operating system design is defining the goals. [18:38] Byungkwan Jung: The 2 categories appear on this slide here. User goal, what do users want? Typically, for convenience, reliability, safety, performance, and the ease of learning is what we want. Most users care about results. They do not care how the scheduling hours work internally. [18:57] Byungkwan Jung: They simply want the systems to function correctly. [19:01] Byungkwan Jung: And we have system goals. What do developers want? Typically, it's about the maintainabilities, flexibility, reliabilities, efficiency, and scalabilities. Developers must balance the many competing requirements here. For example, system optimized solar for the speed may become difficult to maintain. [19:24] Byungkwan Jung: Systems optimized solely for the flexibility may sacrifice performance. Operating system design is therefore a constant balancing act. [19:37] Byungkwan Jung: This slide introduces the fundamental software engineering principles. [19:44] Byungkwan Jung: Separation of the policies and the mechanism. Since often confuse these terms, let us define them carefully. Policy is what should be done and like which process should receive CPU time next. [20:04] Byungkwan Jung: That is a pause decision. [20:06] Byungkwan Jung: Mechanism is how it's done. Like, how does the operating system switch between processes? This is a mechanism. [20:18] Byungkwan Jung: Consider CPU scheduling. [20:22] Byungkwan Jung: Policy would be to choose highest priority processes. [20:28] Byungkwan Jung: Like for the mechanism-wise, you'll be talking about context switching implementations. Why you separate them? [20:36] Byungkwan Jung: It's about the flexibilities. Suppose tomorrow we decide instead of a highest priority, we want round-robbing scheduling. If the policy and mechanism are separated, changing scheduling strategies becoming easier. [20:53] Byungkwan Jung: This principle appears throughout the operating systems, like memory allocation, process scheduling, and security policies. Separating decisions from implementation improves these kind of maintainabilities. [21:11] Byungkwan Jung: The implementations, how the operating systems are actually written. Historically, in the early operating systems, they were implemented almost entirely in assembly language. Why? Because hardware resources were very extremely limited. And assembly [21:30] Byungkwan Jung: Provided the maximum control. [21:32] Byungkwan Jung: As computers evolved, higher-level languages became practical, like Algo and PLIs. Today, most operating systems use C&C. However, operating systems rarely use one language exclusively. Typical structures. [21:52] Byungkwan Jung: Like low level components, assembly languages, kernel cores in C, and system utilities are certain in C and Python, shell scripts, and other languages. The other advantages of the higher languages are for the easier maintenance, faster development, and the better portabilities. This advantage is... [22:11] Byungkwan Jung: the potential performance overhead and although the model compilers are greatly reduced this issue. This slide also mentions about the emulation. Emulation allows one system to imitate another, like running ARM software on a X8186 software. [22:32] Byungkwan Jung: This becomes important virtualization and compatibility systems. [22:39] Byungkwan Jung: Operating system structures. Modern operating systems are extremely large software systems. There are millions of lines of code. Because of this complexity, developers need organizational strategies. This slide introduces several major structures, like simple structures. [22:59] Byungkwan Jung: like MS-DOS, non-simple structures like Unix, layer structure, layer structures, and then microkernel structures, and modulars are, there are some of the things called module structures and hybrid structures. [23:21] Byungkwan Jung: As we examine these structures, pay attention to the performance, maintainability, security, and the flexibilities, because every structure involves trade-offs. The first one is the MS-DOS that represents simple operating system structure, and goal is the maximum functionality in a minimum space. [23:41] Byungkwan Jung: Remember, early computers had extremely limited memory, developers prioritized compactness. The problem is the MS-DOS was not strongly modularized, components were not clearly separated, and applications could often access hardware directly. Advantage is that it's simple and fast and low overhead. [24:03] Byungkwan Jung: Disadvantage, though, is the portable maintainabilities, limited protections, weak modularities, and difficult expansions. As operating system grew more sophisticated, stronger structure organization became necessary. Next is the Unix. [24:22] Byungkwan Jung: Unix improved organizations compared to the MS DOS. [24:27] Byungkwan Jung: There are two components, system programs and kernel. [24:32] Byungkwan Jung: System programs provide the user-facing functionalities, and the kernel provides core operating system services like file system memory management, scheduling, and device management. Notice that the Unix still does not fully separate every component into distinctive layers. [24:52] Byungkwan Jung: Distinct layers, however, it provides much better organization than MS DOS. Historically, Unix influenced nearly every modern operating system, including Linux, BSD, and Mac OS. Many concepts introduced Unix remain important today. [25:10] Byungkwan Jung: traditional Unix system structure. This figure illustrates the tradition in Unix organizations. At the top, we have the users, then the system programs, and then the system call interface, then kernel, and then actual hardware. Although it's not fully layered, Unix provides a significant separation between the components [25:30] Byungkwan Jung: Application interacts through the system calls, kernel manages resources, hardware remains hidden. [25:37] Byungkwan Jung: Next is a layered approach. Layer operating systems organized functionally into levels. Think of it as a building. Each floor depends only on the lower floors. Level 0, layer 0 is the hardware. Layer 1 is the basic hardware control. [25:56] Byungkwan Jung: Level 2 is the memory management. Level 3 is the process management, and the higher layers are user interfaces and applications. Advantages are the modularities that each layer performs specific responsibilities, easier debugging. [26:16] Byungkwan Jung: Problems can often be isolated into the particular layer. Easier maintenance for the changes remain localized. Disadvantage is the potential performance overhead. The request may pass through the multiple layers before reaching the hardwares. [26:38] Byungkwan Jung: Microkernel system structure is that keeping the keep kernel small, the only essential functions remain in a kernel. [26:50] Byungkwan Jung: So slide mentions mock as an example, as a famous microkernel design that has influenced many later systems like part of the Mac OS still derived from the mock concept. Communications occurs through the message passing. The user space services exchange messages. [27:12] Byungkwan Jung: The advantages is that easier extension, better portability and reliability in security. Easier extension for the new service can be added without modifying the kernel. Better portability for the adaptations to the new hardware becomes easier. Reliability for the smaller kernel means fewer opportunities for the character. [27:33] Byungkwan Jung: Catastrophic failures, security for the reduce of privileges, called improving the protections. [27:41] Byungkwan Jung: This figure visualizes the microkernel organizations. Notice that many services operate outside of the kernel, like file systems and the device drivers and the networking communications occurs through messages. The drawback. [28:01] Byungkwan Jung: Is that performance overhead? [28:04] Byungkwan Jung: Message travels between the user space and the kernel space. Additional context switches occur, and this may increase the execution time. Thus, microkernels offer the better modularities, but potentially lower performance. This demonstrates A recurring theme that every operating system designed. [28:25] Byungkwan Jung: Involves trade-offs. [28:27] Byungkwan Jung: Modules, many of the modern systems use loadable kernel modules. This combines the benefits of monolithic and layered design. Core operating system functionality remains active. Additional components load dynamically when they are needed. [28:48] Byungkwan Jung: Like device drivers, file systems, and networking modules, the advantages are the flexibilities, maintainabilities, and performance, flexibility for the only necessary components being loaded, and the maintainability for the modules can be. [29:06] Byungkwan Jung: upload, update it independently in the performance because the modules execute within the kernel space and the performance remains high. [29:18] Byungkwan Jung: We have the Solaris modular approach. This figure, it shows that the core kernel exists and additional functionalities attached through well-defined interfaces. This benefits include flexibility, maintainability, and scalabilities. Developers can add new functionality without redesigning entire operating systems. [29:42] Byungkwan Jung: Modern Linux follows a very similar philosophy through loadable kernel modules. [29:49] Byungkwan Jung: Hybrid systems. Most modern opera systems are hybrid systems. Rather than the following one pure model, they combine strengths of the multiple architectures, like Linux, where the monolithic kernels with the modular loading, and the Windows with the primarily monolithic [30:08] Byungkwan Jung: but include the microkernel inspired components. Mac OS combines a microkernel, BSD units, layered architecture, and modular extensions. Why we use a hybrid? Because the real-world systems require balancing, and the pure architectures often cannot satisfy every requirement. [30:30] Byungkwan Jung: So, here we have the Mac OS structure. So, on the top, we have the Aqua, the graphical user interface, and the COCOA, the application development environment, and then we have the system service, and at the core, we have the Darwin kernel that combines the mock. [30:49] Byungkwan Jung: microcardinal concepts and the BSD Unix functionalities. And additional components include input output kits and kernel extensions. This architecture demonstrates why Mac OS is considered a hybrid operating system. It combines multiple design philosophies into A1 integrated system. [31:14] Byungkwan Jung: iOS is an opera system for the iPhone and iPad and many of the related mobile devices. Many students assume that iOS is completely different from the Mac OS. In reality, iOS evolves from many of the same technologies that is used in the Mac OS. [31:36] Byungkwan Jung: This slide states that it is structured on a Mac OS X. This means that iOS inherits many architecture concepts from the Apple's desktop operating systems. However, significant modifications were required. Why? Because the mobile devices have faced different challenges. [31:55] Byungkwan Jung: Lack of battery limitations, smaller memories, touchscreen interface, and wireless communications. [32:05] Byungkwan Jung: And also says that does not run a Mac OS application natively. This is important. Even though they share common ancestry, applications must be specifically designed for the iOS environment. And also we have the different CPU architecture. Historically. [32:23] Byungkwan Jung: Mac computers use Intel processors, iPhone and iPad use ARM processors, and ARM processors prioritize energy efficiencies, low power consumptions, which is essential for the battery power devices. Cocoa Touch API, this framework allows developers to create iOS applications. [32:44] Byungkwan Jung: Think of Cocoa Touch as a toolkit. Developers use it to create the buttons, menus, touch gestures, and animations. Media layers, service layers, provide supports for the graphics, videos, and the audience, like watching YouTube, playing music, and then using the FaceTime. The core services. [33:05] Byungkwan Jung: provide the high level capabilities such as cloud communications, databases, and networking. [33:13] Byungkwan Jung: Four operating systems, we have the that manages the memory processes, devices, and the security. [33:24] Byungkwan Jung: Much of these foundations originated from the Macwest technologies. [33:30] Byungkwan Jung: Android is currently the world's most widely deployed mobile operating systems. It was developed by the Open Handset Alliance with a significant contribution from Google. [33:43] Byungkwan Jung: One major difference from iOS is that Android is largely open source. Manufacturers can customize it. Like Samsung, Google Pixel, OnePlus, and Motorola, they all try to customize it into their own. Android uses a modified Linux kernel. [34:03] Byungkwan Jung: This kernel manages the processes, memory, and the device drivers, which is very similar to the desktop Linux. Additional mobile features like power management and mobile device supports like touch screens, wireless communication sensors, GPS. [34:22] Byungkwan Jung: In the runtime environments, Android applications run within the management environment, like historically, Dalvik Virtual Machine was used, modern versions used the Android runtime application development for the application development, developers commonly write applications using Java or... [34:41] Byungkwan Jung: Kotlin, Kotlin, along with the Android APIs. [34:47] Byungkwan Jung: Android provided many useful libraries, such as SQLite database supports, multimedia processing, web browser frameworks, and the networking supports. [34:59] Byungkwan Jung: The figure illustrates the address of layered architectures. Notice how similar it is the conceptually to the other operating systems. On top, we have the applications like Gmail, Chrome, and Maps. These are the programs used to interact with directly. [35:18] Byungkwan Jung: And then, below that, we have the application framework that provides reusable services like notifications, activity management, and resource management, and below we have the libraries and the runtime, such as multimedia databases, web supports. [35:37] Byungkwan Jung: And, at the bottom, we'll be having Linux kernel for the memory management and process scheduling and device drivers. This demonstrates the recurring operating system principles, the layering, higher levels depend on the lower levels, and lower levels hide the. [35:56] Byungkwan Jung: complexity, application need not understand the hardware details. [36:02] Byungkwan Jung: Software is never perfect. Even operating systems contains bugs. Therefore, debugging becomes essential. [36:13] Byungkwan Jung: This slide defines the debugging as the finding and fixing the errors. Operating system provides several mechanisms to assist debugging. [36:24] Byungkwan Jung: Log box operating systems report important events like errors, warnings, device failures, and security events. Administrators often inspect the logs first when troubleshooting. Core dump. [36:43] Byungkwan Jung: is when we have the applications crashes. The operating system may capture the memory contents, register values, execution states, these information stored in a in a Corda file. Developers analyze it to determine why the program has failed. [37:03] Byungkwan Jung: Crash dump is where the operating system, when the operating system itself crashes, the kernel memories may be captured, and this becomes the crash dump, an extremely valuable for the operating system developers. Debugging is not. [37:22] Byungkwan Jung: only about crashes. Sometimes systems work correctly but performs poorly. Performance tuning becomes important. [37:34] Byungkwan Jung: We have what is called as a Kernighan's law, where debugging is twice as hard as writing the code in the 1st place. This highlights the why simple maintainable designs are valuable. [37:53] Byungkwan Jung: Performance tuning. [37:56] Byungkwan Jung: Performance tuning means improving the system efficiency. The first step is identifying the bottlenecks. Bottleneck is a component limiting overall performance, like CPU saturations, memory shortages, slow storages, and network congestion. [38:15] Byungkwan Jung: Operating systems provide tools for monitoring behaviors. This includes like top H top and VM stats and IO stats for the Windows, like the task managers and performance monitors and resource monitors. These tools allow administrators to answer the questions such as, [38:35] Byungkwan Jung: which process uses the most CPU, which process consumes the memory, which device causes delay. We thought the measurement, optimizations become guesswork. The phrase often used in engineering is the measure first, optimize second. [38:55] Byungkwan Jung: D-Trace is a powerful diagnostic framework originally developed for Solaris. It later appears in the FreeBSD and the Mac OS and the related systems. The idea is the allowing the developers to observe system behaviors. [39:13] Byungkwan Jung: While system is running, this is extremely useful because the stopping production system may be impossible. This is called as dynamic instrumentation. DTrace inserts observations points called probes when specific events occur, information is. [39:34] Byungkwan Jung: collected, like monitoring system calls, file accesses, process activities, and scheduling events. The figure demonstrates a tracking execution flow as controls move between the user space and the kernel space. This visibility is extremely valuable during the debugging. [39:58] Byungkwan Jung: This slide shows a D-trace script. You do not need to memorize the syntax. Instead, focus on the concept here. The script measures the CPU running time for processes associated with a particular user. Notice that the D-trace allows us to monitor system behavior dynamically. [40:18] Byungkwan Jung: collect the performance information, and analyze the execution patterns. Traditionally, obtaining these information required modifying kernel or recompiling kernels and rebooting the system. DTrace simplifies the process dramatically. This illustrates a good... [40:39] Byungkwan Jung: This illustrates an important operating system principle: the good observability improves the maintainabilities. [40:48] Byungkwan Jung: System generation is abbreviated as SysGen. Operating systems are designed to support many hardware configurations. However, every computer is different. Therefore, having different CPUs, memory sizes, and storage devices, and the network adapters. [41:09] Byungkwan Jung: During the installations, the operating system gathers the hardware information, and this process helps to configure the system appropriately. Historically, sysgen programs generated kernels customized for the specific hardware. Advantages include efficiency and optimizations. [41:29] Byungkwan Jung: Because for the efficiency, unused functionality is removed for the optimization system is tailored for the particular environment. Modern operating systems often perform much of these configurations automatically. However, the concept remains important. Operating systems still detect and configure [41:48] Byungkwan Jung: Hardware during the installation and the boot. [41:54] Byungkwan Jung: System Boot. [41:57] Byungkwan Jung: System build is a process of starting the computers. Let us walk through it step by step. So once you power on, electricity reaches the hardware and the CPU begins executions. And the step 2, the firmware executes [42:15] Byungkwan Jung: They stored in the ROM or EEP ROM. They historically was is a BIOS, is BIOS, and the modern system is a UEFI, and we have the bootstrap loader, a small program responsible for locating the operating system kernel. Sometimes it is called boot loader. [42:35] Byungkwan Jung: And then we have the kernel loading, where the kernel is copied to the memory and execution is transferred to the operating systems. And then we have the operating systems that initializations, where the kernel initializes the memory management, process management, device drivers, and the file systems. [42:54] Byungkwan Jung: And then we have the user environment starts, the login screens appear, and the system is ready for use. [43:03] Byungkwan Jung: So this chapter discusses the all about the chapter 2 about the operating systems. I hope this chapter was very useful for you to understand the basics of the what the operating system is. Thank you all and I'll see you next week.