diff --git a/.gitignore b/.gitignore index 89a585fc9..e85ef6af5 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,7 @@ *.a *.pdf bochsout.txt -bin/* +bin bin/sbin/* bin/ubin/* doc/*-kernel @@ -47,9 +47,13 @@ toolchain # ISO Images *.img *.iso -nanvix-iso/* +nanvix-iso tools/run/bochsrc.txt # Exceptions. !doc/paper/img/*.pdf !doc/paper/*.pdf + +# IDEs +.vs +.vscode \ No newline at end of file diff --git a/README.md b/README.md index b156d6a50..905e9f807 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,11 @@ -# Nanvix +# BThread - A basic user-level thread library for Nanvix -[![Join us on Slack!](https://img.shields.io/badge/chat-on%20Slack-e01563.svg)](https://join.slack.com/t/nanvix/shared_invite/zt-1yu30bs28-nsNmw8IwCyh6MBBV~B~X7w) +The Bthread library is created for the Interdisciplinary Project V subject +of the computer science course at PUC Minas. ## What Is Nanvix? -> This repository hosts the educational version of Nanvix. - -Nanvix is a Unix-like operating system written by [Pedro Henrique +[Nanvix](https://github.com/nanvix/nanvix) is a Unix-like operating system written by [Pedro Henrique Penna](https://github.com/ppenna) for educational purposes. It is designed to be simple and small, but also modern and fully featured. @@ -16,10 +15,20 @@ Nanvix targets 32-bit x86-based PCs and only requires a floppy or CD-ROM drive and 16 MB of RAM. You can run it either in a real PC or in a virtual machine, using a system image. - - ## License and Maintainers +### Nanvix + Nanvix is a free software that is under the GPL V3 license and is maintained by Pedro Henrique Penna. Any questions or suggestions send him an email: + +### BThread + +BThread is also under the GPL V3 license and is created by: + +- [Arthur Ruiz](https://github.com/ArthurSRuiz) +- [Edmar Melandes](https://github.com/Lexizz7) +- [Marco Aurélio Noronha](https://github.com/marconoronha) +- [Pedro Pampolini](https://github.com/PedroPampolini) +- [Vinicius Gabriel Santos](https://github.com/ravixr) diff --git a/doc/setup.md b/doc/setup.md index 71f2fd94f..14dcd2ae5 100644 --- a/doc/setup.md +++ b/doc/setup.md @@ -9,12 +9,11 @@ This document instructs you on how to setup your development environment. ## 1. Clone This Repository ```bash -export WORKSPACE=$HOME/nanvix # Change this if you want. -export INSTALL_DIR=$WORKSPACE # Change this if you want. -mkdir -p $WORKDIR # Create workspace. -cd $WORKDIR # Switch to workspace. -git clone https://github.com/nanvix/nanvix.git # Clone repository. -cd nanvix # Switch to source tree. +export WORKDIR=$HOME/nanvix # Change this if you want. +export INSTALL_DIR=$WORKDIR # Change this if you want. +mkdir -p $WORKDIR # Create workspace. +cd $WORKDIR # Switch to workspace. +git clone https://github.com/Bois-Barganhados-Studio/nanvix-user-level-thread.git . # Clone repository. ``` ## 2. Install Dependencies diff --git a/include/bthread.h b/include/bthread.h new file mode 100644 index 000000000..6b282fe99 --- /dev/null +++ b/include/bthread.h @@ -0,0 +1,6 @@ +#ifndef BTHREAD_H_ +#define BTHREAD_H_ + + + +#endif /* BTHREAD_H_ */ \ No newline at end of file diff --git a/src/lib/bthread/makefile b/src/lib/bthread/makefile new file mode 100755 index 000000000..710979a10 --- /dev/null +++ b/src/lib/bthread/makefile @@ -0,0 +1,40 @@ +# +# Copyright(C) 2011-2016 Pedro H. Penna +# +# This file is part of Nanvix. +# +# Nanvix is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Nanvix is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Nanvix. If not, see . +# + +# C source files. +C_SRC = $(wildcard *.c) \ + +# Object files. +OBJ = $(C_SRC:.c=.o) \ + +# Library name. +LIB = bthread.a + +# Builds the library. +all: $(OBJ) + $(AR) $(ARFLAGS) $(LIBDIR)/$(LIB) $^ + +# Builds object file from C source file. +%.o: %.c + $(CC) $< $(CFLAGS) -c -o $@ + +# Cleans compilation files. +clean: + @rm -f $(LIBDIR)/$(LIB) + @rm -f $(OBJ) diff --git a/src/lib/makefile b/src/lib/makefile index fd583bcdd..e779d677d 100644 --- a/src/lib/makefile +++ b/src/lib/makefile @@ -19,14 +19,19 @@ # Conflicts. .PHONY: libc +.PHONY: bthread # Builds everything. -all: libc +all: libc bthread # Builds C library. libc: cd libc/ && $(MAKE) all +bthread: + cd bthread/ && $(MAKE) all + # Cleans compilation files. clean: cd libc && $(MAKE) clean + cd bthread && $(MAKE) clean diff --git a/src/ubin/bthd/bthd.c b/src/ubin/bthd/bthd.c new file mode 100644 index 000000000..c532d5eb0 --- /dev/null +++ b/src/ubin/bthd/bthd.c @@ -0,0 +1,8 @@ +#include +#include + +int main(/*int argc, char *const argv[]*/) +{ + fprintf(stderr, "Not implemented yet!\n"); + return 0; +} \ No newline at end of file diff --git a/src/ubin/makefile b/src/ubin/makefile index 729a0d8b5..6a478061d 100644 --- a/src/ubin/makefile +++ b/src/ubin/makefile @@ -43,10 +43,11 @@ .PHONY: clear .PHONY: nim .PHONY: sleep +.PHONY: bthd # Builds everything. all: cat chgrp chmod chown cp echo kill ln login ls mv nice pwd rm stat sync \ - touch tsh ps clear nim sleep + touch tsh ps clear nim sleep bthd # Builds cat. cat: @@ -144,6 +145,9 @@ nim: sleep: $(CC) $(CFLAGS) $(LDFLAGS) -D TESTE sleep/*.c -o $(UBINDIR)/sleep $(LIBDIR)/libc.a +# Builds bthd. +bthd: + $(CC) $(CFLAGS) $(LDFLAGS) bthd/*.c -o $(UBINDIR)/bthd $(LIBDIR)/*.a # Clean compilation files. clean: @@ -171,3 +175,4 @@ clean: @rm -f $(UBINDIR)/clear @rm -f $(UBINDIR)/nim @rm -f $(UBINDIR)/sleep + @rm -f $(UBINDIR)/bthd