Commit 9916dddc authored by Alexandru Dura's avatar Alexandru Dura

Import PintOS

parents
# C/C++
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# Other
*~
\#*\#
src -*- text -*-
---
* Pintos core originally written by Ben Pfaff <blp@cs.stanford.edu>.
* Additional features contributed by Anthony Romano <chz@vt.edu>.
* The original structure and form of this operating system is inspired
by the Nachos system from the University of California, Berkeley. A
few of the source files are more-or-less literal translations of the
Nachos C++ code into C. These files bear the original UCB license
notice.
projects
--------
* The projects are primarily the creation of Ben Pfaff
<blp@cs.stanford.edu>.
* Godmar Back <godmar@gmail.com> made significant contributions to
project design.
* Although little remains unchanged, the projects were originally
derived from those designed for Nachos by current and former CS140
teaching assistants at Stanford University, including at least the
following people:
- Yu Ping <yph@cs.stanford.edu>
- Greg Hutchins
- Kelly Shaw <kashaw (at) cs.stanford.edu>,
- Paul Twohey <twohey AT cs DOT stanford DOT edu>
- Sameer Qureshi <squreshi@cs.stanford.edu>
- John Rector
If you're not on this list but should be, please let me know.
* Example code for condition variables is from classroom slides
originally by Dawson Engler and updated by Mendel Roseblum.
Pintos, including its documentation, is subject to the following
license:
Copyright (C) 2004, 2005, 2006 Board of Trustees, Leland Stanford
Jr. University. All rights reserved.
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.
A few individual files in Pintos were originally derived from other
projects, but they have been extensively modified for use in Pintos.
The original code falls under the original license, and modifications
for Pintos are additionally covered by the Pintos license above.
In particular, code derived from Nachos is subject to the following
license:
/* Copyright (c) 1992-1996 The Regents of the University of California.
All rights reserved.
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose, without fee, and
without written agreement is hereby granted, provided that the
above copyright notice and the following two paragraphs appear
in all copies of this software.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO
ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE
AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
MODIFICATIONS.
*/
*.aux
*.cp
*.dvi
*.fn
*.info*
*.ky
*.log
*.pg
*.toc
*.tp
*.vr
/pintos.fns
/pintos.tps
/pintos.vrs
mlfqs1.pdf
mlfqs1.png
mlfqs2.pdf
mlfqs2.png
pintos.html
pintos.pdf
pintos.ps
pintos.text
pintos_*.html
projects.html
sample.tmpl.texi
#!/bin/sh
export PINTOS_HOME=`pwd`
export PATH=$PATH:`pwd`/src/utils
cscope.files
cscope.out
TAGS
tags
Pintos, including its documentation, is subject to the following
license:
Copyright (C) 2004, 2005, 2006 Board of Trustees, Leland Stanford
Jr. University. All rights reserved.
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.
A few individual files in Pintos were originally derived from other
projects, but they have been extensively modified for use in Pintos.
The original code falls under the original license, and modifications
for Pintos are additionally covered by the Pintos license above.
In particular, code derived from Nachos is subject to the following
license:
/* Copyright (c) 1992-1996 The Regents of the University of California.
All rights reserved.
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose, without fee, and
without written agreement is hereby granted, provided that the
above copyright notice and the following two paragraphs appear
in all copies of this software.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO
ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE
AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
MODIFICATIONS.
*/
Also, code derived from MIT's 6.828 course code is subject to the
following license:
/*
* Copyright (C) 1997 Massachusetts Institute of Technology
*
* This software is being provided by the copyright holders under the
* following license. By obtaining, using and/or copying this software,
* you agree that you have read, understood, and will comply with the
* following terms and conditions:
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose and without fee or royalty is
* hereby granted, provided that the full text of this NOTICE appears on
* ALL copies of the software and documentation or portions thereof,
* including modifications, that you make.
*
* THIS SOFTWARE IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO
* REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE,
* BUT NOT LIMITATION, COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR
* WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR
* THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY
* THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. COPYRIGHT
* HOLDERS WILL BEAR NO LIABILITY FOR ANY USE OF THIS SOFTWARE OR
* DOCUMENTATION.
*
* The name and trademarks of copyright holders may NOT be used in
* advertising or publicity pertaining to the software without specific,
* written prior permission. Title to copyright in this software and any
* associated documentation will at all times remain with copyright
* holders. See the file AUTHORS which should have accompanied this software
* for a list of all copyright holders.
*
* This file may be derived from previously copyrighted software. This
* copyright applies only to those changes made by the copyright
* holders listed in the AUTHORS file. The rest of this file is covered by
* the copyright notices, if any, listed below.
*/
# -*- makefile -*-
SHELL = /bin/sh
VPATH = $(SRCDIR)
# Binary utilities.
# If the host appears to be x86, use the normal tools.
# If it's x86-64, use the compiler and linker in 32-bit mode.
# Otherwise assume cross-tools are installed as i386-elf-*.
X86 = i.86\|pentium.*\|[pk][56]\|nexgen\|viac3\|6x86\|athlon.*\|i86pc
X86_64 = x86_64
ifneq (0, $(shell expr `uname -m` : '$(X86)'))
CC = gcc
LD = ld
OBJCOPY = objcopy
else
ifneq (0, $(shell expr `uname -m` : '$(X86_64)'))
CC = gcc -m32
LD = ld -melf_i386
OBJCOPY = objcopy
else
CC = i386-elf-gcc
LD = i386-elf-ld
OBJCOPY = i386-elf-objcopy
endif
endif
ifeq ($(strip $(shell command -v $(CC) 2> /dev/null)),)
$(warning *** Compiler ($(CC)) not found. Did you set $$PATH properly? Please refer to the Getting Started section in the documentation for details. ***)
endif
# Compiler and assembler invocation.
DEFINES =
WARNINGS = -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wsystem-headers
CFLAGS = -g -msoft-float -O -march=i686 -fPIE -mno-stackrealign
CPPFLAGS = -nostdinc -I$(SRCDIR) -I$(SRCDIR)/lib
ASFLAGS = -Wa,--gstabs
LDFLAGS =
DEPS = -MMD -MF $(@:.o=.d)
# Turn off -fstack-protector, which we don't support.
ifeq ($(strip $(shell echo | $(CC) -fno-stack-protector -E - > /dev/null 2>&1; echo $$?)),0)
CFLAGS += -fno-stack-protector
endif
# Turn off --build-id in the linker, which confuses the Pintos loader.
ifeq ($(strip $(shell $(LD) --help | grep -q build-id; echo $$?)),0)
LDFLAGS += -Wl,--build-id=none
endif
%.o: %.c
$(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS) $(WARNINGS) $(DEFINES) $(DEPS)
%.o: %.S
$(CC) -c $< -o $@ $(ASFLAGS) $(CPPFLAGS) $(DEFINES) $(DEPS)
BUILD_SUBDIRS = threads userprog vm filesys
all::
@echo "Run 'make' in subdirectories: $(BUILD_SUBDIRS)."
@echo "This top-level make has only 'clean' targets."
CLEAN_SUBDIRS = $(BUILD_SUBDIRS) examples utils
clean::
for d in $(CLEAN_SUBDIRS); do $(MAKE) -C $$d $@; done
rm -f TAGS tags
distclean:: clean
find . -name '*~' -exec rm '{}' \;
TAGS_SUBDIRS = $(BUILD_SUBDIRS) devices lib
TAGS_SOURCES = find $(TAGS_SUBDIRS) -name \*.[chS] -print
TAGS::
etags --members `$(TAGS_SOURCES)`
tags::
ctags -T --no-warn `$(TAGS_SOURCES)`
cscope.files::
$(TAGS_SOURCES) > cscope.files
cscope:: cscope.files
cscope -b -q -k
# -*- makefile -*-
SRCDIR = ../..
all: kernel.bin loader.bin
include ../../Make.config
include ../Make.vars
include ../../tests/Make.tests
# Compiler and assembler options.
kernel.bin: CPPFLAGS += -I$(SRCDIR)/lib/kernel
# Core kernel.
threads_SRC = threads/start.S # Startup code.
threads_SRC += threads/init.c # Main program.
threads_SRC += threads/thread.c # Thread management core.
threads_SRC += threads/switch.S # Thread switch routine.
threads_SRC += threads/interrupt.c # Interrupt core.
threads_SRC += threads/intr-stubs.S # Interrupt stubs.
threads_SRC += threads/synch.c # Synchronization.
threads_SRC += threads/palloc.c # Page allocator.
threads_SRC += threads/malloc.c # Subpage allocator.
# Device driver code.
devices_SRC = devices/pit.c # Programmable interrupt timer chip.
devices_SRC += devices/timer.c # Periodic timer device.
devices_SRC += devices/kbd.c # Keyboard device.
devices_SRC += devices/vga.c # Video device.
devices_SRC += devices/serial.c # Serial port device.
devices_SRC += devices/block.c # Block device abstraction layer.
devices_SRC += devices/partition.c # Partition block device.
devices_SRC += devices/ide.c # IDE disk block device.
devices_SRC += devices/input.c # Serial and keyboard input.
devices_SRC += devices/intq.c # Interrupt queue.
devices_SRC += devices/rtc.c # Real-time clock.
devices_SRC += devices/shutdown.c # Reboot and power off.
devices_SRC += devices/speaker.c # PC speaker.
# Library code shared between kernel and user programs.
lib_SRC = lib/debug.c # Debug helpers.
lib_SRC += lib/random.c # Pseudo-random numbers.