Coder Social home page Coder Social logo

sawa's Introduction

SaWa (Samba Wannabe)

SaWa is networking filesystem on Linux. It is composed of two pieces:

  • A file server running in userspace which is accessible through TCP port 5000 (port 5001 for administrative commands)
  • A block driver, which acts as the client and talks to the server through TCP/IP

The file server

The fileserver listens to port 5000, uses a flat file for the filesystem and accepts four commands:

  • Info, which returns the number of sectors

  • Read, which reads a certain number of bytes

  • Write, which writes some data at a certain offset

  • Stop, which stops the server

    $ ./server/sawad [-debug] Server started on port 5000

To test the fileserver, sawa-client is also provided:

$ ./server/sawa-client info
$ ./server/sawa-client write 10 100
$ ./server/sawa-client read 10 100
$ ./server/sawa-client test 3
$ ./server/sawa-client stop
$ ./server/sawa-client stat

The device driver

The device driver is a Linux block driver which connects to the file server using TCP/IP (currently only on localhost) when it needs to access the data. See here for further information about how the device driver works.

You must be logged as root to install and test it:

  • make
  • make test: installs the driver
  • fdisk /dev/sawa0: creates a partition
    • Enter n (to create a new partition), select all default options
    • Enter w to commit the changes
  • mkfs /dev/sawa0: formats the filesystem
  • mount /dev/sawa0 /mnt: mounts the filesystem

After this the filesystem is available, e.g.

# cd /mnt/
# echo "Hello World" > hello.txt
# cat hello.txt

To uninstall the driver:

  • umount /mnt: unmounts the filesystem
  • make end: uninstalls the driver

Web Server

sawad is designed to handle multiple connections (using different threads). In order to test how well sawad handles workload, it has an -http option which turns it into a rudimentary Web server, so it can be tested by tools such as ab.

./server/sawad -http
./server/sawad -http -debug

ToWa (Tomcat Wannabe - in construction)

On top of being a Web Server, sawad can also be the frontend for the ToWa Application Server, servicing Java servlets.

This module is in construction and is barely working at this point. It requires several things to work properly:

Architecture

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.