zl程序教程

您现在的位置是:首页 >  其他

当前栏目

A-level 计算机科学学习记录:系统软件system software(全英)

2023-04-18 14:25:56 时间

目录

introduction

Operating system

memory management

Interrupt

schedulling

First Come First Serve (FIFO)

Shortest Job First (SJF)

Round Robin (RR)

Shortest Remaining Time

Multi-feedback model

device driver

BIOS

virtual machine


introduction

software is the program (a set of instructions) that can be run by a computer

system software is a type of computer program designed to manage and control the operation of  a computer system. This includes the operating system, device driver and utility programs such as anti-virus software, firewall, back up program, encryption and so on. Oppsitely we have application software such as firefox, microsoft excel... they are the ones we are familiar with.


Operating system

Operating system is defined as a collection of computer programs that manage and control a computer system. It also enables the user to interact with the computer.

In fact, the operating system does many jobs:

1.memory management

2.file and user management

3.resources management (schedulling)

4.provision of platform for application software to run

5.enables interaction with the user

6.allow communication between hardware and the computer via the device drivers

7.provision of utility softwares to ensure that the computer functions at optimum level.


memory management

There are mainly two ways to manage the memory: paging and segmentation.

Paging is when the memory is splitted up into equal-sized sections known as pages. Although this is beneficial to transmission, it splits the program regardless of its program flow, which means that, for example, a while loop block might be splitted into two sections and this slows down the execution speed. Segmentation gets round this problem by using logical division which splits the memory up following the logical flows of programs.

virtual memory

Virtual memory is an area in the secondary storage. It temporarily holds data that is not currently in use when the main memory is nearly full and another program needs to be loaded.

Data is transferred to and from the virtual memory by pages. A problem of this is disk thrawing, which is when pages are swapped so frequently that little time is spent in running the content in the pages, leading to slow response of the computer to user requests. This exacerbates when the virtual memory is filled up.


Interrupt

Interrupt is a signal (request) generated by hardware/software that indicates the processor a process needs attention. So in simple term, it's just a request that draws attention -- same as when a student raises his hand in class.

ISR (interrupt service routine)

The processor checks for interrupts in the interrupt register at the end of a cycle. When a higher priority interrupt is detected, the content held by the registers will be copied into a stack, meanwhile a flag will be set and the appropriate ISR program will be loaded into the main memory. After the ISR completes, the processor checks for further interrupts of higher priority to the original process in the stack. If the eligible interrupt is captured, ISRs will continue to be executed until the interrupts left in the interrup register (IR) have lower priority to the original process. If so, the content stored in the stack will be transferred back to the registers with a reset flag.


schedulling

Before the data and instructions are processed, the order of execution is determined in turns of priority. This is achieved by algorithms. This process is called schedulling and the one that manages this is a schedular. In other words, data and instructions enter the priority queue before being processed, and a schedular determines the priority (order). Is it important? It is very important! Why will we prioritise things before doing them? Because this can significantly improve the efficiency. For example, it is said that homework should be done before doing our own things, otherwise we may not complete the homework on time hence facing punishment from the teachers, and even do badly in the exam.

schedulars prioritise jobs in different standards:

First Come First Serve (FIFO)

This is when jobs are served in chronological order by which they enter the priority queue. Easy to understand and manage

Shortest Job First (SJF)

This is when the job with least estimated processing time is served first. The priority queue is sorted after every execution. This ensures that the computer completes as more jobs as possible. However, this may lead to processor starvation as few long data are processed. Let's find an intelligible example: magine that your boss assign you a set of tasks. If you always do the shortest, easiest job first, you may neglect the critical or valuable ones.

Round Robin (RR)

Each execution is given a time slice. If it expires while the job is not completed, the process will be suspended and the part of the job not yet served will be sent to the end of priority queue. At the same time, the next job will be served. This prevents long data to be served while the others wait meaninglessly.

Shortest Remaining Time

This is quite similar to shortest job first schedular, but it is pre-emptive, which means that the process can be suspended if a higher priority job enters the queue.

For example, job A is served but it is required an input from elsewhere to proceed. In this scenario, the process will be blocked until the required data is available. Simultaneously, the next job will be served. As the data arrive the priority queue, an interrupt will be generated by the job to notice the processor that it is ready to rejoin the queue.

Multi-feedback model

multi-feedback model is highly complicated. This is when there are multiple priority queues and many co-processors. jobs can be moved between queues as needed.


device driver

Device driver is the software that translates hardware instructions into the form that a computer can understand. This enables communication between a computer and hardware. For example, when you are typing, signals are emitted and translated by the device driver so it is sent into the computer system as an interrupt which the processor can recognise. A device driver is only specific to one type of hardware due to the different designs, stuctures and mechanisms.

Device drivers are built into the computer and will be updated automatically so we don't need to worry.


BIOS

BIOS stands for basic input output system. It is the first program that will be run after the computer system is activated. It will do POST (power on self test) to check if all hardware are connected and functional. It will also check whether memory, processor and CPU clock are operational (they can be used).

Types of operating system

Operating systems are specialised for various scenarios.

Multi-tasking operating system: this OS is the one that appears the most frequently in personal general purpose devices. It seemingly does multiple tasks simultaneously by assigning each task a time slice and switches between programs quickly. This is like the roud robin mode.

multi-user operating system: this OS supports multiple user login and provides personal features. This is often used in schools and companies where you need to enter the user name and password to access the public computers. Each user is assgined an access right, which means that some user groups may not be able to access some files in the computers.

Distributed operating system: this is when a set of computers or machines connecting across a network collaborate to complete a task. These machines are regarded as a whole. Big corporations use it, for example Amazon uses it to specialise its machines; E-bay used it... most of the internet companies use it.

Real time operating system: this is used when the tasks needs to be strictly executed with in a time frame. This is used in safety related systems, such as self-driving cars, plane, trains and maybe elevator. Hence, massive and efficent CPUs are required, which makes this type of OS rather expensive.

Embedded operating system: it is utilised in the embedded system of washing machine, kettle and dish washer and so on. Embedded OS is specialised in completing small range of tasks. This makes it excel at these tasks while keeping maufacture cost very low compared to other types of OS. It also consumes significantly lower power.


virtual machine

virtual machine are programs used to simulate the functionalities of a real computer.
Codes of high level programming languages can be translated to intermediate code then translated into machine language by the virtual machine. Intermediate code is the code between real code and object code. The code is independent from the processor architecture.

This is used to create the development environemnt which means that real components are not needed. This saves time and money. For example, a team that designs a game on laptop doesn't need to purchase a laptop solely for deployment of the software, instead, virtual machine can be utilised to simulate the running environment of the laptop, which is cost-effective.

Also, it can protect a computer

Lastly, it runs incompatible software (software that can't be run within the available operating system or environment),