Introduction: Difference between revisions

m
2 revisions imported: import new edits from osdev.org wiki
[unchecked revision][unchecked revision]
(Why was that text even there to begin with)
m (2 revisions imported: import new edits from osdev.org wiki)
 
(18 intermediate revisions by 12 users not shown)
Line 2:
Welcome to Operating System development; the great frontier.
 
Not all "make it" in this field, many don't even pass the "Hello World" of OSDevOS development, but perhaps you will go further and create the next Linux? Or Windows? Or are your goals lower - MenuetOS? Or even CP/M?
 
Whatever your goals, OSDev'ing is the great pinnacle of programming. But, you're not alone. In fact, this entire website, including the [http://forum.osdev.org forums] and this Wiki, are dedicated to OSDev'ing. This is not only about great programming skills, but is about community and developing friendships. Be those friendships between fellow forum members or IRQs and processes.
 
What do you need to succeed in OSDevingOSDev'ing? You should read the [[Getting Started]] article. If you are going to use C/C++ as your language of choice, weyou generallyare recommendrequired buildingto build a [[GCC Cross-Compiler]] first. And if you prefer to use other [[Languages]] then it is important to have some similar tools (e.g. compiler) or if there's no such tools it is often only your efforts that can help you. But going along with your preferred language can add some motivation and excitement during your thingwork.
 
Good luck! :)
Do you want to read a step-by-step tutorial to writing a basic kernel you can build upon? You should read [http://osdever.net/bkerndev/Docs/intro.htm Bran's Kernel Development Tutorial], and the article about [[Bran's Known Bugs]]. There is also the Assembler-based [[:Category:Babystep | BabyStep Tutorial]] or, if you don't want that much hand-holding but still want a kickstart, [[:Category:Bare bones tutorials | Bare Bones tutorials]] for several languages. Once you know the basics, you will find even more [[Tutorials]] on various things.
 
Good luck! :)
 
== What is an Operating System? ==
 
An operating system is a software controlling the operation of a computer system and its resources. MajorAmong functionsother ofthings, operatingthere's systemsone mayvery includeimportant criteria common to all operating systems:
 
Capable of loading and executing user programs providing standardized (hardware-independent) input / output interface for them.
 
Major functions of operating systems may include:
 
* Managing memory and other system resources.
* Imposing security and access policies.
* Scheduling and multiplexing processes and threads.
* Launching and closing user programs, and providing basic system services for themdynamically.
* Providing a basic user interface and application programmer interface.
 
Not all operating systems provide all of these functions. Single-tasking systems like MS-DOS would not schedule processes, while embedded systems like eCOS may not have a user interface, or may work with a static set of user programs.
 
An operating system is *'''not*''':
 
* The computer hardware.
Line 42 ⟶ 44:
The ''system calls'' are initiated by user-level programs, for opening files, starting other programs, etc. Each system call handler will have to check whether the arguments passed are valid, then perform the internal operation to complete the request.
 
Most user programs do not directly issue system calls (except for ASMasm programs, for instance), but instead use a ''standard library'' which does the ugly job of formatting arguments as required by the kernel and generating the system call. (For example, the C function ''fopen()'' eventually calls a kernel function that actually opens the file.)
 
The kernel usually defines a few ''abstractions'' like files, processes, sockets, directories, etc. which correspond to an internal state it remembers about last operations, so that a program may issue a session of operation more efficiently.
Line 55 ⟶ 57:
In order to complete those actions, the shell may have to issue numerous system calls, like "open file 'x'; open file 'y' and create it if it doesn't exist; read content from X, write into Y, close both files, write 'done' to standard output".
 
The shell may also be used by programs that want to start other programs but do not want to do this themselves (e.g. completing file patterns like '"*.mp3'", retrieving the exact path of the program, etc.).
 
Modern shells can also have various extra features, such as the following:
 
* Auto-Completion: By pressing the TAB (or any preferred) key, the word the user is typing will be completed to a valid shell command, a file, directory, or something else. Pressing the auto-complete key multiple times cycles through other completion possibilities.
* Character Insertion: The user can move around in what he or she entered by using the arrow keys. When typing new characters in the middle of a sentence, characters will get '"inserted'".
* Shell History: By using the up and down arrow keys, the user can scroll through previous input.
* Scrolling: When there are more lines than the console is high, save the output in a buffer and allow the user to scroll up and down in the console.
* Scripting: Some shells have custom scripting languages. Examples of scripting languages are bashBash or DOS batch.
* ...
 
Line 79 ⟶ 81:
When you are launching into a KDE or Windows session, that is a ''desktop environment'', i.e. a graphical shell providing the functional environment for all lower-level functions.
 
The part of the system responsible for organizing the windows of the various running programs, their resizing / closing gadgets, window borders, scrollbars etc. is the ''Window Manager''.
 
Finally you have the subsystem that does the drawing of control elements, rendering documents on screen etc.; this is commonly called the ''widget library''. However, there are alternatives to widget libraries, usually in the form of declarative languages (e.g., Mozilla's XUL, Qt's QML).
Line 97 ⟶ 99:
* Research. Quite a few operating system projects are started as homework or research projects. While starting an operating system as a homework assignment in a pre-tertiary or first-year environment is generally considered a bad idea (due to short deadlines), a long-term project is quite fine. Research projects are usually undertaken to improve on existing operating systems. A common beginner mistake, however, is to underestimate the time needed to write an operating system from scratch.
 
* To replace the currently available operating systems. Maybe they don't have a particular feature that the developer wants. Maybe they just generally suck (Linux is bloated, Windows is unstable, etc.). This may be for profit; although any returns are likely to be a long time away.
 
* Because it's fun. Low level programming is a fun and exciting task, because you have to do everything. This may seem more difficult (it is, don't worry) but by the same reasons more fun. You know how everything works, how it all fits, and the inner-most workings of your program.
 
Unfortunately, many operating system projects are undertaken for the wrong reasons. See [[Beginner Mistakes]] for a list.
 
== See Also ==
=== Articles ===
 
* [[Required Knowledge]]
* [[Beginner Mistakes]]
 
[[Category:OS Development]]