OpenLLM-France/wikimedia huggingface dataset:
# Operating System Design/Kernel Architecture/Microkernel

The microkernel approach is to define a very simple abstraction over the hardware, with a set of primitives or system calls to implement minimal OS services such as thread management, address spaces and interprocess communication. All other services, those normally provided by the kernel such as networking, are implemented in user-space programs referred to as servers. Servers are programs like any others, allowing the operating system to be modified simply by starting and stopping programs. For a small machine without networking support, for instance, the networking server simply isn't started. Under a traditional system this would require the kernel to be recompiled, something well beyond the capabilities of the average end-user. In theory the system is also more stable, because a failing server simply stops a single program, rather than causing the kernel itself to crash.
However, part of the system state is lost with the failing server, and it is generally difficult to continue execution of applications, or even of other servers with a fresh copy. For example, if a (theoretic) server responsible for TCP/IP connections is restarted, applications could be told the connection was "lost" and reconnect, going through the new instance of the server. However, other system objects, like files, do not have these convenient semantics, are supposed to be reliable, not become unavailable randomly and keep all the information written to them previously. So, database techniques like transactions, replication and checkpointing need to be used between servers in order to preserve essential state across single server restarts.
Microkernels generally underperform traditional designs, sometimes dramatically. This is due in large part to the overhead of moving in and out of the kernel, a context switch, in order to move data between the various applications and servers. It was originally believed that careful tuning could reduce this overhead dramatically, but by the mid-90s most researchers had given up. In more recent times newer microkernels, designed for performance first, have addressed these problems to a very large degree. Nevertheless, the market for existing operating systems is so entrenched that little work continues on microkernel design.

## Examples

* GNU Hurd
* MINIX
# Operating System Design/Kernel Architecture/Monolithic Kernel

The monolithic approach is to define a high-level virtual interface over the hardware, with a set of primitives or system calls to implement operating system services such as process management, concurrency, and memory management in several modules that run in supervisor mode.
Even if every module servicing these operations is separate from the whole, the code integration is very tight and difficult to do correctly, and, since all the modules run in the same address space, a bug in one module can bring down the whole system. However, when the implementation is complete and trustworthy, the tight internal integration of components allows the low-level features of the underlying system to be effectively utilized, making a good monolithic kernel highly efficient. Proponents of the monolithic kernel approach make the case that if code is incorrect, it does not belong in a kernel, and if it is, there is little advantage in the microkernel approach. More modern monolithic kernels such as Linux, FreeBSD and Solaris can load executable modules at runtime, allowing easy extension of the kernel's capabilities as required, while helping to keep the amount of code running in kernel-space to a minimum. It is alone in supervise mode.
The monolithic operating system is the earliest and most common operating system architecture. Every component of the operating system is contained in the kernel and can directly communicate with any other (i.e., simply by using function calls). The kernel typically executes with unrestricted access to the computer system. OS/360, VMS and Linux are broadly characterized as monolithic operating systems. Direct intercommunication between components makes monolithic operating systems highly efficient. Because monolithic kernels group components together, However it is difficult to isolate the source of bugs and other errors. Further, because all code executes with unrestricted access to the system, systems with monolithic kernels are particularly susceptible to damage from errant or malicious code.
# Operating System Design/Preface

