forked from gtungatkar/Linux-kernel-HTTP-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
executable file
·59 lines (44 loc) · 2.01 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
*****HTTP Web Server Kernel Module*****
*******************************
Author: Gaurav Tungatkar
Description:
The simple http server as a kernel module. Implemented using workqueues. Does
not handle concurrency.
One workqueue is used to just monitor the start parameter and start or stop the
server, the other does all the work.
The server can be started or stopped usng the sysfs start switch.
/sys/module/kweb/parameters/start
The port, document root, index file and the type of files that can be served can
be configured using procfs.
/proc/kweb/*
Code organization and directory structure:
Project2
|__ kweb - All source files for kernel module in this directory
|__src
|__kweb.c, Makefile, header files, Module.symvers of ksocket
|__index.html
|__ ksocket - All files of ksocket project in this directory
Some Design Decisions:
1. ksocket.c has been modified to make kaccept() call non blocking.
2. All input to a single proc fs entry must be given as a single string
for eg. : echo ".html text/html\n .png image/png" > /proc/kweb/content_type
3. No concurrency. Web server acts as a single thread. It can service only one request at a time.
As per discussion with Yaogang, ok not to handle concurrency.
Instructions to compile:
1. Go to project2/kweb/src folder.
2. make
3. Go to project2/ksocket-0.0.2/src
4. make
If you do make clean in kweb/src, it will delete the Module.symvers file. This file then has to be explicitly copied from the ksocket folder.
Instructions to run:
First insert ksocket module and then kweb. kweb depends on ksocket.
1. insmod project2/ksocket/src/ksocket.ko
2. insmod project2/kweb/src/kweb.ko
Limitations:
1. Client may send requests in HTTP/1.0 or HTTP/1.1 version. However, server response is always HTTP/1.0
This folows the Robustness principle given in rfc 2145 http://www.ietf.org/rfc/rfc2145.txt
2. Concurrency not handled.
Logging:
Logs can be turned off by defining TRACE to be 0 in log.h at compile time.
Acknowledgements:
Using the ksocket project ksocket.sourceforge.net