OpenLLM-France/wikimedia huggingface dataset:
# Operating system

The operating system (OS) is specialized computer software that allocates memory and manages system resources. When a computer is turned on, the OS is loaded into memory and works as an abstraction layer between the physical hardware and the software. While the Operating system doesn't perform a specific function it helps other programs run smoothly and efficiently. In this course you will learn about the structure and functionality of operating systems.
Due to the open nature of Wikiversity you are free to browse through these courses at whatever pace you desire. However, before you begin this course you should consider reviewing the material covered in the prerequisite courses (listed below) to ensure that you are prepared to learn this content.
In each lesson there is an objective at the top of the page, review these points and keep them in mind as you go through the lesson. At the end there is an assignment to test your understanding and further explain the material. Once you have finished the entire course you may move on to another course in the unofficial degree.
(Note: Many of these lessons are stubs, and they need a lot of help. Please excuse the mess - and help out if you can!).

## Prerequisites

Prerequisites are courses it is suggested you understand before you attempt this course. If you're having a hard time understanding the material in this course, make sure you understand these prerequisites first.
* Computer architecture

## Lessons

* Principles
* History
* Kernel models
* Operating Systems Structure
* Reality vs. Abstraction
* Boot Loader
* Virtual Memory
* Traps and Interrupts
* Multiprogramming
* File Systems
* Software Management
* Security Principles

## See Also

* osdev.org - A good resource on operating system development.

### Subpages

    Subpages of this page
    Subpages in Draft Space
# Operating computing packages

if you're stuck for a photo, search on flickrCC
ICAU2006A
From the official document:
    "This unit defines the competency required to identify, select and correctly operate three desktop applications for a range of purposes."
Basically, that means ... (translate above into plain english)
You can read more about this unit on the National Training Information Systems Official document for ICAU2006A.
This unit is a pre-requisite for the following qualifications:

## How this unit will help you

After learning and applying the skills required by this unit you'll be able to demonstrate your skills in:
| ELEMENT | PERFORMANCE CRITERIA |
| 1. Use appropriate software | Select software appropriate to perform activity Use software to produce required outcome using a range of features related to the activities Save documents in appropriate directories/folders |
| 2. Access, retrieve and manipulate data | Select and access files Amend and save files according to requirements Produce documents and files that meet organisational needs Save files in appropriate directories/folders Exit software correctly without loss of data |
| 3. Access and use help functions within each application | Identify the help resources available for basic difficulties with the software Access user help documentation and other resources for basic difficulties with the software |
| 4. Use keyboard and equipment | Follow OH&S standards and regulations to avoid injury or illness Use wrist rests and document holders where appropriate Use monitor anti-glare and radiation reduction screens where appropriate Ensure user equipment is maintained and free from defects that could cause injury |
* translate the above elements and performance criteria into plain english and summarise here...

## Ideas for demonstrating this unit

The best way to demonstrate these skills is ...

## Grading

If you are demonstrating this unit as part of a formal course, you might find that the unit is graded (meaning you can not only demonstrate your competence, but can also gain a credit or distinction). Your facilitator may already have set criteria that your college uses. If not, here are some ideas for possible credit/distinction activities that you can discuss with your facilitator:
# Operating system/Boot Loader

This is a lesson in in the course, Operating system, which is a part of The School of Computer Science
* Objective
* Become familiar with a boot loader.
* Learn where the boot loader resides on a disk.
* Learn where the boot loader resides in memory.
* Learn the functions of a boot loader.
* Lesson
* The Boot Loader
* The function of a boot loader, sometimes just called bootloader, is to initialize the hardware, set boot parameters, load a kernel image into RAM, and pass control to the loaded kernel. Some well know boot loaders are grub and uboot. A boot loader can simply be one file that does little preprocessing for the operating system, although some boot loaders are multiple files large and contain much preprocess operations. A boot loader like that needs to preform a loading process called chain loading.
* The Boot Loader's Home
* The boot loader usual resides near the beginning of the disk. Older disk formats like the FAT 12 held the boot loader in the first sector.
* The Boot Loader in Memory
* Assignments
Completion status: this resource is just getting off the ground. Please feel welcome to help!
Previous Lesson
Next Lesson
Course Home Page :
# Operating system/History