Numerous Universities offer courses on the design and programming of Operating Systems Kernels. This textbook is designed for the students of such courses. Please note, however, that while this book is aimed at individuals who hope, either professionally or as a hobby, to work on programming operating systems in the future, it should not be used as an organisational space for creating a new operating system. Rather, this book is aimed at discussing key issues in the design of Operating Systems, and existing theories about doing so effectively, from a Neutral Point of View.
Also, this Wikibook is focused on single-box operating systems. None of the Wikipedia:TOP500 computers are like that — most of them distribute their operating system in the way described in the Building a Beowulf Cluster Wikibook (many boxes in one building), and even more widely geographically distributed systems are also becoming important.
If you are interested in creating new operating systems you might want to check out...
On Wikibooks:
* Subject:Operating systems
* Linux From Scratch
* The Linux Kernel
* Embedded Systems/Real-Time Operating Systems
* Embedded Control Systems Design/Operating systems
* RTEMS for Embedded Software Developers
* Embedded Systems/Atmel AVR/Operating systems and task managers
* X86 Assembly
* Forth
Other Wikis:
* OSDev Wiki
* Plan 9 wiki
* SharpOS wiki
* How to Make a Computer Operating System
Some new OS's:
* MenuetOS project
* C# Open Source Managed Operating System
* TUNES Project: Redefining Computing
* A long list of academic OS development projects
Discussions:
* Writing your own operating system
* "So if I wanted to try and make my own operating system how would I go about it?"
* OS development
A few links and tips: "Create your own Operating System!"
Previous: Contents — Next: Introduction
# Operating System Design/Kernel Architecture

The kernel is the core of an operating system. It is the software responsible for running programs and providing secure access to the machine's hardware. Since there are many programs, and resources are limited, the kernel also decides when and how long a program should run. This is called scheduling. Accessing the hardware directly can be very complex, since there are many different hardware designs for the same type of component. Kernels usually implement some level of hardware abstraction (a set of instructions universal to all devices of a certain type) to hide the underlying complexity from applications and provide a clean and uniform interface. This helps application programmers to develop programs without having to know how to program for specific devices. The kernel relies upon software drivers that translate the generic command into instructions specific to that device.
An operating system kernel is not strictly needed to run a computer. Programs can be directly loaded and executed on the "bare metal" machine, provided that the authors of those programs are willing to do without any hardware abstraction or operating system support. This was the normal operating method of many early computers, which were reset and reloaded between the running of different programs. Eventually, small ancillary programs such as program loaders and debuggers were typically left in-core between runs, or loaded from read-only memory. As these were developed, they formed the basis of what became early operating system kernels. The "bare metal" approach is still used today on many video game consoles and embedded systems, but in general, newer systems use kernels and operating systems.
Four broad categories of kernels:
* Monolithic kernels provide rich and powerful abstractions of the underlying hardware.
* Microkernels provide a small set of simple hardware abstractions and use applications called servers to provide more functionality.
* Exokernels provide minimal abstractions, allowing low-level hardware access. In exokernel systems, library operating systems provide the abstractions typically present in monolithic kernels.
* Hybrid (modified microkernels) are much like pure microkernels, except that they include some additional code in kernelspace to increase performance.
# Operating System Design/Kernel Architecture/Exokernel
## General

An exokernel is a type of operating system where the kernel is limited to extending resources to sub operating systems called LibOS's. Resulting in a very small, fast kernel environment. The theory behind this method is that by providing as few abstractions as possible programs are able to do exactly what they want in a controlled environment. Such as MS-DOS achieved through real mode, except with paging and other modern programming techniques.

## LibOS

LibOS's provide a way for the programmer of an exokernel type system to easily program cross-platform programs using familiar interfaces, instead of having to write his\her own. Moreover, they provide an additional advantage over monolithic kernels in that by having multiple LibOS's running at the same time, one can theoretically run programs from Linux, Windows, and Mac (Provided that there is a LibOS for that system) all at the same time, on the same OS, and with no performance issues.
# Operating System Design/Physical Memory

Physical memory refers to the actual RAM of the system, which usually takes the form of cards (DIMMs) attached onto the motherboard. Also called primary memory, it is the only storage type directly accessibly to the CPU and holds the instructions of programs to execute. Physical memory is linearly addressable; memory addresses increase in a linear fashion and each byte is directly addressable.
Logical Memory (Virtual memory) adds a layer of abstraction over the physical memory, and offers many benefits such as the ability to maintain separate address spaces (per process perhaps), and the ability to use physical memory as a large cache for the physical disk which makes memory appear limitless (upto 2^(bus width)) from the program/programmers perspective.
# Operating System Design/Kernel Architecture/Hybrid kernel

