1.0 Week Preview Agenda
After completing this module, you should be able to:
- Describe the basic concept of an Operating System
- Convert between number bases (binary, decimal hexadecimal)
- Write a basic bash shell program
- Write a C program starting from a template
- Use a makefile to compile a C program
- Test C code using bash scripts
1.1 Answer the agenda
1.1.1 Describe the basic concept of an Operating System
Book: The operating system (OS) is a body of software that makes it easier to run a program by by managing the computer's memory and processes as well as all of its software and hardware which it does in many ways.
1. Virtualization: First, it uses a technique called virtualization in which the OS takes a physical resource such as memory and transforms it into a more easy to use and more powerful virtual form of itself (we sometimes call the OS a virtual machine).
- CPU Virtualization: The OS in conjunction with the hardware is able to turn the singe CPU in an infinite number of virtual CPUs which allows many programs to seemingly run at once.
- Memory Virtualization: The OS creates a virtual address space which the OS then maps onto the physical memory of the machine. A memory reference within one running program doesn't affect the address space of another program because in reality, it has a physical address of its own.
2. APIs: Second, the OS also provides interfaces called APIs in order to allow users to tell the OS what to do/make use of the virtual machines such as allocating memory, running a program, or accessing a file. The OS exports a few hundred system calls (ways for program to interact with OS) available to applications.
3. Managing Resources: Third, the OS acts as a resource manager because virtualization allows lots of programs to run (thus sharing CPU), access their own instructions and data (thus sharing memory) and access devices (thus sharing disks). The OS manages the hardware resources in order to efficiently run a program.
Lecture: An operating system refers to the central software that manages and allocates computer resources such as the CPU, RAM, and other devices. It is the middleware between user programs and system hardware. The operating systems have 2 key roles; 1). provides convenience to user by providing a level of abstraction and 2). makes for efficient use of the hardware such as decreasing the amount of wait time between I/O.
1.1.2 Convert between number bases (binary, decimal, hexadecimal)
Converting between decimal to binary is simple. In binary, we are working with base 2. All you need to do is keep dividing by 2 until you have your quotient equal to zero. In order to get the binary, write the remainder from bottom to top.
Converting between decimal to hexadecimal is also quite simple. See figure below.
1.1.3 Write a basic bash shell program
These topics were posted on the weekly learning bulletin but were not taught:
Write a C program starting from a template
Use a makefile to compile a C program
Test C code using bash scripts



No comments:
Post a Comment