This is a lesson in in the course, Operating system, which is a part of The School of Computer Science
* Objective
* History
* To understand why Operating systems not only exist today but why they take the forms they do, one has to have an understanding of the development of computers. The first computers were only designed to do a specific task and weren't for general computing. Later on, when the programmable general purpose computers were invented, it became easier to operate a computer, but these computers still could only run one program before the computer needed to be restarted.
* Soon it was found that it was very useful to not only have a computer that looped indefinitely to monitor certain activities, it was useful to run multiple programs at once. It was decided that a mediator was needed to run all these tasks to make sure everything ran smoothly and so the operating system was born.
* Assignments
Completion status: this resource is a stub, which means that pretty much nothing has been done yet.
Next Lesson
Course Home Page :
# Operating system/File Systems

This is a lesson in in the course, Operating system, which is a part of The School of Computer Science
* Objective
* File Systems
* I/O Basics
* File System History
* Basics and Terminology
* "File Header to Block" Abstraction
* "File Name to File Header" Abstraction
* Caching
* Caching, as a concept, simply refers to the usage of a faster (albeit usually smaller) storage medium to store copied data from a slower medium to allow faster access to data. The trade-off is a decreased reliability of data, although this disadvantage is eliminated when a good caching algorithm is implemented.
* Although a hardware cache exists within and parallel to the processor in a computer system, in theory, any storage medium can serve as a cache for a slower storage medium. The hardware cache itself is slower than general purpose registers but faster than main memory. Thus, it serves as a cache for main memory. In cases when larger amounts of data from secondary storage needs to be cached, the main memory can be used.
* A new type of caching came into play with the advent of the world wide web. A server PC (e.g. web server, FTP server) could now act as a "virtual" storage medium. In this case, a secondary storage medium, presumably providing faster access compared to TCP/IP, could now serve a cache for data acquired through a network (e.g. HTML and images in the case of a web server).
* Consistency and coherency is an important consideration in the design of a cache system. The principle is to maintain consistent data across the storage hierarchy (from registers to network servers) in order to avoid erratic computations. This is a problem commonly noted, although not having a significant effect, in the case of web browsers. Oftentimes, you will need to refresh the page or clear the cache in order to see the most recent images on screen.
* Linking
* Transactions and Journaling Filesystems
* Disk Scheduling
* File Structure, Disk Scheduling
* File: a named collection of bytes stored on disk. From the OS’ standpoint, the
* file consists of a bunch of blocks stored on the device. Programmer may actually
* see a different interface (e.g., records), but this doesn’t matter to the file system
* (just pack bytes into disk blocks, unpack them again on reading).
* Common addressing patterns:
* • Sequential: information is processed in order, one piece after the other.
* This is a common mode: e.g. editor writes out new file, compiler compiles it,
* etc.
* • Random Access: can address any block in the file directly without passing
* through its predecessors. E.g. the data set for demand paging, databases.
* • Content based: search for blocks with particular values, e.g. hash table,
* associative database, dictionary. Not provided by all operating system.
* Distributed File Systems
* Distributed Systems Basics
* RPC: Remote Procedure Call
* NFS
* Andrew FS
* Bayou FS
* Coda FS
* 2-Phase Commit
* Assignments
Completion status: this resource is a stub, which means that pretty much nothing has been done yet.
Previous Lesson
Next Lesson
Course Home Page :
# Operating system/Job of an Operating System