A hybrid kernel is one that combines aspects of both micro and monolithic kernels, but there is no exact definition. Often, "hybrid kernel" means that the kernel is highly modular, but all runs in the same address space. This allows the kernel avoid the overhead of a complicated message passing system within the kernel, while still retaining some microkernel-like features.
# Operating System Design/Paging

In computer operating systems there are various ways in which the operating system can store and retrieve data from secondary storage for use in main memory. One such memory management scheme is referred to as paging. In the paging memory-management scheme, the operating system retrieves data from secondary storage in same-size blocks called pages. The main advantage of paging is that it allows the physical address space of a process to be noncontiguous. Prior to paging, systems had to fit whole programs into storage contiguously which caused various storage and fragmentation problems.
Paging is an important part of virtual memory implementation in most contemporary general-purpose operating systems, allowing them to use disk storage for data that does not fit into physical Random-access memory (RAM). Paging is usually implemented as architecture-specific code built into the kernel of the operating system.
# Pokémon/Pokédex/Cacnea
## Basic Statistics

* National Index: 331
* Johto Index: 331
* Hoenn Index: 119
* Stage: Basic
* Height: 0.4m/1'4"
* Weight: 51.3kg/113.0lb
* Gender Distribution: 50% Male
* Ability: Sand Veil
* Type: Grass
* Species: Cactus
* Egg Group: Plant/Humanshape
* Hatch Steps: 5120
* Catch Rate: 190
* Base Experience: 97
* Max Experience: 1059860
* Hold Item in Advance: Poison Barb: 5%
| | HP | Attack | Defense | Speed | Special Attack | Special Defense |
| Base Stats (RB/Y) | - | - | - | - | - | - |
| Base Stats (GS/C) | - | - | - | - | - | - |
| Base Stats (RS/FL/E) | 50 | 85 | 40 | 35 | 85 | 40 |
| Base Stats (DP/PT/HGSS) | – | – | – | – | – | – |
| Base Stats (BW/B2W2) | – | – | – | – | – | – |
| Base Stats (XY/ORAS) | – | – | – | – | – | – |
| Base Stats (SM/USUM) | – | – | – | – | – | – |
| Base Stats (Sword/Shield/BDSP) | – | – | – | – | – | – |
| Max Stats (RB/Y) | - | - | - | - | - | - |
| Max Stats (GS/C) | - | - | - | - | - | - |
| Max Stats (RS/FL/E) | 304 | 295 | 196 | 185 | 295 | 196 |
| Max Stats (DP/PT/HGSS) | – | – | – | – | – | – |
| Max Stats (B/W/B2W2) | – | – | – | – | – | – |
| Max Stats (X/Y/ORAS) | – | – | – | – | – | – |
| Max Stats (SM/USUM) | – | – | – | – | – | – |
| Max Stats (Sword/Shield/BDSP) | – | – | – | – | – | – |
| Effort Points (Sword/Shield/BDSP) | – | – | – | – | – | – |

## Type Matching

Move types which are good on Cacnea: Bug, Fire, Flying, Ice, Poison Move types which are bad on Cacnea: Electric, Grass, Ground, Water All other move types are normal effectiveness on Cacnea.

## How to Evolve

Cacnea evolves at level 32.

## Moveset

| Level | Ruby / Sapphire Emerald XD / Colosseum | Fire Red / Leaf Green |
| Start | Poison Sting Leer | Poison Sting Leer |
| 5 | Absorb | Absorb |
| 9 | Growth | Growth |
| 13 | Leech Seed | Leech Seed |
| 17 | Sand-Attack | Sand-Attack |
| 21 | Pin Missile | Pin Missile |
| 25 | Ingrain | Ingrain |
| 29 | Faint Attack | Faint Attack |
| 33 | Spikes | Spikes |
| 37 | Needle Arm | Needle Arm |
| 41 | Cotton Spore | Cotton Spore |
| 45 | Sandstorm | Sandstorm |
| 49 | - | Destiny Bond |

