aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LICENSE.md16
-rw-r--r--doc/style.md8
-rwxr-xr-xscripts/check-header.py23
-rw-r--r--src/kernel.c6
4 files changed, 53 insertions, 0 deletions
diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 0000000..0610832
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,16 @@
+Copyright (c) 2022 aqua@iserlohn-fortress.net
+
+Permission to use, copy, modify, and distribute this software for any purpose
+with or without fee is hereby granted, provided that the above copyright notice
+and this permission notice appear in all copies.
+
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+SPDX License Identifier: [ISC](https://spdx.org/licenses/ISC.html)
+
diff --git a/doc/style.md b/doc/style.md
new file mode 100644
index 0000000..28b712d
--- /dev/null
+++ b/doc/style.md
@@ -0,0 +1,8 @@
+## file headers
+```c
+//=====================================================================
+// <component name>
+// spdx-license-identifier: ISC
+// description:
+//=====================================================================
+```
diff --git a/scripts/check-header.py b/scripts/check-header.py
new file mode 100755
index 0000000..67aea38
--- /dev/null
+++ b/scripts/check-header.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python3
+
+import sys
+import re
+
+line_re = [
+ r'^\/\/\={69}$',
+ r'^\/\/ \w+',
+ r'^\/\/ spdx-license-identifier: (ISC)',
+ r'^\/\/ description: \w+'
+]
+
+if __name__ == '__main__':
+ errors = 0
+
+ with open(sys.argv[1]) as f:
+ for i in range(len(line_re)):
+ if re.search(line_re[i], f.readline()) == None:
+ print(f'wrong license header: {sys.argv[1]}:{i}')
+ errors += 1
+
+ if errors != 0:
+ sys.exit(1)
diff --git a/src/kernel.c b/src/kernel.c
index b9a6bdf..b652c23 100644
--- a/src/kernel.c
+++ b/src/kernel.c
@@ -1,3 +1,9 @@
+//=====================================================================
+// glitch kernel
+// spdx-license-identifier: ISC
+// description: kernel entry point
+//=====================================================================
+
#include "mem.h"
#include <gdt.h>