This is a lesson in in the course, Operating system, which is a part of The School of Computer Science
* Objective
* Job of an Operating System
* Coordination
* The goal of an operating system (OS) is to allow multiple applications and users to work together in fair and efficient ways.
* security - prevent jobs from interfering with one another
* communication - let jobs talk to one another
* resource management - give jobs fair share of resources
* Abstraction / Standard Services
* An operating system provides a set of standard services (or API) for applications to use the various system resources. Instead of forcing every application programmer to know how to write a complicated device driver just to read the CD-ROM, for instance, a modern-day operating system will simply provide a routine to access the device. This not only simplifies the job of an application programmer, but also provides the ability to manage system resources effectively and protects against malicious behavior. We will explore the trade-offs that decisions about operating system designs involve when we introduce the concept of a kernel.
* Operating System Principles
* OS as illusionist
* Make hardware limitations disappear. An operating system provides an application with the illusion of an infinite amount of memory and an infinite amount of processors.
* OS as government
* Protect users from each other and allocate resources fairly and efficiently.
* OS as complex system
* Keep things simple is the key to functionality.
* OS as history teacher
* Learn from the past to predict the future. As the technology progresses, design principles change.
* Assignments
Completion status: this resource is a stub, which means that pretty much nothing has been done yet.
Previous Lesson
Next Lesson
Course Home Page :
# Operating system/Kernel models
## Introduction

The kernel is the name given to the program that does most of the housekeeping tasks for the operating system. The boot loader hands control over to the kernel, which initializes the various devices to a known state and makes the computer ready for general operation.
After preparing the hardware for use, the kernel provides an abstraction layer between the hardware and software running on the system. Through an application programming interface (API), software can request the kernel to perform hardware tasks, as well as access many common functions. Most current kernels also multi-task the hardware, sharing it between the various processes running on the system.

## Monolithic Kernel
### Design

Monolithic Kernels function with all of the kernel and device drivers inside one address space running in kernel mode. The principle advantage to this approach is efficiency (especially on x86 architectures or 32-bit computer systems where a task switch is a particularly expensive operation). Unfortunately, monolithic kernels suffer the risk of the entire system crashing due to a bug in a device driver, the reason being it is running in the same area with the kernel and other drivers, so, if something fails every other driver and program will be affected.

#### Pros

* Speed
* Simplicity of design

#### Cons

* Potential stability issues
* Can become huge - Linux 4.15 has 20 million lines of code and Windows 10 contains over 40 million lines!
* Potentially difficult to maintain

### Examples

* Traditional Unix kernels (includes BSDs and Solaris)
* Linux
* MS-DOS, Windows 9x
* Mac OS versions below 8.6

## Microkernel
### Design

A Microkernel tries to run most of its services and device drivers in userspace. This can result in an increase in stability and possibly security on machines with a Memory Management Unit. Unlike monolithic kernels, most of the components run in some kind of container, so if something fails, the module or driver will be restarted.

#### Pros

* Stability
* Security
* Potentially more responsive (though often not in practice)
* Benefits for SMP machines

#### Cons

* Additional context switches are usually required
* Slow Inter Process Communication can result in poor performance
* Not helpful for threads

### Examples

* AmigaOS
* Amoeba
* Mach
* Minix
* MorphOS
* L4
* QNX

## Hybrid kernel
### Design

A hybrid kernel combines the concepts of both monolithic kernels and microkernels. It is generally implemented by having a monolithic kernel with a more microkernel like design. When properly implemented it is hoped that this will result in the performance benefits of a monolithic kernel, with the stability of a Microkernel

### Examples