### TM/HM

* RS/FL: Attract, Bullet Seed, Cut, Double Team, Facade, Flash, Focus Punch, Frustration, Giga Drain, Hidden Power, Protect, Rest, Return, Sandstorm, Secret Power, Solarbeam, Sunny Day, Toxic

### Breeding

* RS/FL: Acid, Counter, Dynamicpunch, Grasswhistle, Teeter Dance

## Trading Cards

* EX Sandstorm #57 - Cacnea
* EX Sandstorm #58 - Cacnea
* EX Team Magma vs Team Aqua #24 - Team Aqua's Cacnea
| Basic: Cacnea | Stage 1: Cacturne | (No Stage 2) |
# Pokémon/Pokédex/Camerupt
## Basic Statistics

* National Index: 323
* Johto Index: 323
* Hoenn Index: 102
* Stage: Stage 1
* Height: 1.9m/6'3"
* Weight: 220kg/485.0lb
* Gender Distribution: 50% Male
* Ability: Magma Armor
* Type: Fire/Ground
* Species: Eruption
* Egg Group: Ground
* Hatch Steps: 5120
* Catch Rate: 150
* Base Experience: 175
* Max Experience: 1000000
| | HP | Attack | Defense | Speed | Special Attack | Special Defense |
| Base Stats (RB/Y) | - | - | - | - | - | - |
| Base Stats (GS/C) | - | - | - | - | - | - |
| Base Stats (RS/FL/E) | 70 | 100 | 70 | 40 | 105 | 75 |
| Base Stats (DP/PT/HGSS) | – | – | – | – | – | – |
| Base Stats (BW/B2W2) | – | – | – | – | – | – |
| Base Stats (XY/ORAS) | – | – | – | – | – | – |
| Base Stats (SM/USUM) | – | – | – | – | – | – |
| Base Stats (Sword/Shield/BDSP) | – | – | – | – | – | – |
| Max Stats (RB/Y) | - | - | - | - | - | - |
| Max Stats (GS/C) | - | - | - | - | - | - |
| Max Stats (RS/FL/E) | 344 | 328 | 262 | 196 | 339 | 273 |
| Max Stats (DP/PT/HGSS) | – | – | – | – | – | – |
| Max Stats (B/W/B2W2) | – | – | – | – | – | – |
| Max Stats (X/Y/ORAS) | – | – | – | – | – | – |
| Max Stats (SM/USUM) | – | – | – | – | – | – |
| Max Stats (Sword/Shield/BDSP) | – | – | – | – | – | – |
| Effort Points (Sword/Shield/BDSP) | – | – | – | – | – | – |

## Type Matching

Move types which are very good on Camerupt: Water Move types which are good on Camerupt: Ground Move types which are bad on Camerupt: Bug, Fire, Poison, Steel Move types which don't effect Camerupt: Electric
All other move types are normal effectiveness on Camerupt.

## Moveset

| Level | Ruby / Sapphire Emerald XD / Colosseum | Fire Red / Leaf Green |
| Start | Growl Tackle Ember Magnitude | Growl Tackle Ember Magnitude |
| 11 | Ember | Ember |
| 19 | Magnitude | Magnitude |
| 25 | Focus Energy | Focus Energy |
| 29 | Take Down | Take Down |
| 31 | Amnesia | Amnesia |
| 33 | Rock Slide | Rock Slide |
| 37 | Earthquake | Earthquake |
| 45 | Eruption | Eruption |
| 55 | Fissure | Fissure |

### TM/HM

* RS/FL: Attract, Dig, Double Team, Earthquake, Facade, Fire Blast, Flamethrower, Frustration, Hidden Power, Hyper Beam, Overheat, Protect, Rest, Return, Roar, Rock Smash, Rock Tomb, Sandstorm, Secret Power, Strength, Sunny Day, Toxic

### Evolution

* RS/FL: Body Slam, Defense Curl, Howl, Rollout, Scary Face, Stomp

## Trading Cards

