BD-shell (a.k.a. bdsh) is a tiny Unix shell written in C. It’s a project required for the Operating System Course at my University.
It is written using a clean coding style, following xP coding standard philosophy.
Version 1.0 is the release that satisfies all the course requirements!

Features

Cool Features

  • Lightweight
  • Implements real Job Control
  • Clear and understandable code, ideal for Academic (and personal) studies
  • Makes use of various system calls, signals, signal handlers, user input handling, data structures implementation
  • Free Software!

Cool Features NOT present (but may be in future)

  • No command history present
  • No command/filename auto completion
  • No wildcars
  • No command piping, just a single command can be launched at a time
  • Put everything else here.

Requirements for 1.0.0

These are the requirements asked by the teaching professor. The complete project description page is located at http://www.inf.unibz.it/~david/os/project.html
The shell must be able to do the following:

  1. to read commands from standard input and execute them in a loop until a
    built-in command exit is issued (we call these processes the foreground processes; there is always at most one of these at any particular time);
  2. be able to redirect the standard input and output of commands by prefixing them with built-in commands in file and out file;
  3. be able to terminate (involuntarily) the foreground process when user presses ^C and return back to the mini-shell;
  4. be able to interrupt the foreground process temporarily, when user presses ^Z, returning to the mini-shell;
  5. be able to execute any number of processes in background (i.e., in parallel with the foreground process), including in particular, the ability to start another process while a process has been temporarily suspended;
  6. inform the user when the background process finishes or is
    waiting for an input from the terminal;
  7. be able to inform the user what commands are executing in the background by issuing the built-in command jobs, this should include information about the state of the process (i.e., suspended, background, waiting for input, etc.) and about what file(s) is the background process using for standard input and output);
  8. be able to terminate involuntarily a background processes by issuing the built-in command kill job-number.
  9. to be able to resume a process or to make a background process into the foreground process (i.e., the one that currently interacts with the terminal) by issuing the fg job-number command.

 

Download:

  • 2008-09-14 – bd-shell-v1.0.0.tar.
    • fixed synchronization bug in putJobBackground() that made not notify background processes requesting input (in some situations)

    Known Bugs:

    • Lots of! I consider bdsh-1.0.0 stable because it covers ALL requirements of the course and does them whell on various Unix systems. So it works, but commands like “in non_existent_file cat” won’t work and will crash it!

    What will be next?

    • I don’t know. I may consider a 1.0.1 release to fix future bugs. I may also think to add cool features to make the shell complete. I hope I will have the time for it. You can also do it by yourself and send me the code

Old Releases

Due to a server crash, the old releases are unavailable.

License:

BD-shell is released under The Gnu GPL version 3! This is different from the license of the contents of the blog

This program 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.

This program 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 this program. If not, see <http://www.gnu.org/licenses/>>.

Submit a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Skills

, ,

Posted on

February 15, 2014