* NT kernel (used in Windows NT, 2000, XP, Vista, 7, 8, and 10)
* XNU (Mac OS X and ios' kernel)
* DragonFly BSD
* BeOS
* Plan 9
# PlanetPhysics/Cubic Diagram
## Cubic diagram

   Failed to parse (unknown function "\xymatrix"): {\displaystyle (1) \begin{matrix} \xymatrix@R=2pc@C=2pc@L=0pt{ A \ar[rr]^*+{f} \ar[dr]^(0.6)*+{\phi^0} \ar[dd]_*+{i} && B \ar[dr]^*+{\phi^2} \ar[dd]|\hole^(0.75)*+{\bar{i}} & \\ & C \ar[dd]_(0.25)*+{j} \ar[rr]^(0.25)*+{g} && D \ar[dd]^*+{\bar{j}} \\ X \ar[rr]|\hole_(0.7)*+{\bar{f}} \ar[dr]_*+{\phi^1} && Q \ar[dr]^(0.35)*+{\phi} & \\ & Y \ar[rr]_*+{\bar{g}} & & R } \end{matrix} \tag{7.5.6} }
# PlanetPhysics/Cubically Thin Homotopy 2
### Cubically thin homotopy

Let $u,u'$ be squares in $X$ with common vertices.
* A {\it cubically thin homotopy} $U:u\equiv _{T}^{\square }u'$
between $u$ and $u'$ is a cube $U\in R_{3}^{\square }(X)$ such that
* $U$ is a homotopy between $u$ and $u',$ i.e. Failed to parse (unknown function "\enskip"): {\displaystyle \partial^{-}_1 (U)=u,\enskip \partial^{+}_1 (U)=u',} #
* $U$ is rel. vertices of $I^{2},$ i.e. Failed to parse (unknown function "\enskip"): {\displaystyle \partial^{-}_2\partial^{-}_2 (U),\enskip\partial^{-}_2 \partial^{+}_2 (U),\enskip \partial^{+}_2\partial^{-}_2 (U),\enskip\partial^{+}_2 \partial^{+}_2 (U)} are constant, #
* the faces $\partial _{i}^{\alpha }(U)$ are thin for $\alpha =\pm 1,\ i=1,2$.
* The square $u$ is {\it cubically} $T$-{\it equivalent} to
$u',$ denoted $u\equiv _{T}^{\square }u'$ if there is a cubically thin homotopy between $u$ and $u'.$
This definition enables one to construct ${\boldsymbol {\rho }}_{2}^{\square }(X)$ , by defining a relation of cubically thin homotopy on the set $R_{2}^{\square }(X)$ of squares.
# PlanetPhysics/Coulomb's Law

Coulomb's law describes the electrostatic force between Electric Charges. Coulomb was the first scientist to measure the force using a torsion balance and he discovered that the attraction or repulsion force increases or decreases inversely as the square of the distance between the charges. As an equation Coulomb's law is given as
   $F=k{\frac {q_{1}q_{2}}{r^{2}}}$
This equation only gives the magnitude of the force, but we must also take into account the direction of the force. Similar to gravity, the force between the charges acts along a line between them. Coulomb's law in vector form is
   ${\vec {F}}=k{\frac {q_{1}q_{2}}{r_{12}^{3}}}{\vec {r}}_{12}$
Some explanation is needed for the variables. $r_{12}$ is the distance between the two charges. The direction of the force is taken into account through the unit vector ${\hat {r}}_{12}$ which will point towards the other charge or in the oppososite direction depending on attraction or repulsion. So to go from the first equation we add the unit vector
   ${\vec {F}}=k{\frac {q_{1}q_{2}}{{r^{2}}_{12}}}{\hat {r}}_{12}$
To get a unit vector we divide the vector between the charges by its magnitude
   ${\vec {r}}_{12}=r_{12}{\hat {r}}_{12}$
so the unit vector is
   ${\hat {r}}_{12}={\frac {{\vec {r}}_{12}}{r_{12}}}$
repacing the unit vector with the above equation yields the vector form of Colomb's Law.
More to come on how Coulomb used a torsion balance to come up with this relationship...
# PlanetPhysics/Cylindrical Coordinate Motion Example of Generalized Coordinates

As an example let us get the equations in cylindrical coordinates
$x=r\cos \phi ,\,\,\,\,\,\,y=r\sin \phi ,\,\,\,\,\,\,z=z,$
$T={\frac {m}{2}}\left[{\dot {r}}^{2}+r^{2}{\dot {\phi }}^{2}+{\dot {z}}^{2}\right].$
${\frac {\partial T}{\dot {r}}}=m{\dot {r}},$
${\frac {T}{\partial r}}=mr{\dot {\phi }}^{2},$
${\frac {\partial T}{\partial {\dot {\phi }}}}=mr^{2}{\dot {\phi }},$ ${\frac {\partial T}{\partial {\dot {z}}}}=m{\dot {z}}.$
$\delta _{r}W=m\left[{\ddot {r}}-r{\dot {\phi }}^{2}\right]\delta r=R\delta r,$
$\delta _{\phi }W=m{\frac {d}{dt}}\left(r^{2}{\dot {\phi }}\right)\delta \phi =\Phi r\delta \phi ,$
$\delta _{z}W=m{\ddot {z}}\delta z=Z\delta z;$
or
$m\left[{\frac {d^{2}r}{dt^{2}}}-r\left({\frac {d\phi }{dt}}\right)^{2}\right]=R,$
${\frac {m}{r}}{\frac {d}{dt}}\left(r^{2}{\frac {d\phi }{dt}}\right)=\Phi ,$ $m{\frac {d^{2}z}{dt^{2}}}=Z.$
# PlanetPhysics/D'Alembert and D. Bernoulli Solutions of Wave Equation