* EX Ruby and Sapphire #4 - Camerupt
* EX Dragon #24 - Camerupt
* EX Team Magma vs Team Aqua - Team Magma's Camerupt
* EX Deoxys #4 - Camerupt
| Basic: Numel | Stage 1: Camerupt | (No Stage 2) |
# Pokémon/Pokédex/Budew
## Description

A bud-like pokémon.

## Base Statistics

A Grass and Poison type Pokémon.

## Type Matching

Moves that deal 200% of their damage to Budew: fire, ice, flying, psychic Moves that deal 50% of their damage to Budew: water, electric, fighting, fairy Moves that deal 25% of their damage to Budew: grass
# Pokémon/Pokédex/Buneary
## Description

A small bunnylike pokémon.

## Base Statistics

A Normal type Pokémon.

## Type Matching

Moves that deal 200% of their damage to Buneary: fighting Moves that deal 0% of their damage to Buneary: ghost

## How to Evolve

Buneary evolves into Lopunny.
# Pokémon/Pokédex/Buizel
## Base Statistics

A water type

## Type Matching

Moves that deal 200% of their damage to Buizel: grass, electric Moves that deal 50% of their damage to Buizel: fire, water, ice, steel
# Pokémon/Pokédex/Burmy
## Description

A bagworm-like pokémon.

## Base Statistics

A Bug type Pokémon.

## Type Matching

Moves that deal 200% of their damage to Burmy: fire, flying, rock Moves that deal 50% of their damage to Burmy: grass, fighting, ground
# Pokémon/Pokédex/Cacturne
## Basic Statistics

* National Index: 332
* Johto Index: 332
* Hoenn Index: 120
* Stage: Stage 1
* Height: 1.3m/4'3"
* Weight: 77.4kg/171.0lb
* Gender Distribution: 50% Male
* Ability: Sand Veil
* Type: Grass/Dark
* Species: Scarecrow
* Egg Group: Plant/Humanshape
* Hatch Steps: 5120
* Catch Rate: 60
* Base Experience: 177
* Max Experience: 1059860
* Hold Item in Advance: Poison Barb: 5%
| | HP | Attack | Defense | Speed | Special Attack | Special Defense |
| Base Stats (RB/Y) | - | - | - | - | - | - |
| Base Stats (GS/C) | - | - | - | - | - | - |
| Base Stats (RS/FL/E) | 70 | 115 | 60 | 55 | 115 | 60 |
| Base Stats (DP/PT/HGSS) | – | – | – | – | – | – |
| Base Stats (BW/B2W2) | – | – | – | – | – | – |
| Base Stats (XY/ORAS) | – | – | – | – | – | – |
| Base Stats (SM/USUM) | – | – | – | – | – | – |
| Base Stats (Sword/Shield/BDSP) | – | – | – | – | – | – |
| Max Stats (RB/Y) | - | - | - | - | - | - |
| Max Stats (GS/C) | - | - | - | - | - | - |
| Max Stats (RS/FL/E) | 344 | 361 | 240 | 229 | 361 | 240 |
| Max Stats (DP/PT/HGSS) | – | – | – | – | – | – |
| Max Stats (B/W/B2W2) | – | – | – | – | – | – |
| Max Stats (X/Y/ORAS) | – | – | – | – | – | – |
| Max Stats (SM/USUM) | – | – | – | – | – | – |
| Max Stats (Sword/Shield/BDSP) | – | – | – | – | – | – |
| Effort Points (Sword/Shield/BDSP) | – | – | – | – | – | – |

## Type Matching

Move types which are very good on Cacturne: Bug Move types which are good on Cacturne: Fighting, Fire, Flying, Ice, Poison Move types which are bad on Cacturne: Dark, Electric, Ghost, Grass, Ground, Water Move types which don't effect Cacturne: Psychic
All other move types are normal effectiveness on Cacturne.

## Moveset

