2011-01-22 12:07:09 +03:00
# ToAruOS (とあるOS) #
2011-08-22 19:14:22 +04:00
![ToAruOS (logo) ](https://github.com/klange/osdev/raw/master/docs/logo.png )
2012-05-01 04:04:57 +04:00
This is a toy OS based on the POSIX standards. The primary goal of the project is for me to learn POSIX from the system side, understanding the design and constructon of an operating system on x86 hardware, and build a working implementation of the C standard library. Development of とあるOS was managed by the UIUC [SIGOps ](http://www.acm.uiuc.edu/sigops/ ) until May, 2012. While the ultimate goal is a microkernel, we currently have a relatively monolithic kernel.
2011-01-16 04:03:53 +03:00
2012-08-29 09:38:31 +04:00
### Build Status ###
[![Automated build testing provided by Travis CI. ](https://secure.travis-ci.org/klange/osdev.png?branch=master )](http://travis-ci.org/klange/osdev)
2012-09-07 06:46:36 +04:00
### IRC ###
`#toaruos@irc.freenode.net`
2012-05-01 04:04:57 +04:00
## News ##
2011-12-15 01:58:38 +04:00
2012-09-10 07:48:43 +04:00
The Terminal now supprots Unicode text. We also have an editor based loosely on Vim.
2012-02-16 12:02:09 +04:00
## Features ##
とあるOS currently supports a number of important operating system concepts and facilities:
* Processes
* Preemptive multasking
* Kernel threads
* Shared memory
* Through page table mappings
* POSIX-compliant file operations
* Pipes
* Backed by ring buffers
* Signals
* Mostly POSIX-compliant under the loose method
* EXT2 read/write support
* For IDE devices or SATA devices *operating in IDE compatibility mode*
* PS/2 keyboard/mouse support
* Of course, what doesn't?
* Graphical features
* We are hard at work building a window environment that makes use of shared memory
* Currently supports full-screen operation of graphical applications
* Extensive, ANSI-capable terminal
* Includes extensive compatibility with xterm
* Support for 256 colors
* Beautifully rendered anti-aliased text through FreeType (please see the licenses below for included fonts)
2012-09-10 07:48:43 +04:00
* Supports Unicode text (UTF-8 encoded)
2012-02-16 12:02:09 +04:00
* And dozens of other minor things not worth listing here.
2011-12-15 01:58:38 +04:00
2012-09-10 07:48:43 +04:00
## Current Plans ##
The current development focus for the project is networking support.
2011-08-06 10:33:33 +04:00
## Screenshots ##
2012-02-16 12:02:09 +04:00
2011-08-06 10:33:33 +04:00
Here's what とあるOS looks like:
2012-02-16 12:03:12 +04:00
2012-03-16 03:41:49 +04:00
![Screenshot ](http://i.imgur.com/Xn93Pl.png )
(http://i.imgur.com/Xn93P.png)
Here's what とあるOS has looked like in the past:
2012-02-16 12:02:09 +04:00
* [Fully userspace shell, demonstrating a threading application ](http://i.imgur.com/S7rab.png )
* [Logging in and moving around ](http://i.imgur.com/VjTMv.png )
* [Booting up the (WIP) graphical interface ](http://i.imgur.com/g2yfr.png )
* [Nyaning ](http://i.imgur.com/2BISA.png )
* [Demoing multitasking ](http://i.imgur.com/RY4lb.png )
2011-08-06 10:33:33 +04:00
* [Empty kernel shell ](http://i.imgur.com/44huV.jpg )
2011-11-03 01:36:57 +04:00
* [With a wallpaper and mouse cursor ](http://i.imgur.com/eG0i9.png )
2011-08-06 20:50:03 +04:00
* [Running some GNU apps ](http://i.imgur.com/aKyJb.png )
2011-08-06 10:33:33 +04:00
* [Playing a simple RPG ](http://i.imgur.com/A7csE.jpg )
* [Generating Julia fractals ](http://i.imgur.com/Uy3JJ.jpg )
* [Early boot screen testing and some old serial output ](http://i.imgur.com/1CMJ0.jpg )
2011-01-16 04:03:53 +03:00
## Testing it Out ##
2012-08-16 04:47:34 +04:00
If you are on Debian/Ubuntu/etc., you can clone the repository and run:
./build.sh
This will install the required dependencies, build the userspace libraries and toolchain, build the kernel, and give you a working ramdisk and hard disk.
2012-09-10 07:48:43 +04:00
You can then run `make run` or `make kvm` to run QEMU. An additional `make run-config` command is available that allows easy customization of the emulation environment.
2011-01-16 09:11:25 +03:00
2012-01-28 23:12:11 +04:00
Currently, the only supported environment is QEMU, as our limited graphics drivers do not operate on most real hardware.
2011-01-20 09:27:11 +03:00
2011-03-18 22:23:17 +03:00
## Dependencies ##
### Kernel ###
2012-09-10 07:48:43 +04:00
To build the kernel, you will need `yasm` , `clang` , and GNU `ld` (which you undoubtedly have if you have `clang` or `gcc` ).
### Hard disks ###
You will need `genext2fs` to generate the EXT2 images for the hard disk drive.
2011-01-20 09:27:11 +03:00
## References ##
2012-01-28 23:12:11 +04:00
Here are some tutorials we found useful early on:
2011-01-20 09:27:11 +03:00
2012-01-28 23:12:11 +04:00
* [James M's kernel development tutorials ](http://www.jamesmolloy.co.uk/tutorial_html/index.html )
* [Bran's Kernel Development Tutorial ](http://www.osdever.net/bkerndev/ )
* [Skelix's OS tutorial ](http://en.skelix.org/skelixos/ )
2011-01-20 09:27:11 +03:00
2012-02-16 12:02:09 +04:00
# Licenses #
## ToAruOS Itself ##
2011-01-29 01:53:00 +03:00
2012-09-10 07:48:43 +04:00
This project is released under the terms of the University of Illinois / NCSA Open Source License, an OSI- and FSF-approved, GPL-compatible open source license. The NCSA License is a derivative of the MIT license and the BSD license; it is reproduced here for your convenience:
2011-01-29 01:53:00 +03:00
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal with the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimers.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimers in the
documentation and/or other materials provided with the distribution.
3. Neither the names of the ToAruOS Kernel Development Team, Kevin Lange,
nor the names of its contributors may be used to endorse
or promote products derived from this Software without specific prior
written permission.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
WITH THE SOFTWARE.
2011-04-15 05:49:36 +04:00
2012-02-16 12:02:09 +04:00
## Additional Licenses ##
2011-04-15 05:49:36 +04:00
ToAruOS contains additional software with the following copyright notices:
2012-09-10 07:48:43 +04:00
* The CPU detection code provided in `userspace/cpudet.c` carries the following copyright notice, and has been made available by its author for use in other projects:
2011-04-15 05:49:36 +04:00
Copyright (c) 2006-2007 - http://brynet.biz.tm - < brynet @ gmail . com >
2011-12-16 23:16:20 +04:00
2012-09-10 07:48:43 +04:00
* A copy of the [VL Gothic TrueType font ](http://vlgothic.dicey.org/ ) is included in this repository; VL Gothic is distributed under the following license:
2011-12-16 23:16:20 +04:00
2011-12-16 23:17:14 +04:00
Copyright (c) 1990-2003 Wada Laboratory, the University of Tokyo.
Copyright (c) 2003-2004 Electronic Font Open Laboratory (/efont/).
2012-01-24 08:25:55 +04:00
Copyright (C) 2002-2010 M+ FONTS PROJECT Copyright (C) 2006-2010
Daisuke SUZUKI . Copyright (C) 2006-2010 Project Vine . All rights
reserved.
2011-12-16 23:17:14 +04:00
Redistribution and use in source and binary forms, with or without
2012-01-24 08:25:55 +04:00
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
2011-12-16 23:17:14 +04:00
3. Neither the name of the Wada Laboratory, the University of Tokyo nor
2012-01-24 08:25:55 +04:00
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY WADA LABORATORY, THE UNIVERSITY OF TOKYO
AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE LABORATORY OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
VESA mode switching support.
BIOS execution is provided through the `v8086` module, which provides
software emulation of an 8086 processor. It is not currently working
with some BIOSes and may (read: probably will be) replaced with another
emulator (x86emu comes to mind) at some point in the near future. In the
meantime, the default video mode for QEMU works with this and it's
enough to get us on real VESA instead of fake VBE. The `bochs` module
will be renamed in a future commit. Userspace programs have been
adjusted to work at bitrates other than 32 *POORLY*. If you write pixels
left-to-right, they should work fine. They only work with 24-bpp
otherwise, and then you need to be careful of what pixels you are
writing when, or you will overwrite things in other pixels.
You may pass a commandline argument like the following to set display
modes:
vid=vesa,1024,768
Or for stranger modes under QEMU or Bochs, use the bochs VBE
initializer:
vid=bochs,1280,720
Note that the address of the linear framebuffer is still found via
hackish probing instead of PCI or trusting the VBE information, so if
you have things in the wrong memory ranges (0xE0000000+), be prepared to
have them get read.
Once again, this entire commit is a massive hack. I am happy that it
worked, and I will continue to make it less hacky, but in the meantime,
this is what we've got.
Happy holidays.
2011-12-25 10:40:40 +04:00
* The real-mode 8086 emulation provided for VESA support is distributed under the following license:
Copyright 2010 John Hodge (thePowersGang). All rights reserved.
2012-01-24 08:25:55 +04:00
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
THIS SOFTWARE IS PROVIDED BY < COPYRIGHT HOLDER > ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL < COPYRIGHT HOLDER > OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation
are those of the authors and should not be interpreted as representing
official policies, either expressed or implied, of the author.
2012-09-10 07:48:43 +04:00
* As of January 23, 2012, the repository also contains the [DejaVu fonts ](http://dejavu-fonts.org/wiki/Main_Page ) package, which is a set of public-domain modifications of the Bitstream Vera font set, which is released under this license:
2012-01-24 08:25:55 +04:00
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream
Vera is a trademark of Bitstream, Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of the fonts accompanying this license ("Fonts") and associated
documentation files (the "Font Software"), to reproduce and distribute
the Font Software, including without limitation the rights to use,
copy, merge, publish, distribute, and/or sell copies of the Font
Software, and to permit persons to whom the Font Software is furnished
to do so, subject to the following conditions:
The above copyright and trademark notices and this permission notice
shall be included in all copies of one or more of the Font Software
typefaces.
The Font Software may be modified, altered, or added to, and in
particular the designs of glyphs or characters in the Fonts may be
modified and additional glyphs or characters may be added to the Fonts,
only if the fonts are renamed to names not containing either the words
"Bitstream" or the word "Vera".
This License becomes null and void to the extent applicable to Fonts or
Font Software that has been modified and is distributed under the
"Bitstream Vera" names.
The Font Software may be sold as part of a larger software package but
no copy of one or more of the Font Software typefaces may be sold by
itself.
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT
SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
Except as contained in this notice, the names of Gnome, the Gnome
Foundation, and Bitstream Inc., shall not be used in advertising or
otherwise to promote the sale, use or other dealings in this Font
Software without prior written authorization from the Gnome Foundation
or Bitstream Inc., respectively. For further information, contact:
fonts at gnome dot org.
2012-01-28 04:04:39 +04:00
2012-01-30 00:36:50 +04:00
* The included SHA512 support library (userspace/lib/sha2.{c,h}) is provided under the BSD license as follows:
2012-01-28 04:04:39 +04:00
Copyright (c) 2000-2001, Aaron D. Gifford
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
2012-03-29 01:29:28 +04:00
* The DMZ mouse cursor theme is licensed under the Creative Commons Attribution-ShareAlike 3.0 license with the following copyright notice:
Copyright © 2007-2010 Novell, Inc.
2012-09-06 07:19:52 +04:00
* Bjoern Hoehrmann's super-simple UTF8 decoder is included for use in userspace applications and is provided under the following license:
2012-09-07 01:54:05 +04:00
Copyright (c) 2008-2009 Bjoern Hoehrmann < bjoern @ hoehrmann . de >
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2012-09-09 03:47:43 +04:00
* `userspace/lib/wcwidth.c` is an implementation of the `wcwidth()` non-standard C function by Markus Kuhn, it is provided with the following license:
Markus Kuhn -- 2007-05-26 (Unicode 5.0)
Permission to use, copy, modify, and distribute this software
for any purpose and without fee is hereby granted. The author
disclaims all warranties with regard to this software.
Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
2012-09-10 07:48:43 +04:00
* Build scripts will retrieve copies of [GCC ](http://gcc.gnu.org/ ), [Newlib ](http://sourceware.org/newlib/ ) and [FreeType ](http://www.freetype.org/ ). Patches for these software packages are provided under the same license as the package they are for.
2012-09-07 06:46:36 +04:00