Let's consider the d'Alembert's solution
   ${\begin{matrix}u(x,\,t)\,:=\,{\frac {1}{2}}[f(x\!-\!ct)+f(x\!+\!ct)]+{\frac {1}{2c}}\int _{x-ct}^{x+ct}g(s)\,ds\end{matrix}}$
of the wave equation in one dimension in the special case when the other initial condition is
   ${\begin{matrix}u'_{t}(x,\,0)\,:=\,g(x)\,\equiv \,0.\end{matrix}}$
We shall see that the solution is equivalent with the solution of D. Bernoulli.\\ \\
We expand the given function $f$ to the Fourier sine series on the interval \,$[0,\,p]$: $f(y)\,=\,\sum _{n=1}^{\infty }A_{n}\sin {\frac {n\pi y}{p}}\quad {\mbox{with}}\;\;A_{n}={\frac {2}{p}}\int _{0}^{p}f(x)\sin {\frac {n\pi x}{p}}\,dx\quad (n=1,\,2,\,\ldots )$ Thus we may write
   ${\begin{matrix}{\begin{cases}f(x\!-\!ct)=\sum _{n=1}^{\infty }A_{n}\sin \!\left({\frac {n\pi x}{p}}-{\frac {n\pi ct}{p}}\right)=\sum _{n=1}^{\infty }A_{n}\left(\sin {\frac {n\pi x}{p}}\cos {\frac {n\pi ct}{p}}-\cos {\frac {n\pi x}{p}}\sin {\frac {n\pi ct}{p}}\right),\\f(x\!+\!ct)=\sum _{n=1}^{\infty }A_{n}\sin \!\left({\frac {n\pi x}{p}}+{\frac {n\pi ct}{p}}\right)=\sum _{n=1}^{\infty }A_{n}\left(\sin {\frac {n\pi x}{p}}\cos {\frac {n\pi ct}{p}}+\cos {\frac {n\pi x}{p}}\sin {\frac {n\pi ct}{p}}\right).\end{cases}}\end{matrix}}$
Adding these equations and dividing by 2 yield
   ${\begin{matrix}u(x,\,t)={\frac {1}{2}}[f(x\!-\!ct)+f(x\!+\!ct)]=\sum _{n=1}^{\infty }A_{n}\cos {\frac {n\pi ct}{p}}\sin {\frac {n\pi x}{p}},\end{matrix}}$
which indeed is the solution of D. Bernoulli in the case\, $g(x)\equiv 0$.\\
Note. \, The solution (3) of the wave equation is especially simple in the special case where one has besides (2) the sine-formed initial condition
   ${\begin{matrix}u(x,\,0)\,:=\,f(x)\,\equiv \,\sin {\frac {\pi x}{p}}.\end{matrix}}$
Then \,$A_{n}=0$\, for every $n$ except 1, and one obtains
   ${\begin{matrix}u(x,\,t)\,=\cos {\frac {\pi ct}{p}}\sin {\frac {\pi x}{p}}\,.\end{matrix}}$
Remark. \, In the case of quantum systems one has Schr\"odinger's wave equation whose solutions are different from the above.
# PlanetPhysics/D'Alembertian

The D'Alembertian is the equivalent of the Laplacian in Minkowskian geometry. It is given by:
   $\Box =\nabla ^{2}-{\frac {1}{c^{2}}}{\frac {\partial ^{2}}{\partial t^{2}}}$
Here we assume a Minkowskian metric of the form $(+,+,+,-)$ as typically seen in special relativity. The connection between the Laplacian in Euclidean space and the D'Alembertian is clearer if we write both operators and their corresponding metric.

### Laplacian

   ${\mbox{Metric: }}ds^{2}=dx^{2}+dy^{2}+dz^{2}$
   ${\mbox{Operator: }}\nabla ^{2}={\frac {\partial ^{2}}{\partial x^{2}}}+{\frac {\partial ^{2}}{\partial y^{2}}}+{\frac {\partial ^{2}}{\partial z^{2}}}$

### D'Alembertian

   ${\mbox{Metric: }}ds^{2}=dx^{2}+dy^{2}+dz^{2}-cdt^{2}$
   ${\mbox{Operator: }}\Box ={\frac {\partial ^{2}}{\partial x^{2}}}+{\frac {\partial ^{2}}{\partial y^{2}}}+{\frac {\partial ^{2}}{\partial z^{2}}}-{\frac {1}{c^{2}}}{\frac {\partial ^{2}}{\partial t^{2}}}$
In both cases we simply differentiate twice with respect to each coordinate in the metric. The D'Alembertian is hence a special case of the generalised Laplacian.

## Connection with the wave equation

The wave equation is given by:
   $\nabla ^{2}u={\frac {1}{c^{2}}}{\frac {\partial ^{2}u}{\partial t^{2}}}$
Factorising in terms of operators, we obtain:
   $(\nabla ^{2}-{\frac {1}{c^{2}}}{\frac {\partial ^{2}}{\partial t^{2}}})u=0$
or
   $\Box u=0$
Hence the frequent appearance of the D'Alembertian in special relativity and electromagnetic theory.

## Alternative notation

The symbols $\Box$ and $\Box ^{2}$ are both used for the D'Alembertian. Since it is unheard of to square the D'Alembertian, this is not as confusing as it may appear. The symbol for the Laplacian, $\Delta$ or $\nabla ^{2}$, is often used when it is clear that a Minkowski space is being referred to.

## Alternative definition

It is common to define Minkowski space to have the metric $(-,+,+,+)$, in which case the D'Alembertian is simply the negative of that defined above:
   $\Box ={\frac {1}{c^{2}}}{\frac {\partial ^{2}}{\partial t^{2}}}-\nabla ^{2}$
# PlanetPhysics/Cross Product

The cross product or vector product is defined by
$\mathbf {A} \times \mathbf {B} =\left(A_{y}B_{z}-A_{z}B_{y}\right)\mathbf {\hat {i}} +\left(A_{z}B_{x}-A_{x}B_{z}\right)\mathbf {\hat {j}} +\left(A_{x}B_{y}-A_{y}B_{x}\right)\mathbf {\hat {k}}$
Like the dot product, it is useful to look at its geometric definition and properties. Instead of the cosine of the angle between the two vectors the cross product is defined geometrically as
$\mathbf {A} \times \mathbf {B} =\left|\mathbf {A} \right|\left|\mathbf {B} \right|\sin \theta \mathbf {\hat {n}}$
It is important to see that the unit vector $\mathbf {\hat {n}}$ is normal to the plane defined by the two vectors with the direction determined by the right hand rule.
It can be easier to remember the definition of the cross product with the determinant formulation
$\mathbf {A} \times \mathbf {B} =\left|{\begin{matrix}\mathbf {\hat {i}} &\mathbf {\hat {j}} &\mathbf {\hat {k}} \\A_{x}&A_{y}&A_{z}\\B_{x}&B_{y}&B_{z}\end{matrix}}\right|=\left(A_{y}B_{z}-A_{z}B_{y}\right)\mathbf {\hat {i}} +\left(A_{z}B_{x}-A_{x}B_{z}\right)\mathbf {\hat {j}} +\left(A_{x}B_{y}-A_{y}B_{x}\right)\mathbf {\hat {k}}$