| Level | Ruby / Sapphire Emerald XD / Colosseum | Fire Red / Leaf Green |
| Start | Poison Sting Leer Absorb Growth | Revenge Poison Sting Leer Absorb Growth |
| 5 | Absorb | Absorb |
| 9 | Growth | Growth |
| 13 | Leech Seed | Leech Seed |
| 17 | Sand-Attack | Sand-Attack |
| 21 | Pin Missile | Pin Missile |
| 25 | Ingrain | Ingrain |
| 29 | Faint Attack | Faint Attack |
| 35 | Spikes | Spikes |
| 41 | Needle Arm | Needle Arm |
| 47 | Cotton Spore | Cotton Spore |
| 53 | Sandstorm | Sandstorm |
| 59 | - | Destiny Bond |

### TM/HM

* RS/FL: Attract, Bullet Seed, Cut, Double Team, Facade, Flash, Focus Punch, Frustration, Giga Drain, Hidden Power, Hyper Beam, Protect, Rest, Return, Sandstorm, Secret Power, Solarbeam, Strength, Sunny Day, Toxic

### Evolution

* RS/FL: Acid, Counter, Dynamicpunch, Grasswhistle, Teeter Dance

## Trading Cards

* EX Sandstorm #2 - Cacturne
* EX Team Magma vs Team Magma #1 - Team Aqua's Cacturne
| Basic: Cacnea | Stage 1: Cacturne | (No Stage 2) |
# Pokémon/Pokédex/Capsakid
## Description

A bipedal pepperlike pokémon.

## Base Statistics

A grass type Pokémon.

## Type Matching

Moves that deal 200% of their damage to Capsakid: fire, ice, poison, flying, bug Moves that deal 50% of their damage to Capsakid: water, grass, electric, ground

## How to Evolve

Evolves to Scorvillain.

## Notes

Introduced in Pokémon Scarlet and Violet.
# PHP Programming/Code Snippets

Code snippets are useful for any beginners to learn code from.

## PHP 4 & 5
### Basic Level

* echo "the text to print"; - This language construct will echo the text between the quotes. This is not a function but a language construct.
* echo "$var"; - Notice the double quotation marks. Because double quotation marks are used, this will print the value of the variable. If $var="Bobby", this will output:
Bobby
* echo '$var'; - Notice that the quotation marks are now single. This will output the literal keystrokes inside the quotes. The example will output:
$var
* $var="Jericho";echo "Joshua fit the battle of $var."; - Other than substituting the value of a variable for the variable name (and one or two other minor items), double quotes will quote literal keystrokes. So this will output:
Joshua fit the battle of Jericho.
Again, if single quotes were used — 'Joshua fit the battle of $var'; — this would output:
Joshua fit the battle of $var.
* echo $var; - If you only want to print the value of a variable, you don't need quotes at all. If the value of $var is "1214", the code will output:
1214
* require "url"; - This language construct will include the page between the quotes. Can NOT be used with dynamic pages, e.g. require("main.php?username=SomeUser"); would not work. This is not a function but a language construct.
* date("Date/time format"); - Function that returns a date from a Unix Timestamp - where H is the hour, i is the minutes, s is the seconds, d is the day, m is the month and Y is the year in four digits - e.g. date("H:i:s d/m/Y"); would return 12:22:01 10/08/2006 on 10th August 2006 at 12:22:01.
* unlink("filename"); - Function that deletes the file specified in filename.

## PHP 4
### OOP

Include OOP based examples, made by experienced developer

## PHP 5 Only
### Basic Level

Basics, working only on PHP 5.
* file_put_contents("filename", "Text to save"); - Functions that saves the text specified in Text to save to the file specified in filename. Will overwrite existing file contents unless another parameter FILE_APPEND is added.
E.g. file_put_contents("filename", "Text to save"); will write Text to save to filename, but will overwrite existing text whereas file_put_contents("filename", "Text to save", FILE_APPEND); will write Text to save to filename, but will not overwrite existing text (instead it appends).

### OOP

* Input validation by Kgrsajid.
* Advanced Input validation by nemesiskoen.