toaruos/README.md

156 lines
8.4 KiB
Markdown
Raw Normal View History

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)
2011-11-25 21:46:33 +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 is currently maintained by the UIUC [SIGOps](http://www.acm.uiuc.edu/sigops/). While the ultimate goal is a microkernel, we currently have a very monolithic kernel.
2011-01-16 04:03:53 +03:00
## Notice ##
*This repository is moving to [`acm-uiuc/toaruos`](https://github.com/acm-uiuc/toaruos) at the end of January, 2012. Please be prepared to update your pull URLs and any bookmarks you have.*
## Screenshots ##
Here's what とあるOS looks like:
* [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)
* [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 ##
2011-02-05 08:17:08 +03:00
Clone the git repository and run:
make # to build the kernel
make run # to run qemu with the proper arguments
2011-11-25 21:46:33 +04:00
# or
make kvm # to run qemu in KVM mode
# and optionally
sudo make install # to install the kernel and ramdisk to your /boot directory
2011-02-05 08:17:08 +03:00
This will build the kernel and the ramdisk and, optionally, copy them to your boot directory so you can add them to your grub config. As of 10 Feb 2011, a bootdisk is no longer created and the git repository no longer carries a GRUB disk. Building a bootable floppy has been deprecated in favor of running with QEMU's built-in multiboot support.
2011-01-20 09:55:35 +03:00
My testing environment is a combination of QEMU and VirtualBox.
2011-01-20 09:27:11 +03:00
2011-03-18 22:23:17 +03:00
## Dependencies ##
### Kernel ###
2011-11-25 21:46:33 +04:00
To build the kernel, you will need `yasm`, `clang` (or `gcc`, the build tools will autodetect), and GNU `ld` (which you undoubtedly have if you have `clang` or `gcc`).
2011-03-18 22:23:17 +03:00
### Hard disks and initrds ###
You need `genext2fs` to generate the EXT2 images for the ramdisk and the hard disk drive.
2011-03-18 22:23:17 +03:00
### Documentation ###
2011-11-25 21:46:33 +04:00
To build the primary documentation, you need a complete LaTeX stack with `pdftex`, including the CJK module and Japanese fonts. To build the kernel API documentation, you will need Doxygen (eventually).
2011-03-18 22:23:17 +03:00
2011-01-20 09:27:11 +03:00
## Goals and Roadmap ##
Overall, the goal of this project is to write a relatively POSIX-compatible OS from the ground up. With a focus on generic hardware functionality and universal specifications like VESA, I hope to eventually get something fairly complete in terms of what an OS should be. At some times, I may focus on an actual piece of complex hardware (I am looking to write a basic driver for Intel graphics cards based on the X driver and the Mesa components), but in general, I will stick to generic interfaces.
### Basic Goals ###
* Create a working modular monolithic kernel capable of executing arbitrary ELF binaries
* Write, from scratch, a C standard library using past experience in writing standard library functions
* Support POSIX threads
* Implement an existing file system, specifically EXT2
* Be able to manipulate VESA modes to run at an optimal resolution for graphics
* Handle basic networking on a virtual Ethernet device (DHCP, TCP, etc.)
### Loftier Goals ###
Some things are far easier said than done, but I like to say them anyway. The time span for these depends greatly on how quickly the basic goals are completed and can range anywhere from a few months to years from now.
2011-01-28 23:09:33 +03:00
* Dynamic library loader
2011-01-20 09:27:11 +03:00
* Create a working implementation of Wayland under VESA (will be slow)
* Port Qt (under Wayland) and some Qt apps
2011-01-28 23:09:33 +03:00
* Port Qt under framebuffer first? Qt has everything...
2011-01-20 09:27:11 +03:00
* Support audio in a way that doesn't suck like Linux's mess of libraries and mixers
* Various hardware-specific drivers (primarily for my T410):
* Intel graphics driver, with acceleration so Wayland isn't slow
* Realtek wireless driver, with WPA2
* Specific drivers for the Thinkpad itself (or just acpi?)
2011-01-30 22:37:51 +03:00
* Custom b-tree filesystem
2011-01-20 09:27:11 +03:00
### Roadmap ###
Currently, I have a kernel capable of reading its multiboot parameters, which is terribly un-useful. The current, ordered, plan of attack is as follows:
* Finish James M's tutorial (second half), which covers:
2011-01-21 05:01:23 +03:00
* Paging *done*
2011-01-28 23:05:34 +03:00
* Heap *done, implemented with klmalloc in the void*
* VFS *done*
2011-11-25 21:46:33 +04:00
* Initial RAM Disk *done*
* Multitasking *done*
2011-04-09 08:12:41 +04:00
* User mode *done*
2011-01-20 09:27:11 +03:00
* Finish basic kernel functionality
2011-04-09 08:12:41 +04:00
* Loading ELF binaries and executing them in user mode *done (static)*
2011-11-25 21:46:33 +04:00
* Complete system call table *pretty close*
2011-01-20 09:27:11 +03:00
* Get a better semblance of users and groups
* Write a file system driver for a real file system
2011-11-25 21:46:33 +04:00
* Target is EXT2, but might do FAT *hard disk read support*
2011-01-20 09:27:11 +03:00
* Move OS development images to some form of virtual drive (VDI or something QEMU compatible)
* Implement a VESA mode handler
2011-04-09 08:12:41 +04:00
* QEMU / BOCHS VBE driver *done*
2011-01-20 09:27:11 +03:00
* Requires a Virtual 8086 monitor
* Need to be able to use graphics modes and still have output, so write a framebuffer terminal
* Complete libc
* Enough to run basic unix tools...
* Port some basic UNIX tools
* a shell (bash and zsh, because I like bash, but the office uses zsh)
* ls, mv, rm, etc.
* here's a real test: perl
* Implement networking
* IPv4
* Ethernet driver for QEMU or VirtualBox
*Anything beyond this point is part of the 'Loftier Goals' section*
* Wayland compositor
* based on specifications for a Wayland environment
* Port some of the Wayland sample applications
* Write my own!
* Port Qt
* Specifically, for Wayland
* Qt is huge and has its own standard library, might need more extensive libc
* Need to support C++-built stuff, so will probably need a C++ stdlib.
* Audio drivers
* Maybe before Qt?
* Should support software mixing at least, hardware under a virtual machine, maybe my Intel hw
## References ##
I'll be more detailed here eventually, but for the most part, I have been using:
2011-04-09 08:12:41 +04:00
* [James M's kernel development tutorials](http://www.jamesmolloy.co.uk/tutorial_html/index.html) *completed*
2011-01-20 09:51:25 +03:00
* [Bran's Kernel Development Tutorial](http://www.osdever.net/bkerndev/) *completed*
2011-11-25 21:46:33 +04:00
* [Skelix's OS tutorial](http://en.skelix.org/skelixos/) *completed*
2011-01-20 09:27:11 +03:00
2011-01-29 01:53:00 +03:00
## License ##
ToAruOS is under the NCSA license, which is a derivative (and fully compatible with) the BSD license. It is also forward compatible with the GPL, so you can use ToAruOS bits and pieces in GPL. The terms of the license are listed here for your convience:
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
### Additional Licenses ###
ToAruOS contains additional software with the following copyright notices:
* The CPU detection code provided in `kernel/core/cpudet.c`:
Copyright (c) 2006-2007 - http://brynet.biz.tm - <brynet@gmail.com>